mahnaz_h
پنج شنبه 14 شهریور 1387, 16:11 عصر
نمی دونم چرا این کرزر پیغام خطا می ده؟!
declare @Id int
create ShopCursor cursor
for select Id from TShop
open ShopCursor
fetch ShopCursor into @Id
while (@@sqlstatus = 0)
begin
fetch ShopCursor into @Id
select @Id
end
close ShopCursor
deallocate cursor ShopCursor
select @Id
پیغام خطاش هم:
Server: Msg 170, Level 15, State 1, Line 20
Line 20: Incorrect syntax near 'ShopCursor'.
Server: Msg 137, Level 15, State 1, Line 24
Must declare the variable '@@sqlstatus'.
Server: Msg 156, Level 15, State 1, Line 30
Incorrect syntax near the keyword 'cursor'.
دستوراتش را عینا از کتاب نوشتم . چرا این پیغام ها رو میده؟
جدولی با نام ُTShopهم موجود و ساخته شده است و حاوی تعدادی رکورد است
declare @Id int
create ShopCursor cursor
for select Id from TShop
open ShopCursor
fetch ShopCursor into @Id
while (@@sqlstatus = 0)
begin
fetch ShopCursor into @Id
select @Id
end
close ShopCursor
deallocate cursor ShopCursor
select @Id
پیغام خطاش هم:
Server: Msg 170, Level 15, State 1, Line 20
Line 20: Incorrect syntax near 'ShopCursor'.
Server: Msg 137, Level 15, State 1, Line 24
Must declare the variable '@@sqlstatus'.
Server: Msg 156, Level 15, State 1, Line 30
Incorrect syntax near the keyword 'cursor'.
دستوراتش را عینا از کتاب نوشتم . چرا این پیغام ها رو میده؟
جدولی با نام ُTShopهم موجود و ساخته شده است و حاوی تعدادی رکورد است