扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:builder.com.cn 2007年4月25日
关键字: SQL Server
在本页阅读全文(共5页)
use master
Go
IF DB_ID('DatabaseA') IS NOT NULL
DROP DATABASE DatabaseA
GO
IF DB_ID('DatabaseB') IS NOT NULL
DROP DATABASE DatabaseB
GO
CREATE DATABASE DatabaseA
GO
CREATE DATABASE DatabaseB
GO
USE DatabaseA
GO
CREATE TABLE SourceTable
(
IDCol INT IDENTITY(1,1),
Field1 SMALLINT,
Field2 SMALLINT,
Field3 SMALLINT,
Field4 SMALLINT
)
GO
USE DatabaseB
GO
CREATE TABLE SourceTable
(
IDCol INT IDENTITY(1,1),
Field1 SMALLINT,
Field2 SMALLINT,
Field3 SMALLINT,
Field4 SMALLINT
)
GO
USE DatabaseA
GO
INSERT INTO SourceTable
(Field1, Field2, Field3, Field4)
SELECT 1, 1, 1, 2
UNION
SELECT 1, 1, 2, 2
UNION
SELECT 1, 3, 2, 2
UNION
SELECT 1, 3, 2, 2
UNION
SELECT 4, 3, 2, 2
GO
USE DatabaseB
GO
INSERT INTO SourceTable
(Field1, Field2, Field3, Field4)
SELECT 1, 1, 1, 2
UNION
SELECT 1, 3, 2, 1
UNION
SELECT 1, 3, 2, 2
UNION
SELECT 1, 3, 2, 2
UNION
SELECT 5, 3, 2, 2
UNION
SELECT 5, 4, 3, 2
GO
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。