init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
DROP PROCEDURE IF EXISTS dev.uspDropDefaultConstraint
|
||||
GO
|
||||
|
||||
CREATE PROCEDURE dev.uspDropDefaultConstraint
|
||||
@pTableName nvarchar(80)
|
||||
,@pColumnName nvarchar(80)
|
||||
AS
|
||||
BEGIN
|
||||
DECLARE @sql nvarchar(max)
|
||||
|
||||
SELECT
|
||||
@sql = 'ALTER TABLE ' + @pTableName + ' DROP CONSTRAINT ' + df.name
|
||||
FROM sys.default_constraints df
|
||||
INNER JOIN sys.columns cn ON cn.default_object_id = df.object_id
|
||||
INNER JOIN sys.tables tb ON tb.object_id = cn.object_id
|
||||
WHERE cn.name = @pColumnName
|
||||
AND tb.name = @pTableName
|
||||
|
||||
EXEC sp_executesql @sql
|
||||
END
|
||||
GO
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue