存储过程:
Create   procedure Add_Product
        @orderId varchar(10),
@customerName varchar(20),
        @productId int,
        @productCount int
asinsert into OrdersInfo 
       (orderId,customerName,productId,productCount) 
 values(@orderId,@customerName,@productId,@productCount)GO
执行命令行:
exec Add_Product ('dx001','daixin',5,2)
错误信息:
服务器: 消息 170,级别 15,状态 1,行 1
第 1 行: 'dx001' 附近有语法错误。

解决方案 »

  1.   

    执行带参数的存储过程时,参数不能用括号括起来,这和函数调用不一样.这样试试:
    exec Add_Product 'dx001','daixin',5,2
      

  2.   

    非常感谢:hellowork(一两清风) 
    初学者别见笑阿
      

  3.   

    --在命令提示符下输入一下语句查看
    mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%20Server\80\Tools\Books\tsqlref.chm::/ts_create_4hk5.htm