首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

为什么这段sql语句不能连续执行解决思路

2012-01-29 
为什么这段sql语句不能连续执行--创建Table_Dept表SET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING OFFGOif e

为什么这段sql语句不能连续执行
--创建Table_Dept表
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
if exists (select * from sys.tables where name='#Table_Dept')
drop table #Table_Dept
go
create table #Table_Dept
(
  [Dept_Id] [int] identity(1,1) not null,
  [Dept_Name] [nvarchar](200) not null
)

[解决办法]

SQL code
if object_id('Tempdb..#Table_Dept') is not nulldrop table #Table_Deptgocreate table #Table_Dept(  [Dept_Id] [int] identity(1,1) not null,  [Dept_Name] [nvarchar](200) not null)
[解决办法]
SQL code
--创建Table_Dept表SET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING OFFGOif object_id('#Table_Dept') is not nulldrop table #Table_Deptgocreate table #Table_Deptgo(  [Dept_Id] [int] identity(1,1) not null,  [Dept_Name] [nvarchar](200) not null) 

热点排行
Bad Request.