one of my frnd asked about the use of CURSORS while developing database....
here i will clarify one thing......we can insert bulk rows into the table by using of cursors......stored procedures or by using of normal syntaxes we cant insert bulk rows......
syntax:
declare @name varchar(50),
@address varchar(50)
set @name='shiva'
set @address='vizag'
declare cursor test local for insert into test values (@name, @address)
open test
fetch next from test
while @@fetch_status=0
fetch next from test
close test
deallocate test
here i will clarify one thing......we can insert bulk rows into the table by using of cursors......stored procedures or by using of normal syntaxes we cant insert bulk rows......
syntax:
declare @name varchar(50),
@address varchar(50)
set @name='shiva'
set @address='vizag'
declare cursor test local for insert into test values (@name, @address)
open test
fetch next from test
while @@fetch_status=0
fetch next from test
close test
deallocate test
No comments:
Post a Comment