|
-
Sep 16th, 2004, 05:02 AM
#1
Thread Starter
Fanatic Member
Exists in SQL Server procedure
I need to create a procedure which checks to see if a record exists in sql server and if it does, return some parameter so I can do further processing in VB.net.
Can anyone point me in the right direction ?
-
Sep 16th, 2004, 08:46 AM
#2
Frenzied Member
I use count if the count is 0 is doesn't exist if it's 1 it does
Magiaus
If I helped give me some points.
-
Sep 17th, 2004, 12:03 AM
#3
Crossposter!
Wasn't my answer good enough?
-
Sep 17th, 2004, 12:51 PM
#4
Banned
Re: Exists in SQL Server procedure
look it up in BOL
IF Exists(SELECT * FROM blah WHERE blah blah)
--do something if true you can use SELECT 1 as well
else
--do something else like an insert
INSERT INTO
blah (
col1,
col2
)
SELECT GetDate(), UDFFunc()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|