How can I get a value from a variable in one trigger to populate a variable
in another trigger.Hi
Persist it to a table (not Temporary).
No global variables in SQL Server.
Regards
Mike
"seeker53" wrote:
> How can I get a value from a variable in one trigger to populate a variable
> in another trigger.|||You can't. Also, variables aren't very much use in a trigger. Don't assign
column values to variables in a trigger because that compels you to use
cursor processing to handle multiple row updates - or to disallow multi-row
updates altogether. Neither option is a good idea.
--
David Portas
SQL Server MVP
--
Showing posts with label variable. Show all posts
Showing posts with label variable. Show all posts
Monday, March 19, 2012
how can I
How can I get a value from a variable in one trigger to populate a variable
in another trigger.
Hi
Persist it to a table (not Temporary).
No global variables in SQL Server.
Regards
Mike
"seeker53" wrote:
> How can I get a value from a variable in one trigger to populate a variable
> in another trigger.
|||You can't. Also, variables aren't very much use in a trigger. Don't assign
column values to variables in a trigger because that compels you to use
cursor processing to handle multiple row updates - or to disallow multi-row
updates altogether. Neither option is a good idea.
David Portas
SQL Server MVP
in another trigger.
Hi
Persist it to a table (not Temporary).
No global variables in SQL Server.
Regards
Mike
"seeker53" wrote:
> How can I get a value from a variable in one trigger to populate a variable
> in another trigger.
|||You can't. Also, variables aren't very much use in a trigger. Don't assign
column values to variables in a trigger because that compels you to use
cursor processing to handle multiple row updates - or to disallow multi-row
updates altogether. Neither option is a good idea.
David Portas
SQL Server MVP
how can I
How can I get a value from a variable in one trigger to populate a variable
in another trigger.Hi
Persist it to a table (not Temporary).
No global variables in SQL Server.
Regards
Mike
"seeker53" wrote:
> How can I get a value from a variable in one trigger to populate a variabl
e
> in another trigger.|||You can't. Also, variables aren't very much use in a trigger. Don't assign
column values to variables in a trigger because that compels you to use
cursor processing to handle multiple row updates - or to disallow multi-row
updates altogether. Neither option is a good idea.
David Portas
SQL Server MVP
--
in another trigger.Hi
Persist it to a table (not Temporary).
No global variables in SQL Server.
Regards
Mike
"seeker53" wrote:
> How can I get a value from a variable in one trigger to populate a variabl
e
> in another trigger.|||You can't. Also, variables aren't very much use in a trigger. Don't assign
column values to variables in a trigger because that compels you to use
cursor processing to handle multiple row updates - or to disallow multi-row
updates altogether. Neither option is a good idea.
David Portas
SQL Server MVP
--
How can a variable used in SQL select command
select * from TABLE where user='jacky' ,it can working,but if like this:
dim name as string="jacky"
select * from TABLE where user=name
it won't doing,Can a variable used in SQL select command,if can,how to make it working.You can, but you are missing some basic insights here ...
dim name as string="jacky"
select * from TABLE where user=name
it won't doing,Can a variable used in SQL select command,if can,how to make it working.You can, but you are missing some basic insights here ...
You can do this like this:
string sql = "Select * from TABLE where user = '" + name + "'"
OR use a stringbuilder of so ...
If you are using SQL Server or any decent DBMS, try using stored procedures instead|||Thank you very much!
Wednesday, March 7, 2012
How ? Global variable as SQL Connection in DTS
Can I define a Global variable and use it as a Connection to SQL Server .
What I want to do is Create a DTS which pumps out files to an app server. However this might be done in different environments and I want to keep the SQL Connection Dynamic and change it in global parameter value.
Please help ,,,
ThanksI would write a sproc with bcp...and keep the configurations in a table...
Does it have to be DTS?
What I want to do is Create a DTS which pumps out files to an app server. However this might be done in different environments and I want to keep the SQL Connection Dynamic and change it in global parameter value.
Please help ,,,
ThanksI would write a sproc with bcp...and keep the configurations in a table...
Does it have to be DTS?
Subscribe to:
Posts (Atom)