Hello all,
Once again I seek the advice of the genius collective from Tek-Tips.
The requirement I have is to test a number of stored procedures and views against tables that contain little to no data. In order to sanity check the results (and make sure my mappings are all correct) it would be good to have all fields that are currently null, populated with the column name.
So where I would current have something like this:
First Name, Last Name, Gender...
John, NULL, NULL
I would instead have:
First Name, Last Name, Gender...
John, Last Name, Gender
I would like to be able to do this for any number of tables so a function that looped through any given table and carried out this sort of logic would be ideal. I have a number of tables with a lot of columns I need to perform this on.
The environment is MS SQL Server 2008.
Thanks in advance,
Slobad23
Once again I seek the advice of the genius collective from Tek-Tips.
The requirement I have is to test a number of stored procedures and views against tables that contain little to no data. In order to sanity check the results (and make sure my mappings are all correct) it would be good to have all fields that are currently null, populated with the column name.
So where I would current have something like this:
First Name, Last Name, Gender...
John, NULL, NULL
I would instead have:
First Name, Last Name, Gender...
John, Last Name, Gender
I would like to be able to do this for any number of tables so a function that looped through any given table and carried out this sort of logic would be ideal. I have a number of tables with a lot of columns I need to perform this on.
The environment is MS SQL Server 2008.
Thanks in advance,
Slobad23