Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I have a set of values in a field and want to display an error using IF THEN e.g.SELECT table1.columnFROM table1IF table1.column > 80RAISERROR ('Value is too high. Please ammend', 16, 1)I get the following error :The multi-part identifier could not be bound.
James K
Master Smack Fu Yak Hacker
3873 Posts
Posted - 2013-10-28 : 17:19:13
If you are looking for at least one value in that table that exceeds 80, then do it like this:
IF EXISTS (SELECT * FROM Table1 WHERE column1 > 8) RAISERROR('At least one value is too high, please amend', 16,1)