| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
学习型 ASP/PHP/ASP.NET 主机 35元/年全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
赛孚耐:软件保护加密专家身份认证令牌USB KEY  
共有 628 人关注过本帖
标题:关于SQL中DTS包的问题
收藏  订阅  推荐  打印 
shenyuanback
Rank: 1
等级:新手上路
帖子:8
积分:180
注册:2006-4-18
关于SQL中DTS包的问题

小弟请教下,创建SQL的DTS包时候,需要执行的SQL语句能不能带参数? 最好能用存储过程执行的时候传参数,我想向DTS包里传几个必要的不能确定的参数,请问可不可以这样做?该如何做?最好有现成的执行代码!!!!!!!
急啊,各位大虾快帮帮我

[此贴子已经被作者于2006-4-18 10:50:55编辑过]

搜索更多相关主题的帖子: SQL  DTS  参数  能带  
2006-4-18 10:50
LouisXIV
Rank: 12Rank: 12Rank: 12
等级:贵宾
威望:25
帖子:789
积分:7990
注册:2006-1-5

可以,没用过,联机丛书内容如下

Using Parameterized Queries in DTS

Parameterized queries are SQL queries written for reusability. They contain parameter markers as placeholders for data that will change from execution to execution. In the Data Transformation Services (DTS) tasks that use parameterized queries, the placeholder syntax is a question mark. The following is an example of a parameterized query:

INSERT INTO Account (CustomerID, CompanyName) VALUES (?, ?)

The following DTS tasks make use of parameterized queries:

  • Execute SQL task

  • Data Driven Query task

  • Transform Data task

Lookup queries, which you can include in Microsoft® ActiveX® script transformations in a Data Driven Query or Transform Data task, make use of parameters to retrieve information from an additional connection. For more information, see Lookup Queries.

Input Parameters to DTS Tasks

All the tasks above can execute SQL queries written with parameters if the source that the query is running against supports it. You can map variables into the SQL parameters. The Data Driven Query task can bring in data from a text file, global variable, or the source data as input to its parameter set. The Transform Data task can use only global variables as input to source data queries. Lookup queries can use data from a text file, global variable, or other source data fields as input. However, the Execute SQL task can use only global variables as input to its parameterized queries. For more information, see Data Driven Query Task, Transform Data Task, and Lookup Queries.

Output Parameters to DTS Tasks

The Execute SQL task can save the results of a query to a global variable. You can use the task to save the data in several formats. For more information about these formats, see Execute SQL Task.

The Transform Data and Data Driven Query tasks can save query results into a table destination column, or a variable. You can also save data to an array when using a Lookup query.

©1988-2000 Microsoft Corporation. All Rights Reserved.


2006-4-18 13:18
shenyuanback
Rank: 1
等级:新手上路
帖子:8
积分:180
注册:2006-4-18

- -!!!   看似很难,能不能帮忙给个现成的????或者说的在详细点?
2006-4-18 14:57
shenyuanback
Rank: 1
等级:新手上路
帖子:8
积分:180
注册:2006-4-18

而且说明下,偶英文8是很好,有没有中文的?????  或者哪位厉害的大虾帮忙翻译下,小弟先谢谢帮忙的大虾拉
2006-4-18 15:00
LouisXIV
Rank: 12Rank: 12Rank: 12
等级:贵宾
威望:25
帖子:789
积分:7990
注册:2006-1-5

我这里只有英文版的(sql是英文版的),你可以去msdn找找看中文版的

2006-4-18 15:02
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.064017 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved