首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

存储过程能这样写吗?该怎么解决

2012-01-09 
存储过程能这样写吗?createPROCEDUREApp_Customers_Update@CustomerIDint,@Phonenvarchar(32),@FamilyType

存储过程能这样写吗?
create   PROCEDURE   App_Customers_Update
@CustomerID   int,
@Phone   nvarchar(32),
@FamilyTypeID   int,
@IDCardNo   nvarchar(32),
@CustomerLevel   int,
@FamilyTypeName   nvarchar(64)


AS
Update   Customers
set   Phone   =   @Phone,FamilyTypeID   =   (select   FamilyTypeID   from   FamilyType   where   FamilyTypeName   =   @FamilyTypeName),IDCardNo   =   @IDCardNo,CustomerLevel   =   @CustomerLevel
where   CustomerID   =   @CustomerID
RETURN


[解决办法]
应该可以,如果出错把select FamilyTypeID from FamilyType where FamilyTypeName = @FamilyTypeName赋值给一个变量,然后FamilyTypeID=变量
[解决办法]
跟踪一下@FamilyTypeName参数的值
然后在查询分析器下运行这句select FamilyTypeID from FamilyType where FamilyTypeName = 监视得到的值,看看什么结果

热点排行