Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««123»»

Use parameters with Execute SQL task Expand / Collapse
Author
Message
Posted Tuesday, October 4, 2005 8:42 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 27, 2012 11:05 AM
Points: 2, Visits: 24
I didn't mean for you to put some much effort into this.  Thank you for all your help.   I can make it work another way if I have to.  I was just trying to make it cleaner.
Post #225873
Posted Tuesday, October 4, 2005 8:45 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: 2 days ago @ 8:25 AM
Points: 769, Visits: 251
No problem. I just had to go back and find some information I had previously researched.

Aunt Kathi
Microsoft
(Former SQL Server MVP)
Post #225876
Posted Wednesday, October 5, 2005 3:44 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, March 14, 2008 4:00 AM
Points: 63, Visits: 3
http://sqljunkies.com/WebLog/knight_reign/archive/2005/10/05/17016.aspx
Post #226421
Posted Wednesday, October 5, 2005 3:48 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: 2 days ago @ 8:25 AM
Points: 769, Visits: 251
Thanks, Kirk.

Aunt Kathi
Microsoft
(Former SQL Server MVP)
Post #226422
Posted Wednesday, October 5, 2005 3:56 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Sunday, November 10, 2013 11:52 AM
Points: 877, Visits: 188

A method which always works regardless of the provider is to build the whole SQL statement dynamically using expressions.

I always use that approach and so far...so good.

-Jamie

 



Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
Post #226425
Posted Wednesday, October 5, 2005 4:03 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, March 14, 2008 4:00 AM
Points: 63, Visits: 3

That's actually a better approach. It's simpler and like Jamie says, always works. It even works for cases where the DAC wouldn't normally allow parameters like for table names and column names etc.

 

Post #226426
Posted Wednesday, October 5, 2005 4:22 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: 2 days ago @ 8:25 AM
Points: 769, Visits: 251
Well, for the chapter example I was working on, using parameters was less messy than a dynamic statement. I also wanted to use an output parameter. Believe me, I tried a bunch of different approaches. I think it all depends on the problem you are trying to solve. 

Aunt Kathi
Microsoft
(Former SQL Server MVP)
Post #226432
Posted Wednesday, October 5, 2005 4:30 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Friday, March 14, 2008 4:00 AM
Points: 63, Visits: 3

Ah, output parameters...

Well, now, that's a different story altogether, isn't it. Eh hem...

K

Post #226436
Posted Wednesday, May 31, 2006 7:06 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, December 30, 2009 9:58 PM
Points: 1, Visits: 14
Sorry to say but the book has a lot of bugs with regards to the output parameters. SSIS seems to be extremely difficult for setting output parameters. I'm running into issues where the data type for a variable and data types for parameter mappings are different and i receive errors about how they are not set properly. Extremely irritating when all I'm trying to do is set a variable to an integer.

select max(id) from table. I'd like to set a variable to that as an output parameter.

THoughts?
Post #284100
Posted Tuesday, February 6, 2007 2:50 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, November 8, 2007 12:55 AM
Points: 22, Visits: 3

Please try to do the following - in parameter mapping replace "?" with "0". I did it like that with OLE DB data source and worked.  

Select ProductID, ProductName
from Production.Product
Where ProductID = ?

The Parameter mapping page looks like this:
User:roductID, Input, Long, 0

 

 

 

Post #342687
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse