Tuesday, April 29, 2008

Find Colum present in the table or not

Hi,
 
if((select @count=count(*) from sysobjects tab,syscolumns col where col.id=tab.id  and tab.Name=<tablename> and col.name=<columnname>)>0)
begin
              print 'Column present'
end
else
begin
                  print 'Column not present'
end
 
Regards,
Sasikumar D
 
Direct - +91 80 41041751
Mobile - +91 9986080299



iGATE is Ranked No. 3 in DQ-IDC best IT employer survey and Ranked No.6 
by Business Today-Mercer Human Resource Consulting-TNS  in a cross industry survey of Best Companies to work for in India
----------------------------------------------------------------DISCLAIMER---------------------------------------------------------
Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and is intended for use only by the individual 
or entity to whom it is addressed and may contain information that is privileged, confidential, or exempt from disclosure under 
applicable law. If you are not the intended recipient of this EMAIL immediately notify the sender at iGATE or mailadmin@igate.com 
and delete this EMAIL including any attachments

No comments: