Write the Syntax for Cursors.
Answers were Sorted based on User's Feedback
Answer / govardhana r
DECLARE @var1 varchar(20), @var2 varchar(20)
declare cursor_name cursor for
select val1,val2 from table_name
open cursor_name
fetch next from cursor_name
into @var1, @var2
while @@FETCH_STATUS = 0
begin
-----
-----
-----
fetch next from cursor_name
into @var1, @var2
end
close cursor_name
deallocate cursor_name
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / ranjith kumar
declare cursor_name cursor for
select * from table_name
open cursor_name
fetch next from cursor_name
Is This Answer Correct ? | 6 Yes | 2 No |
I am using SQL Server 2005, I have some select and update statements in my query with WHERE clause I want to prevent these queries from SQL injection attacks. What are the steps and precautions to be taken for SQL Injection attacks? Does anybody have suggestions? Thanks in advance,
What is tablesample?
What the different types of Replication and why are they used?
What is a functions and types in sql server?
Can you explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
Do you know what are different types of replication in sql server?
How is foreign key related to primary key?
What is statement level trigger?
What functions can a view be used to performed?
How to use transact-sql statements to access the database engine?
Do you know exporting and importing utility?
How to verify a login name with sqlcmd tool?