tHi
I want to build a trigger to modify data in a table in a database that is
running on another Database Engine in may LAN. I don' t know if that is
possible. If it is, how will I make the connection to that database?
Thanks in advance - WaldoYou would have to set up the other instance as a "linked server". But what you want to do requires a
distributed transaction (with DTC running and all that jazz) so I would re-think the approach if
possible.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
> tHi
> I want to build a trigger to modify data in a table in a database that is
> running on another Database Engine in may LAN. I don' t know if that is
> possible. If it is, how will I make the connection to that database?
> Thanks in advance - Waldo|||I concur. Consider some form of asynchronous mechanism where by you put the
requisite information in a queing table and pull from the other db engine to
do the updates.
You can get DTC to do what you need however, but it is often a PITA. :)
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eh02e1bLIHA.4684@.TK2MSFTNGP06.phx.gbl...
> You would have to set up the other instance as a "linked server". But what
> you want to do requires a distributed transaction (with DTC running and
> all that jazz) so I would re-think the approach if possible.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
> news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
>> tHi
>> I want to build a trigger to modify data in a table in a database that is
>> running on another Database Engine in may LAN. I don' t know if that is
>> possible. If it is, how will I make the connection to that database?
>> Thanks in advance - Waldo
>
Showing posts with label t-sql. Show all posts
Showing posts with label t-sql. Show all posts
Tuesday, March 27, 2012
accessing from T-SQL a database on another DBMS
tHi
I want to build a trigger to modify data in a table in a database that is
running on another Database Engine in may LAN. I don' t know if that is
possible. If it is, how will I make the connection to that database?
Thanks in advance - Waldo
I concur. Consider some form of asynchronous mechanism where by you put the
requisite information in a queing table and pull from the other db engine to
do the updates.
You can get DTC to do what you need however, but it is often a PITA.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eh02e1bLIHA.4684@.TK2MSFTNGP06.phx.gbl...
> You would have to set up the other instance as a "linked server". But what
> you want to do requires a distributed transaction (with DTC running and
> all that jazz) so I would re-think the approach if possible.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
> news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
>
I want to build a trigger to modify data in a table in a database that is
running on another Database Engine in may LAN. I don' t know if that is
possible. If it is, how will I make the connection to that database?
Thanks in advance - Waldo
I concur. Consider some form of asynchronous mechanism where by you put the
requisite information in a queing table and pull from the other db engine to
do the updates.
You can get DTC to do what you need however, but it is often a PITA.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eh02e1bLIHA.4684@.TK2MSFTNGP06.phx.gbl...
> You would have to set up the other instance as a "linked server". But what
> you want to do requires a distributed transaction (with DTC running and
> all that jazz) so I would re-think the approach if possible.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
> news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
>
accessing from T-SQL a database on another DBMS
tHi
I want to build a trigger to modify data in a table in a database that is
running on another Database Engine in may LAN. I don' t know if that is
possible. If it is, how will I make the connection to that database?
Thanks in advance - WaldoYou would have to set up the other instance as a "linked server". But what y
ou want to do requires a
distributed transaction (with DTC running and all that jazz) so I would re-t
hink the approach if
possible.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
> tHi
> I want to build a trigger to modify data in a table in a database that is
> running on another Database Engine in may LAN. I don' t know if that is
> possible. If it is, how will I make the connection to that database?
> Thanks in advance - Waldo|||I concur. Consider some form of asynchronous mechanism where by you put the
requisite information in a queing table and pull from the other db engine to
do the updates.
You can get DTC to do what you need however, but it is often a PITA.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eh02e1bLIHA.4684@.TK2MSFTNGP06.phx.gbl...
> You would have to set up the other instance as a "linked server". But what
> you want to do requires a distributed transaction (with DTC running and
> all that jazz) so I would re-think the approach if possible.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
> news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
>
I want to build a trigger to modify data in a table in a database that is
running on another Database Engine in may LAN. I don' t know if that is
possible. If it is, how will I make the connection to that database?
Thanks in advance - WaldoYou would have to set up the other instance as a "linked server". But what y
ou want to do requires a
distributed transaction (with DTC running and all that jazz) so I would re-t
hink the approach if
possible.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
> tHi
> I want to build a trigger to modify data in a table in a database that is
> running on another Database Engine in may LAN. I don' t know if that is
> possible. If it is, how will I make the connection to that database?
> Thanks in advance - Waldo|||I concur. Consider some form of asynchronous mechanism where by you put the
requisite information in a queing table and pull from the other db engine to
do the updates.
You can get DTC to do what you need however, but it is often a PITA.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eh02e1bLIHA.4684@.TK2MSFTNGP06.phx.gbl...
> You would have to set up the other instance as a "linked server". But what
> you want to do requires a distributed transaction (with DTC running and
> all that jazz) so I would re-think the approach if possible.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "wvandenbroeck" <wvandenbroeck@.discussions.microsoft.com> wrote in message
> news:2A416FD1-02F9-427D-9748-7F2CE4E08CDD@.microsoft.com...
>
Sunday, March 11, 2012
Access to Windows Registry
Hi,
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
MassimoSure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
MassimoSure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLSe
rver\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.
Access to Windows Registry
Hi,
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
Massimo
Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
Massimo
Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Param eters',
N'SQLArg0'
HTH, jens Suessmeyer.
Access to Windows Registry
Hi,
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
MassimoSure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.
is it possible, inside T-SQL, to access and set keys in Windows
Registry?
Thanks for your help.
MassimoSure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.|||Sure,
e.g.
EXEC master..xp_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\MSSQLServer\Parameters',
N'SQLArg0'
HTH, jens Suessmeyer.
Access to SQL Server Upsize Query Problem
Hi,
I have a query written in Jet-SQL which i need to convert to T-SQL as I am upgrading an Access DB to SQL Server 2000.
Query is:
SELECT WDF_TBLSKILL.RECID,WDF_TBLSKILL.TECHNOLOGY,Iif(EXI STS(SELECT * FROM WDF_TBLCOMPANY_TBLSKILL_LNK WHERE SKILLID=WDF_TBLSKILL.RECID AND COMPANYID=857),1,0) AS CHOSENSKILL FROM WDF_TBLSKILL ORDER BY WDF_TBLSKILL.TECHNOLOGY ASC;
It is falling over on the 3rd select item (The Iif statement) which I want to return a 1 if any records are found in the subquery or 0 if they aren't.
I know Iif is not supported in SQL but can't find anything that seems to do the job.
Please help!!!SELECT WDF_TBLSKILL.RECID
, WDF_TBLSKILL.TECHNOLOGY
, case when EXISTS
(SELECT * FROM WDF_TBLCOMPANY_TBLSKILL_LNK
WHERE SKILLID=WDF_TBLSKILL.RECID
AND COMPANYID=857) then 1 else 0 end AS CHOSENSKILL
FROM WDF_TBLSKILL
ORDER BY WDF_TBLSKILL.TECHNOLOGY ASC|||thanks mate - much appreciated. you've saved me a lot of time and effort.
I have a query written in Jet-SQL which i need to convert to T-SQL as I am upgrading an Access DB to SQL Server 2000.
Query is:
SELECT WDF_TBLSKILL.RECID,WDF_TBLSKILL.TECHNOLOGY,Iif(EXI STS(SELECT * FROM WDF_TBLCOMPANY_TBLSKILL_LNK WHERE SKILLID=WDF_TBLSKILL.RECID AND COMPANYID=857),1,0) AS CHOSENSKILL FROM WDF_TBLSKILL ORDER BY WDF_TBLSKILL.TECHNOLOGY ASC;
It is falling over on the 3rd select item (The Iif statement) which I want to return a 1 if any records are found in the subquery or 0 if they aren't.
I know Iif is not supported in SQL but can't find anything that seems to do the job.
Please help!!!SELECT WDF_TBLSKILL.RECID
, WDF_TBLSKILL.TECHNOLOGY
, case when EXISTS
(SELECT * FROM WDF_TBLCOMPANY_TBLSKILL_LNK
WHERE SKILLID=WDF_TBLSKILL.RECID
AND COMPANYID=857) then 1 else 0 end AS CHOSENSKILL
FROM WDF_TBLSKILL
ORDER BY WDF_TBLSKILL.TECHNOLOGY ASC|||thanks mate - much appreciated. you've saved me a lot of time and effort.
Subscribe to:
Posts (Atom)