Oct 15, 2007 #1 nodoubtom Programmer Oct 15, 2007 8 US How do I check for the existence of a column in a table for SQL Server 2005. Thanks!
Oct 15, 2007 #2 ptheriault IS-IT--Management Aug 28, 2006 2,699 US select * from information_schema.columns where column_name = 'what ever' and table_name = 'yourTable' - Paul - If at first you don't succeed, find out if the loser gets anything. Upvote 0 Downvote
select * from information_schema.columns where column_name = 'what ever' and table_name = 'yourTable' - Paul - If at first you don't succeed, find out if the loser gets anything.
Oct 15, 2007 Thread starter #3 nodoubtom Programmer Oct 15, 2007 8 US Thanks for your quick response. When I run this without the WHERE it's not pulling back all columns that I know are in the table. Why would this be? Thanks! Upvote 0 Downvote
Thanks for your quick response. When I run this without the WHERE it's not pulling back all columns that I know are in the table. Why would this be? Thanks!
Oct 15, 2007 Thread starter #4 nodoubtom Programmer Oct 15, 2007 8 US Sorry. I was in the wrong DB. That's why it wasn't finding it! Thanks for your help!!! Upvote 0 Downvote