Re: Check if a table has a specific column

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Andrew J. Kelly (sqlmvpnooospam_at_shadhawk.com)
Date: 10/10/04


Date: Sun, 10 Oct 2004 15:05:53 -0400

Taka a look at the Information schema views in BooksOnLine.

-- 
Andrew J. Kelly  SQL MVP
"Agoston Bejo" <gusz1@freemail.hu> wrote in message 
news:eVL1vavrEHA.376@TK2MSFTNGP14.phx.gbl...
> What I'm trying to do is check if a table has a column called 'X' and if 
> it
> hasn't then add it to the table.
> How can I check (from a stored procedure) whether a column is in the 
> table?
>
> 


Relevant Pages

  • Re: How do I format data in the SQL statement
    ... Andrew J. Kelly SQL MVP ... "Jim Warren" wrote in message ... >> BooksOnLine for more details. ... >> Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Change Column name with ALTER statement
    ... Check out sp_rename in BooksOnLine ... Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Server Roles Process administrators
    ... BooksOnLine is probably the best reference. ... Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.security)
  • Re: Weeks
    ... Check out DATEDIFF in BooksOnLine. ... Andrew J. Kelly SQL MVP "David" wrote in message ...
    (microsoft.public.sqlserver.server)
  • Negative results
    ... Andrew J. Kelly wrote: ... Sorry thanks for pointing that out Kevin. ... Andrew J. Kelly SQL MVP ... Your best option to begin with is to look at the virtual file stats to seehow ...
    (microsoft.public.sqlserver.server)