Showing posts with label msdb. Show all posts
Showing posts with label msdb. Show all posts

Friday, March 23, 2012

Retrieving time zone adjustment

I am trying to use sp_help_targetserver to retrieve the time_zone_adjustment
from msdb on the local server. "EXEC sp_help_targetserver" returns the field
s
with no data. "EXEC sp_help_targetserver 'servername'" returns an error "The
specified @.server_name ('servername') does not exist.". I tried adding the
server group and the locsl server name by using sp_add_targetservergroup
(which itself said it was successful in both cases), but I get the same
results from sp_help_targetserver. What's am I missing?Hi
sp_help_targetserver is located in msdb and is a SQL Server Agent SP, used
for Master/Target Jobs.
It is not an information SP that can be used in the way you want to.
Regards
Mike
"Lauren" wrote:

> I am trying to use sp_help_targetserver to retrieve the time_zone_adjustme
nt
> from msdb on the local server. "EXEC sp_help_targetserver" returns the fie
lds
> with no data. "EXEC sp_help_targetserver 'servername'" returns an error "T
he
> specified @.server_name ('servername') does not exist.". I tried adding th
e
> server group and the locsl server name by using sp_add_targetservergroup
> (which itself said it was successful in both cases), but I get the same
> results from sp_help_targetserver. What's am I missing?
>|||Lauren wrote:
> I am trying to use sp_help_targetserver to retrieve the
> time_zone_adjustment from msdb on the local server. "EXEC
> sp_help_targetserver" returns the fields with no data. "EXEC
> sp_help_targetserver 'servername'" returns an error "The specified
> @.server_name ('servername') does not exist.". I tried adding the
> server group and the locsl server name by using
> sp_add_targetservergroup (which itself said it was successful in both
> cases), but I get the same results from sp_help_targetserver. What's
> am I missing?
You can probably get the time zone adjustment using:
select DATEDIFF(n, GETUTCDATE(), GETDATE())
David Gugick
Imceda Software
www.imceda.com|||Thanks. The getutcdate will get me what I need.
"David Gugick" wrote:

> Lauren wrote:
> You can probably get the time zone adjustment using:
> select DATEDIFF(n, GETUTCDATE(), GETDATE())
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
>sql

Friday, March 9, 2012

Retrieve XML From sysdtspackages90

Is there a way to translate the packagedata field data to XML on the sysdtspackages90 table on msdb?

I want to be able to programmatically analyze and potentially modify the XML of Integration Services packages that reside on the server.

Thanks for your help.

Modifying the xml directly is not supported. However, you can get the package from the packages table by using the LoadPackageFromSQLServer method on the application object. You can save it to a file and then read the package file however you like to access the xml (xmlreader, dom, etc).

Matt