I am using C# to add extended properties to the tables in my database. When I use a SQL editor, this code works, as each statement is on a new line. However, when creating the command as a string in C#, I get 'Incorrect syntax near GO' twice in the same error message. How can I write this out so that c# executes it on seperate lines or in the correct syntax?
USE UserList;
GO EXEC sys.sp_addextendedproperty
@name = N'Description',
@value=N'some text',
@level0type=N'SCHEMA', @level0name=N'dbo',
@level1type=N'TABLE',
@level1name=N'table_name'
GO