Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Cursor validation

Author  Topic 

susan_151615
Yak Posting Veteran

99 Posts

Posted - 2009-03-18 : 07:21:12
Hi i have a table which has lot of records in it.The fields of the record are:
First Name,Last Name,DOB
I have to fetch the first record and i have to validate the first field First Name if it is blank then it must stop processing there itself and come out of the process displaying an error messade "Error".I want to do it using cursor can anyone help me for it

susan

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-18 : 07:24:15
what kind of validation and processing ?? May be you could do it without using a cursor.. you'll need to post more.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-18 : 07:24:26
Why is there a need using a cursor? Set-based solutions are faster and more robust.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

susan_151615
Yak Posting Veteran

99 Posts

Posted - 2009-03-18 : 07:28:39
But i want to implement using cursor only can u frame the code how to use with and without cursor

susan
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-18 : 07:29:35
It depends what you are doing with the records later.
See http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

susan_151615
Yak Posting Veteran

99 Posts

Posted - 2009-03-18 : 07:49:16
can anyone help me over this using cursor

susan
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-18 : 07:56:14
sure.. But like I said, You'll need to post more. Post sample data, output, description of what you want. Right now, Its all very vague. That link which Peso provided lists everything you need to post.
Go to Top of Page
   

- Advertisement -