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 |
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2012-12-27 : 06:56:46
|
Is it possible to check the value in all fields any where it is occuring, this table has more than 80 columns.select all_fields from T_SS_BSYRRVP where value=2027171Thanks a lot for the helpful info. |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-12-27 : 07:18:56
|
You can do something like thisselect 'IF EXISTS (SELECT * FROM T_SS_BSYRRVP WHERE [' + COLUMN_NAME + '] = 2027171 ) SELECT ''' + REPLACE('[!]','!',COLUMN_NAME) +'''' +char(10) from information_schema.columns dbs where data_type like '%int%'It will generate the code that you can then run in a query window.JimEveryday I learn something that somebody else already knew |
|
|
|
|
|