SQL Server 2005 Management Studio Expressを使用しています。コインとテーマは私のテーブルです。私は上記の2を使用してストアドプロシージャを作成し、ここでパラメータ化ストアドプロシージャエラー
Error:Msg 102, Level 15, State 1, Procedure themestat, Line 1
Incorrect syntax near 'id2'.
で打たれてしまった私の全体の手順です:
create procedure themestat(id2 In numeric, id1 In numeric)
is
@userid nvarchar(50), @co nvarchar(50), @price nvarchar(50)
begin
update themes set prioirty=1 where themeid=id2;
select credits as co from coins where uid=id1;
select rate as price from themes where priority=1;
if(co>price)
begin
update themes set status=1 where priority=1;
update themes set priority=0 where themeid=id2;
end
else
begin
update themes set priority=0 where theme=id2;
PRINT 'no sufficient coins'
end
end
私は私が間違っていた場所を知って好奇心?
[プロシージャの作成](http://msdn.microsoft.com/en-us/library/ms187926.aspx)のドキュメントを参照すると、間違っていた箇所を見つけることができます。まずパラメータ '@ parameter'を宣言する方法ですが、それ以上の問題があります。 –