Tuesday, January 31, 2012

How to check if column existed by a simple way in MS SQL?

                  IF COL_LENGTH('TableName','ColumnName') IS NULL

                  BEGIN

                        exec sp_executesql @SQLStatement

                  END

No comments:

Post a Comment