I'm new to SSIS and I'm trying to load a variable from a table. Can anyone tell me how to dot that? I want to SELECT TOP 1 VAL FROM TBL WHERE CONDITION = SOMETHING and Store that into a Variable SystemVar1 Then use that variable in another query later on. Do I need to use a script? If so can you guide me to some documentation that will give me a good example, I have not done any scripting in SSIS yet. Thanks, Tim
SELECT TOP 1 @systemvar1=VAL FROM TBL WHERE CONDITION = SOMETHING Now you can use @systemvar1 it later in the code
<P mce_keep="true">Should this be placed inside an OLE DB Source ?</P><P mce_keep="true">That's where I'm trying to put it and I'm getting a parsing error.</P><P mce_keep="true"><IMG title="My Settings" style="WIDTH: 720px; HEIGHT: 636px" height=636 alt="My Settings" src="http://i97.photobucket.com/albums/l213/tthomasol/SSIS.gif" width=720 mce_src="http://i97.photobucket.com/albums/l213/tthomasol/SSIS.gif"></P><P mce_keep="true"> </P>
Hi What you can do is create one more variable which will create your SQL statement dynamically using your system variable After that use this new veriable as you SQL Command for ola DB Source.Change your Data Access mode to Sql Command From Veriable Thank You
Thanks for the response, I'm not sure I follow you. My question is, how do I assign a value to a variable using the contents from a table that I have queried. From my understanding of your solution I still have to assign a value to a variable from a table, and that is what I don't know how to do. I want that variable to be used anywhere else in the package that I need it. I'm sorry if I don't understand your response, I am very new to SSIS and this seems like it should be a very elementary thing but I can't seem to find an easy answer. I think the Madhivanan's answer above is what I'm looking for but I don't know where I'm supposed to put the statement.
Hi Hope this link will explain how to create veriable dynamically http://www.mssqltips.com/tip.asp?tip=1443