sql server 2008 - SQL - Empty or Null fields -
I am trying to check for zero values or empty columns I
My From the place where my column is tap or myColumn = ''; The thing is, I want to include some table (myTable1, myTable2, myTable3) in the same question and to avoid the need to specify a column name (myColumn) So that the query is normal, return empty or zero column names in some tables.
Thanks in advance.
December @col VARCHAR (255), @ table VARAR (255), @ CMD VAAR (Max) Declar Plus Cooor is selected by TN Nom, c.name by sys.tables t Joyyn Sis. Column C on T object_ID = c. Object_ID WHERE t.Name IN ('Table-1', 'Table-2') --WHERE t.Name IN (Provide your table list) Openinfo FETCH on the next meeting @ gettable, @col WHILE @@ FETCH_STATUS = 0 Start @ cmd = 'if EXISTS (SELECT top 1 * FROM' + @table + 'WHERE (' + + col + 'IS tap or' + @col + '=' '' ')) BEGIN print' 'tabname = '' '+'table +' '' + '' column name = '' + + '+0 +' '' end '- PRINT @ CMD ECC (@ CMD) FETCH Next @ gettable, @ Col getinfo DEALLOCATE getinfo
Comments
Post a Comment