SqlServer 临时表

SqlServer中临时表分为两种:一种是局部(本地)临时表,用#TableName表示。一种是全局(服务器)临时表,用##TableName表示。

创建临时表:

1. create table #Test
 (
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [CompanyName] [nvarchar](50) NULL,
    [CompanyID] [varchar](30) NULL,
    [CompanyType] [int] NULL,
 )

2.select *  into #Test from Test

删除临时表:

drop table #Test

增删改查与普通表相同

原文地址:https://www.cnblogs.com/yf2011/p/3305969.html