Search
 
SCRIPT & CODE EXAMPLE
 

SQL

dropping a constraint in ms sql

/*Dropping a Constraint*/
ALTER TABLE (Table_Name)
DROP CONSTRAINT (Constraint_Name)
Comment

drop constraint in ms sql

DECLARE @sql NVARCHAR(MAX)
WHILE 1=1
BEGIN
    SELECT TOP 1 @sql = N'alter table tbloffers drop constraint ['+dc.NAME+N']'
    from sys.default_constraints dc
    JOIN sys.columns c
        ON c.default_object_id = dc.object_id
    WHERE 
        dc.parent_object_id = OBJECT_ID('tbloffers')
    AND c.name = N'checkin'
    IF @@ROWCOUNT = 0 BREAK
    EXEC (@sql)
END
Comment

PREVIOUS NEXT
Code Example
Sql :: what is 1=2 in sql 
Sql :: not in in mongodb 
Sql :: sql online compiler 
Sql :: while mysql 
Sql :: mysql curdate between two dates 
Sql :: mysql --version 
Sql :: insert set mysql 
Sql :: aggregate functions 
Sql :: how to compare two columns in sql server 
Sql :: adding column 
Sql :: on update cascade 
Sql :: test connection to sql server 
Sql :: triggers db 
Sql :: how do you insert boolean to postgresql 
Sql :: sql server in python 
Sql :: insert into 
Sql :: 18446744073709551615 mariadb left join order by 
Sql :: setup mysql and wordpress on docker mac 
Sql :: how to count codition 
Sql :: hallo 
Sql :: mysql config address 
Sql :: convert linq to sql query online 
Sql :: datetrunc hour snowflake 
Sql :: t-sql update table variale 
Sql :: SQL Views for Complex Queries 
Sql :: connect colab with Microsoft sql server 
Sql :: database restoring error 
Sql :: oracle apex run 404 
Sql :: VHDL Example Code of Record Type 
Sql :: sql count return 0 if no rows 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =