Assume that you wish to check for rows in a table where all values are NULL. There are many columns in the table and you want to avoid hand coding them. Instead, you can create a script to do the work for you:
Select column_name + ' IS NULL AND'
FROM INFORMATION_SCHEMA.columns
where table_name = 'whatever'
Enjoy! this query is very useful ;)
2009/08/04
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment