以下SQL语句,如何加入C#代码
以下是SQL查询分析器中调试通过的代码:
declare @name varchar(50)
select @name =b.name from sysobjects b join syscolumns a on b.id = a.cdefault
where a.id = object_id('bj_gzbxz')
and a.name ='L1'
我想把他转换成C#中代码,如果写,并得到 @name 中的值并复制给C#中变量
[解决办法]
create proc pro_test @name varchar(50)outputasselect @name =b.name from sysobjects b join syscolumns a on b.id = a.cdefault where a.id = object_id('bj_gzbxz') and a.name ='L1'go
[解决办法]
create proc pro_test (@name varchar(20) output)--忘了写类型select @name =b.name from sysobjects b join syscolumns a on b.id = a.cdefault where a.id = object_id('bj_gzbxz') and a.name ='L1'go