Simple question I know but I'm reasonably new to C# and used to use ASP 3 and manually setup SQL Server via Enterprise manager.
I am building a new super admin interface using C# and am creating reusable 'modules' (news, comments, traders etc) that I wish to be able to auto install via clicking checkboxes.
So, I have a standard user in SQL Server (lets say it's called "DBUser") and I wish to use a script to generate tables depending on the super admin's administration needs and choices.
So how would I script the following SQL Query in C# to be owned by "DBUser"?
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[dnc_news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[dnc_news]
CREATE TABLE [dbo].[dnc_news] (
[news_id] [int] IDENTITY (1, 1) NOT NULL ,
[news_title] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[news_intro] [varchar] (400) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[news_article] [varchar] (4000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[news_image] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[news_date] [datetime] NOT NULL ,
[down_filename] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[down_size] [int] NULL ,
[down_type] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]