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.
| Author |
Topic |
|
Amber_Deslaurier
Starting Member
40 Posts |
Posted - 2010-06-26 : 20:35:37
|
| Hi,I made a procedure but it has several steps. The 1st one is to check a table and identify if its empty and if so then end the procedure, otherwise continue to the next steps.... what am I missing?Ty,Amber.Syntax Errors:CREATE PROCEDURE STEP_ONE()BEGINIF TABLE_ONE IS NULLTHEN END;ELSE DEL FROM TABLE_TWOCALL PROCESS_FIVE();END IFEND; |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Amber_Deslaurier
Starting Member
40 Posts |
Posted - 2010-06-26 : 21:06:49
|
| thanks i will try it. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-06-28 : 04:57:22
|
quote: Originally posted by vaibhavktiwari83 Use NULL instead of * to fast query performanceIF NOT EXISTS (SELECT NULL FROM TABLE_ONE)RETURNELSE...
Doesn't make a difference. The SQL parser removes all column references from an EXISTS early in query execution.--Gail ShawSQL Server MVP |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-06-28 : 05:58:26
|
| Yes You are right.. it makes difference if we directly execute select statement..I confirmed...Thanks to correct me..Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
Amber_Deslaurier
Starting Member
40 Posts |
Posted - 2010-07-01 : 20:30:46
|
| Thanks! |
 |
|
|
|
|
|