>I am having trouble assigning a default value to a user defined data type in code.
>I can create the default object using
>CREATE DEFAULT DEFAULTZERO as 0
>and I can create the datatype using
>CREATE TYPE Logical FROM bit NOT NULL
>but I can't seem to get the right binding syntax for assigning DefaultZero as the default object for Logical.
>I can do it manually through SQL Studio
>TIA
>Trevor
Here the script SSMS generated:
USE [Test]
GO
CREATE TYPE [dbo].[Logical] FROM [bit] NOT NULL
GO
EXEC sys.sp_bindefault @defname=N'[dbo].[DefaultZero]', @objname=N'[dbo].[Logical]' , @futureonly='futureonly'
GO
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.