如何执行SQL生成的语句
以下是用SQL直接生成的语句:如何用C#执行???USE [master]
GO
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'mobile')
BEGIN
CREATE DATABASE [mobile] ON PRIMARY
( NAME = N'mobile', FILENAME = N'E:\VS2005(C#)PC短信群发软件源代码\c_sms\SMS\SMS\DataBase\mobile.mdf' , SIZE = 6144KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'mobile_log', FILENAME = N'E:\VS2005(C#)PC短信群发软件源代码\c_sms\SMS\SMS\DataBase\mobile_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
END
GO
EXEC dbo.sp_dbcmptlevel @dbname=N'mobile', @new_cmptlevel=90
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [mobile].[dbo].[sp_fulltext_database] @action = 'disable'
end
GO
ALTER DATABASE [mobile] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [mobile] SET ANSI_NULLS OFF
GO
ALTER DATABASE [mobile] SET ANSI_PADDING OFF
GO
ALTER DATABASE [mobile] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [mobile] SET ARITHABORT OFF
GO
ALTER DATABASE [mobile] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [mobile] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [mobile] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [mobile] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [mobile] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [mobile] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [mobile] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [mobile] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [mobile] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [mobile] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [mobile] SET ENABLE_BROKER
GO
ALTER DATABASE [mobile] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [mobile] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [mobile] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [mobile] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [mobile] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [mobile] SET READ_WRITE
GO
ALTER DATABASE [mobile] SET RECOVERY FULL
GO
ALTER DATABASE [mobile] SET MULTI_USER
GO
ALTER DATABASE [mobile] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [mobile] SET DB_CHAINING OFF
USE [mobile]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_telsend]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tb_telsend](
[id] [int] IDENTITY(1,1) NOT NULL,
[telnum] [varchar](50) NULL,
[telcontent] [varchar](max) NULL,
[teltime] [varchar](50) NULL,
CONSTRAINT [PK_tb_telsend] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_tel]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tb_tel](
[id] [int] IDENTITY(1,1) NOT NULL,
[username] [varchar](50) NULL,
[usersex] [varchar](10) NULL,
[usertel] [varchar](50) NULL,
CONSTRAINT [PK_tb_tel] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[worker]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[worker](
[id] [int] IDENTITY(1,1) NOT NULL,
[jh] [varchar](50) NULL,
[shfzh] [varchar](50) NULL,
[danwei] [varchar](50) NULL,
[xm] [varchar](50) NULL,
[sex] [varchar](2) NULL,
[address] [varchar](200) NULL,
[phone] [varchar](50) NULL,
[dnt] [datetime] NULL,
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[times]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[times](
[id] [int] IDENTITY(1,1) NOT NULL,
[lx] [varchar](50) NULL,
[days] [varchar](50) NULL,
[times] [varchar](50) NULL,
CONSTRAINT [PK_times] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_admin]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tb_admin](
[id] [int] IDENTITY(1,1) NOT NULL,
[adminusername] [varchar](50) NULL,
[adminuserpwd] [varchar](50) NULL,
[power] [nchar](1) NULL,
CONSTRAINT [PK_tb_admin] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_note]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tb_note](
[id] [int] IDENTITY(1,1) NOT NULL,
[type] [varchar](50) NULL,
[note] [varchar](max) NULL,
CONSTRAINT [PK_tb_note] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_resvice]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[tb_resvice](
[id] [int] IDENTITY(1,1) NOT NULL,
[smsnum] [varchar](50) NULL,
[smscontent] [varchar](max) NULL,
CONSTRAINT [PK_tb_resvice] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END