Re: Want to Know Colunm exist or not
From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 05/12/04
- Next message: Nikhil: "convert rows into columns"
- Previous message: Vishal Parkar: "Re: getting sum of units sold in preceeding weeks"
- In reply to: Ashish Patel: "Want to Know Colunm exist or not"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 May 2004 11:51:10 -0500
Look up the mata-data function COL_LENGTH in SQL Server Books Online. You
can do:
SELECT CASE WHEN COL_LENGTH ( 'tbl' , 'col' ) IS NULL
THEN 'Nope' ELSE 'Exists' END ;
You can also check the results of any of the COLUMNPROPERTY functions to see
if it is a NULL to check if the column exists in a table or not.
-- Anith
- Next message: Nikhil: "convert rows into columns"
- Previous message: Vishal Parkar: "Re: getting sum of units sold in preceeding weeks"
- In reply to: Ashish Patel: "Want to Know Colunm exist or not"
- Messages sorted by: [ date ] [ thread ]