随笔分类 -  Sql Server

摘要:1、sql语句中 insert into tableName() output inserted.id values() 2 、存储过程中 ALTER PROCEDURE dbo.getBuyMedicID ( @id int output, @AllsumMoney money ) AS begin INSERT INTO t_buyMedic(sumMoney,buyDate) VALUES(@AllsumMoney,getdate()) select @id=@@identity... 阅读全文
posted @ 2012-05-05 16:08 易水寒2012 阅读(2161) 评论(0) 推荐(0)
摘要:今天碰到一个奇怪的问题,具体见csdn:http://topic.csdn.net/u/20120424/19/0aeacbce-a9d5-4630-8b87-a08d5df1828b.html?seed=1347097422&r=78358698#r_78358698解决方法与原因:猜测,因为数据库是我再vs2010中建立的,数据库版本为sql2005,在ssms中查看不到vs中的数据库的,所有【手贱】附加了一下。之后就发现如上问题,insert语句和存储过程无效果,但返回值成功。且我的update delete select语句能成功执行,并且正常取值。折腾2个多小时找不到问题所在 阅读全文
posted @ 2012-04-25 03:11 易水寒2012 阅读(444) 评论(0) 推荐(0)
摘要:using System;using System.Data.Sql;using System.Text;namespace AllSqlServer{ class Program { static void Main(string[] args) { //SQLDMO.NameList names; //SQLDMO.ApplicationClass ac = new SQLDMO.ApplicationClass(); //names = ac.ListAvailableSQLServ... 阅读全文
posted @ 2012-04-24 14:05 易水寒2012 阅读(1610) 评论(0) 推荐(1)
摘要:/// <summary> /// 获取sqlserverName(计算机名)上所有的数据库名称 /// </summary> /// <param name="sqlserverName"></param> /// <returns></returns> public static List<string> getAllDataBase(string sqlserverName) { List<string> listdatabase = new List<string& 阅读全文
posted @ 2012-04-24 14:04 易水寒2012 阅读(428) 评论(0) 推荐(0)