摘要: 方法1: create table mdmuser20120801 as select * from mdmuser 方法2: create table mdmuser20120801 as select * from mdmuser where 1=2; insert into mdmuser20 阅读全文
posted @ 2018-05-25 10:52 zhchsh 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1.INSERT INTO SELECT语句 语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Table1 要求目标表Table2必须存在,由于目标表Table2已经存在,所以我们除了插入源表Tabl 阅读全文
posted @ 2018-05-25 10:49 zhchsh 阅读(435) 评论(0) 推荐(0) 编辑
摘要: --drop procedure zcstest; create procedure zcstest ( @tableName varchar(max), @dataCount int output ) as declare @paramName varchar(max) set @tableName = LTRIM(@tableName) if @tableName ... 阅读全文
posted @ 2018-05-25 10:48 zhchsh 阅读(6109) 评论(0) 推荐(1) 编辑
摘要: -- 方法1:使用表变量 -- 声明表变量 DECLARE @temp TABLE ( empid INT, firstname NVARCHAR(10), lastname NVARCHAR(20) ); -- 将源表中的数据插入到表变量中 INSERT INTO @temp(empid, firstname, lastname ) ... 阅读全文
posted @ 2018-05-25 10:46 zhchsh 阅读(203) 评论(0) 推荐(0) 编辑
摘要: --1. 创建dblink连接 create database link mdm66 connect to lc019999 identified by aaaaaa using '10.24.12.66/orcl'; --mdm66为连接名称,可自己命名,lc019999为访问数据库用户名,aaa 阅读全文
posted @ 2018-05-25 10:37 zhchsh 阅读(274) 评论(0) 推荐(0) 编辑