`
sjk2013
  • 浏览: 2177246 次
文章分类
社区版块
存档分类
最新评论

DTS参数传递示例

 
阅读更多

DTS参数传递示例

--1.建立测试表

CREATETABLEtempdb.dbo.tb(idint)

--2.新建一个DTS包

在包中建立:
a.MicrosoftOLEDBProviderforSQLServer连接
b.执行SQL任务
任务的“SQL语句“写上:inserttbvalues(?)
单击“参数”按钮,打开“参数映射”对话框
单击“创建全局变量”按钮,创建一个名为value,类型为integer,值为1的全局变量
单击“确定”按钮回到“参数映射”对话框,在“参数映射”列表中,为”参数1“的”输入全局变量“选择”value"
单击“确定”按钮回到"DTS包定义”窗口
c.保存DTS包,包名指定为a,位置指定为"SQLServer"

--3.新建一个包,用以调用包a

在包中建立:
a.执行包任务
在“常规”选项的“包名称”中选择步骤2中建立的包名a
在“外部全局变量”选项中,输入变量名value。(对应步骤2中包的全局变量)
b.保存DTS包,包名指定为b,位置指定为"SQLServer"

--4.执行包,查看结果

EXECmaster.dbo.xp_cmdshell'dtsrun/S/E/N"b"/A"value":3="2"'
EXECmaster.dbo.xp_cmdshell'dtsrun/S/E/N"b"/A"value":3="3"'
EXECmaster.dbo.xp_cmdshell'dtsrun/S/E/N"b"/A"value":3="5"'
EXECmaster.dbo.xp_cmdshell'dtsrun/S/E/N"b"/A"value":3="10"'
SELECT*FROMtempdb.dbo.tb
DROPTABLEtempdb.dbo.tb

CSDN社区帖子地址

分享到:
评论

相关推荐

    Access 2000数据库系统设计(PDF)---001

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---002

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---018

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---003

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---011

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---020

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---009

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---015

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---012

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---027

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---025

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---026

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

    Access 2000数据库系统设计(PDF)---029

    814.6.2 选择显示格式 834.6.3 使用输入掩码 874.7 使用Northwind Traders示例数据库 884.8 向现有的数据库添加一个新表 904.8.1 设计Personnel Actions表 914.8.2 创建Personnel Actions表 934.8.3 在数据表视图中...

Global site tag (gtag.js) - Google Analytics