How to generate a column drop and create a script in sql server management studio

Can someone tell me a way to generate drop and create a column script from sql server management studio? I used the change script parameter, but just generated a create script, not a drop script for the column.

Also, I could not find a way to add a default default constraint or any other specific name constraint from the table view. It just adds a default constraint with a dynamically generated name if I specify a default value.

Thanks in advance :)

+3
source share
1 answer

SSMS, , , Generate Change Script , script:

ALTER TABLE dbo.Messages ADD
    IsActive bit NOT NULL CONSTRAINT DF_Messages_IsActive DEFAULT 1
GO

ALTER TABLE dbo.Messages
    DROP COLUMN ToProfileId
GO

SQL Server 2008 R2 - , - . : script!

, - , - ?

, , T-SQL script, , .

+3

All Articles