Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quickest way to see if a record exists
Message
 
 
To
17/09/2008 05:53:43
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 6.5 and older
Miscellaneous
Thread ID:
01348134
Message ID:
01348186
Views:
25
>hi
>what is the best/ quickest way to check if a record exists in a table? thats all I want to know, ie "select from mytable where myid =lcid " and myId is not a primary key
>thanks
>stuart

IF EXISTS (select 1 from myTable where myID = @PassedID)
-- Record Exists
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform