| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1143 人关注过本帖
标题:关于SQL中DTS包的问题
只看楼主 加入收藏
shenyuanback
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-4-18
收藏
 问题点数:0 回复次数:4 
关于SQL中DTS包的问题

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

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

搜索更多相关主题的帖子: SQL DTS 参数 能带 
2006-04-18 10:50
LouisXIV
Rank: 6Rank: 6
等 级:贵宾
威 望:25
帖 子:789
专家分:0
注 册:2006-1-5
收藏
得分:0 
可以,没用过,联机丛书内容如下

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-04-18 13:18
shenyuanback
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-4-18
收藏
得分:0 
- -!!!   看似很难,能不能帮忙给个现成的????或者说的在详细点?
2006-04-18 14:57
shenyuanback
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-4-18
收藏
得分:0 
而且说明下,偶英文8是很好,有没有中文的?????  或者哪位厉害的大虾帮忙翻译下,小弟先谢谢帮忙的大虾拉
2006-04-18 15:00
LouisXIV
Rank: 6Rank: 6
等 级:贵宾
威 望:25
帖 子:789
专家分:0
注 册:2006-1-5
收藏
得分:0 
我这里只有英文版的(sql是英文版的),你可以去msdn找找看中文版的

2006-04-18 15:02
快速回复:关于SQL中DTS包的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025243 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved