存储过程 创建全局临时表
来源:互联网 发布:樱井知香迅雷种子磁力 编辑:程序博客网 时间:2024/04/29 23:44
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CreateTempTableForPostIdWithIdentity
-- Add the parameters for the stored procedure here
@StartWith int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--Create Temp Table
IF Object_id('Tempdb..##PostIdWithIdentity') IS NOT NULL
DROP TABLE ##PostIdWithIdentity
CREATE TABLE ##PostIdWithIdentity
(
ID int IDENTITY (1,1) not null,
PostId nvarchar(255),
Tags nvarchar(MAX),
primary key (ID)
)
truncate table ##PostIdWithIdentity
insert into ##PostIdWithIdentity(PostId,Tags) select Id,Tags from [InstagramData].[dbo].[Post]
Select Top(10)* from ##PostIdWithIdentity
-- Insert statements for procedure here
--SELECT row_number() over (order by Id asc) as id,Id as PostId,Tags From [InstagramData].[dbo].[Post]
END
GO
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE CreateTempTableForPostIdWithIdentity
-- Add the parameters for the stored procedure here
@StartWith int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--Create Temp Table
IF Object_id('Tempdb..##PostIdWithIdentity') IS NOT NULL
DROP TABLE ##PostIdWithIdentity
CREATE TABLE ##PostIdWithIdentity
(
ID int IDENTITY (1,1) not null,
PostId nvarchar(255),
Tags nvarchar(MAX),
primary key (ID)
)
truncate table ##PostIdWithIdentity
insert into ##PostIdWithIdentity(PostId,Tags) select Id,Tags from [InstagramData].[dbo].[Post]
Select Top(10)* from ##PostIdWithIdentity
-- Insert statements for procedure here
--SELECT row_number() over (order by Id asc) as id,Id as PostId,Tags From [InstagramData].[dbo].[Post]
END
GO
0 0
- 存储过程 创建全局临时表
- 临时存储过程和全局的存储过程的创建
- 创建全局临时表
- 摘录:sql,临时表,创建,存储过程
- 在存储过程中创建临时表
- 存储过程创建临时表和返回临时表
- 在ORACLE存储过程中创建临时表
- 在ORACLE存储过程中创建临时表
- 在ORACLE存储过程中创建临时表
- 在存储过程中创建一临时表
- 在ORACLE存储过程中创建临时表
- 在oracle存储过程中创建临时表
- 在ORACLE存储过程中创建临时表
- 存储过程中创建临时表,为何没有权限?
- MySQL 创建临时时间表 存储过程
- 临时表的存储过程
- 不创建表结构,直接放入临时表结果(包括存储过程,直接sql语句)
- 存储过程,查询的表本身主键,创建带有主键的临时表;
- 端口转发工具
- Myeclipse java 项目转换为 web 项目
- InDesign插件开发中的ODFRC
- Android —— Display
- socket编程——sockaddr_in结构体操作
- 存储过程 创建全局临时表
- meta中的viewport指令
- 网络协议消息分片
- vs2005编译pjsip
- (Memory and Resource) Leak detection for WinCE
- soj2093: Farmer John
- GUI 创建个Frame,往里面插入Panel,Panel的大小随Frame大小调整 setLayout setBounds
- Linux下.sh文件语法
- 各种远程通信协议分析、比较