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

Script Component and Querying Database Expand / Collapse
Author
Message
Posted Sunday, January 13, 2013 3:40 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 20, 2013 6:59 PM
Points: 24, Visits: 157
I need help understand how to use the Script Component to create a connection to the database, submit a SQL, retrieve the results. Are there any good tutorials?

I would like to use the script component basically as a lookup to incoming rows. I have to perform numerous lookup and thought this approach of using script components would allow me to do this. Also, it would allow me to perform additional steps, where I need to built up a field as a result of the lookups.

Any help would be appreciated.
Post #1406522
Posted Tuesday, January 15, 2013 2:16 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,378, Visits: 6,473
You can use SQLCommand or other relevant classes.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1407098
Posted Tuesday, January 15, 2013 3:42 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 9:39 AM
Points: 4,247, Visits: 9,500
Koen Verbeeck (1/15/2013)
You can use SQLCommand or other relevant classes.


You missed the obvious question: why use a script component to do lookups when there is already a dedicated lookup component?


____________________________________________________________________________________________

Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:

http://www.sqlservercentral.com/articles/Best+Practices/61537/

If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
Post #1407139
Posted Tuesday, January 15, 2013 3:46 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 2:11 AM
Points: 9,378, Visits: 6,473
Phil Parkin (1/15/2013)


You missed the obvious question: why use a script component to do lookups when there is already a dedicated lookup component?


To quote the OP:

to perform additional steps, where I need to built up a field as a result of the lookups.


But you're right, if a traditional lookup can be used, by all means, please do so.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1407140
Posted Tuesday, January 15, 2013 3:50 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 9:39 AM
Points: 4,247, Visits: 9,500
Koen Verbeeck (1/15/2013)
Phil Parkin (1/15/2013)


You missed the obvious question: why use a script component to do lookups when there is already a dedicated lookup component?


To quote the OP:

to perform additional steps, where I need to built up a field as a result of the lookups.


But you're right, if a traditional lookup can be used, by all means, please do so.


Fair enough. I think we need to understand the problem/requirement better before knowing whether it's possible using lookups (and maybe derived columns) or not ...


____________________________________________________________________________________________

Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:

http://www.sqlservercentral.com/articles/Best+Practices/61537/

If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
Post #1407142
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse