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 |
What are the type of Indexes? which one is best, why?
What is the difference between char and varchar2 datatype in sql?
Following are some of the question related to below mentioned query? select e1.salary from employee3 e1 where 2= ( select count(distinct(e2.salary)) from employee3 e2 where e2.salary>=e1.salary ) 1) What the query returns? 2) How it works? - Detail explanation (what the sub query does, why it is (where 2=)....etc...Please?
Explain left outer join and right outer join?
What is the difference between Normalization and De-normalization?
What are indexes? When do you need to create Indexes?
4 Answers CarrizalSoft Technologies, HP,
Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?
Define msdb database?
Which is better in performance - CONSTRAINT or TRIGGER over a column which restricts say an input of particular value in a column of a table?
How does clustered and non clustered index work?
What r sql reporting services and analysis services? how can we use it.
How many ways to create table-valued functions?