stored procedure

Results 1 to 2 of 2

Thread: stored procedure

  1. #1
    Join Date
    Dec 1969

    Default stored procedure

    sir as v compare values using asp like<BR>rec("fieldname") = varname<BR>if v want to compare in asp<BR>if the same thing i want to do in stored procedure what statement should i use<BR>what is statement in t-sql for this?<BR>and what is equvivalent statement in t-sql for rec.eof<BR><BR>how to get values those v have got through select statement using t-sql

  2. #2
    Join Date
    Dec 1969

    Default RE: stored procedure

    hope this helps:<BR><BR>You can use a couple of methods:<BR><BR>(1) If you need to have the data from the record, try selecting the data into variables, e.g.:<BR><BR>DECLARE @aID int<BR>Declare @ID int<BR><BR>SELECT @ID = id, @aID = aID<BR>FROM MyTable<BR><BR>If @aID Is Null<BR>BEGIN<BR> -- Do something here<BR>END<BR>ELSE<BR>BEGIN<BR> -- Do something else here<BR>END<BR><BR>(2) If you just need to know whether or not the record exists, then use an Exists check:<BR><BR>If Exist(Select * From MyTable WHERE id = 34)<BR>BEGIN<BR> -- Do something here<BR>END<BR>ELSE<BR>BEGIN<BR> -- Do something else here<BR>END<BR><BR>source:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts