Geeks With Blogs
Baskar B.V SQL - BI Consultant

Figured out a solution today while doing my DTS code. I was fighting various ways to get this out but a simple code will do that. 

When you have an scenerio in DTS where you need to pass in SQL variables like @@rowcount, @@error to your global variables you typically do select @@rowcount, @@error in your execute sql task and map that to your global variables. This will not return you the values as intended. To get the values returned to your global variables you might have to set SET NOCOUNT ON as the first statement in your SQL query in sql task.

Posted on Thursday, September 13, 2007 1:18 PM | Back to top


Comments on this post: Tip on DTS Execute Sql Task

# re: Tip on DTS Execute Sql Task
Requesting Gravatar...
i need tips badly
Left by reetu on May 29, 2008 1:47 AM

# re: Tip on DTS Execute Sql Task
Requesting Gravatar...
Is it a common myth???
http://blog.sqlauthority.com/2011/12/02/sql-server-effect-of-set-no-count-on-rowcount/
Left by Nidhin on Jun 15, 2012 10:11 AM

Your comment:
 (will show your gravatar)


Copyright © Baskar B.V | Powered by: GeeksWithBlogs.net