Я использую SQL Server 2005 Management Studio Express. Монеты и темы - мои таблицы. Я создал хранимых процедур с использованием двух указанных выше и получил ударилОшибка параметризованной хранимой процедуры
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
Я хотел бы знать, где я пошло не так ??
Если вы посмотрите на документацию для [create procedure] (http://msdn.microsoft.com/en-us/library/ms187926.aspx), я уверен, что вы поймете, где вы поступили не так. Первым делом было бы объявить параметры '@ parameter', но у вас больше проблем. –