Hello, I have the following problem and I can not solve it.
C DbCommandI'm trying to execute this SQL statement
Dim strCommnad As String =
"CREATE DEFAULT [dbo].[DOMAIN_XLibPKID_D] AS (0);" + Environment.NewLine +
"CREATE TYPE [dbo].[XLibPKID] FROM BIGINT NOT NULL;" + Environment.NewLine +
"EXEC sp_bindefault 'DOMAIN_XLibPKID_D', 'XLibPKID';"
command.CommandText = strCommnad
command.CommandType = CommandType.Text
command.ExecuteNonQuery()
but I always get this error message
Incorrect syntax next to the keyword 'CREATE'.
But when I run each command from strCommandautonomously, then everything works fine.
I am using VS 2010 Professional and SQL Server 2008 R2 Express.
Thanks for any help.
source
share