Home Forums SQL Server 2008 T-SQL (SS2K8) How to update multiple column definition in single update statement RE: How to update multiple column definition in single update statement

  • I need to alter definition of two columns in a table and its being done like this :

    ALTER TABLE dbo.JURISDICTION_FIELD

    ALTER COLUMN FIELD_CODE NVARCHAR(60) NOT NULL;

    ALTER TABLE dbo.JURISDICTION_FIELD

    ALTER COLUMN [DESCRIPTION] NVARCHAR(2000) NULL;

    If I need to update 20 columns in a table, there will need to be 20 ALTER TABLE statements. Is there a way to update all 20 columns using a single ALTER TABLE statement?

    Please let me know if you need more clarifications.

    Thank You.