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 |
desikankannan
Posting Yak Master
152 Posts |
Posted - 2013-11-12 : 10:28:49
|
HI,I TRY TO CHECK MULTIPLE COLUMN CHECK IN TABLE, BUT ITS NOT WORKINGPROPERLY PLS GUIDE MEIF EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'deathdata' AND COLUMN_NAME IN( 'donationstitle','donationsto','donaddress','doncity','donstate','donzip')) BEGINDesikankannan |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-11-12 : 10:39:48
|
please take your caps lock off and explain what you are trying to do and what is not working. Are you getting an error message? If so post it. Assuming you have an END with content within the begin/end then I don't see a problem with your code. You just need to know that if any of those columns exists the EXISTS will return true. It will only return false when none of those columns exist.Be One with the OptimizerTG |
|
|
desikankannan
Posting Yak Master
152 Posts |
Posted - 2013-11-12 : 11:37:14
|
HII GOT THE ANSWERMY SQL QUERY IS WRONGquote: Originally posted by TG please take your caps lock off and explain what you are trying to do and what is not working. Are you getting an error message? If so post it. Assuming you have an END with content within the begin/end then I don't see a problem with your code. You just need to know that if any of those columns exists the EXISTS will return true. It will only return false when none of those columns exist.Be One with the OptimizerTG
Desikankannan |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-12 : 12:53:08
|
quote: Originally posted by desikankannan HII GOT THE ANSWERMY SQL QUERY IS WRONGquote: Originally posted by TG please take your caps lock off and explain what you are trying to do and what is not working. Are you getting an error message? If so post it. Assuming you have an END with content within the begin/end then I don't see a problem with your code. You just need to know that if any of those columns exists the EXISTS will return true. It will only return false when none of those columns exist.Be One with the OptimizerTG
Desikankannan
Are you aware that using caps means shouting?Please refrain from using caps in future.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|