Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql check if column exists

IF COL_LENGTH('<table_name>', '<column_name>') IS NULL
BEGIN
	--column doesnot exists, so, add column here
	ALTER TABLE <table_name> ADD <column_name> BIT NOT NULL DEFAULT(0)
END
 
PREVIOUS NEXT
Tagged: #sql #check #column #exists
ADD COMMENT
Topic
Name
3+7 =