roaddog Posted February 7, 2015 Posted February 7, 2015 (edited) I have found this ALTER TABLE function lately, so I want to know how to check whether the column exists by using some kind of IF NOT EXISTS statement? Any idea how to do so? Edited February 8, 2015 by Guest You gone learn today. I work my ass off, but I still can't pay tho.
roaddog Posted February 8, 2015 Author Posted February 8, 2015 Anyone please? You gone learn today. I work my ass off, but I still can't pay tho.
Tomas Posted February 8, 2015 Posted February 8, 2015 IF COL_LENGTH('table_name', 'column_name') IS NULL BEGIN ALTER TABLE table_name ADD [column_name] INT END Example taken from: http://stackoverflow.com/questions/8870 ... eady-exist Currently developing for International Gaming Community - Join us!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now