From: sChapman on 17 Jun 2010 05:42 I have a table that can contain emtpy rows. Row is considered empty when all the columns (except the primary) are NULLs. Is there a function in Sql Server to test if a row is empty?
From: Uri Dimant on 17 Jun 2010 09:03 Perhaps CASE Expression SELECT CASE WHEN col IS NULL THEN 'empty' END col ......... FROM tbl "sChapman" <sumanthcp(a)googlemail.com> wrote in message news:86f1cc36-53d5-40cf-a606-565c3540d037(a)a30g2000yqn.googlegroups.com... >I have a table that can contain emtpy rows. Row is considered empty > when all the columns (except the primary) are NULLs. Is there a > function in Sql Server to test if a row is empty?
From: --CELKO-- on 17 Jun 2010 13:02 >> Is there a function in SQL Server to test if a row is empty? << No, you have to test column by column. However, such a table is usually a sign of really bad design. It is almost always better to have DEFAULT clauses and to use the little-known "INSERT INTO.. DEFAULT VALUES;" when appropriate.
|
Pages: 1 Prev: Create view to get data from multiple databases Next: Converting money type into varchar |