How to change custom table types

I already tried to change user defined table types but it doesn't work with alter commend.

alter TYPE [dbo].[GriDDateTab] AS TABLE(
    [Application [varchar](50) NOT NULL,
    [LandDist] [char](2) NULL,
    [Land] [char](3) NULL,
    [LandVi] [char](4) NULL)

      

+3


source to share


3 answers


You need to quit and recreate. This means that if you have any references (like stored procedures) using this type, that reference must be removed first.



+4


source


The bad news is that you need to drop and recreate as the SQL server is down (at least until 2012 does not support this.



The good news is that stored procedures and functions should automatically change table types on the fly without having to drop and recreate.

+1


source


Unfortunately everything said is correct, however you can save some time by going to the table type context menu -> Script User defined table type like ..

If you are using DROP and CREATE To Query Window, you can make your changes and hit execute.

You will still have to recreate references in other programming structures.

0


source







All Articles