Wednesday, March 28, 2012
openquery
arguments'. So, I tried using something like:
Declare @.qry varchar(1000)
Set @.qry = 'select * from OPENQUERY
(<linked_server_name>, ''<query>'')'
exec (@.qry)
Would this work? Thanks.Yes.
--
-oj
RAC v2.2 & QALite!
http://www.rac4sql.net
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:018301c3ad3f$50936e10$a401280a@.phx.gbl...
> BOL says that 'OPENQUERY does not accept variables for its
> arguments'. So, I tried using something like:
> Declare @.qry varchar(1000)
> Set @.qry = 'select * from OPENQUERY
> (<linked_server_name>, ''<query>'')'
> exec (@.qry)
> Would this work? Thanks.|||That is called Dynamic SQL and should work if the final syntax comes out
correct.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:018301c3ad3f$50936e10$a401280a@.phx.gbl...
> BOL says that 'OPENQUERY does not accept variables for its
> arguments'. So, I tried using something like:
> Declare @.qry varchar(1000)
> Set @.qry = 'select * from OPENQUERY
> (<linked_server_name>, ''<query>'')'
> exec (@.qry)
> Would this work? Thanks.
Friday, March 9, 2012
OnVariableValueChanged event
BOL states about the OnVariableValueChanged event that it is fired by an executable, in other words not by the variable itself (http://msdn2.microsoft.com/en-us/library/ms140223.aspx)
This kind of makes sense because all events have to be fired by executables so that they can be caught by eventhandlers scoped to those executables. But it leaves me asking a few questions.
If the event is fired by an executable, is the code that fires the event part of the DTSContainer class?
How does the executable know that a variable has been changed? In other words, if I am building a custom task/component, do I have to explicitly fire the OnVariableValueChanged event if I know that the task/component I am building is going to change a variable?
Or will the SSIS runtime know that the variable has been changed.
If the answer to that last question is "yes", how does the executable know that the variable has been changed?
Is what BOL says leading me astray a little here?
Thanks in advance.
-Jamie
Jamie, the BOL topic is accurate but incomplete. The event is actually fired by the variable, but it is only visible at the container level because that is where events are surfaced. You don't have to do anything other than ensure that the FireVariableValueChanged (can't remember actual name) property is set to true.
Variables tell their container parent that they are changes via internal code paths that aren't visible to the end user. This is part of the implementation of the runtime.
Variable value is changed
Variable tells parent container
Container fires VarValChanged event
Kirk Haselden
Author "SQL Server Integration Services"
|||
Aha. Now that's interesting. So take the following scenario:
MyVariable (that has RaiseChangedEvent=TRUE) is scoped to a sequence container|||
Jamie,
Yes, that's right.
You should stop being lazy and try it.
It should work that way as well. :)
Thanks,
K