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 |
NguyenL71
Posting Yak Master
228 Posts |
Posted - 2010-07-15 : 16:17:04
|
Hi all,I am looking for the script which return column name either has NULL or 1900-01-01.Ex: Insertdt and Typecd should be return. I need to be able to find all the tables.SQL 2008.Any help would greatly appreciate.IF OBJECT_ID('TestTable', 'u') IS NOT NULL DROP TABLE TestTable GOCREATE TABLE TestTable ( LCPI INT NULL, Insertdt DATETIME NULL, TypeCd CHAR(5) NULL)GOINSERT INTO TestTable VALUES(123079,NULL, NULL)INSERT INTO TestTable VALUES(123098,'1900-01-01', NULL)GO SELECT * FROM TestTable; GO -- Desired results: TableName ColName --------- ------- TestTable Insertdt TestTable TypeCd |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|