dbTalk Databases Forums  

Accessing connection properties

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Accessing connection properties in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Abraham
 
Posts: n/a

Default Accessing connection properties - 04-17-2004 , 07:11 PM






Hi,

I have a DTS package that contains an activeX script and a "Microsoft
OLE DB Provider for SQL Server" connection. I have defined the server
and database to use in the connection. How can I from my activeX
script get a list of tables, table indexes by somehow referencing the
connection I defined:

DTSGlobalVariables.Parent.Connections("MyConnectio n")

Is it possible to get these properties from the object above?

I am currently using SQLDMO to create an object

CreateObject("SQLDMO.SQLServer")

opening the connection, getting the table list etc. and closing the
connection.

If I already have a connection defined ("MyConnection"), why do I have
to use SQLDMO to open an extra connection that accesses properties of
the database? Shouldn't I able able to use the object
DTSGlobalVariables.Parent.Connections("MyConnectio n") to get these
same properties?


Thanking you,
-tom

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Accessing connection properties - 04-18-2004 , 02:00 AM






There is nothing in the connection itself for you to use. When you use the
connection in a datapump then DTS has to go away and query the tables
seperately as well (Note how long it takes on a large DB). For what do you
require the list of tables?

You can use the connection but you would only be mapping to ADO properties
the same properties from the connection object.

SQLDMO is the way forward if you want stuff like this although you can
retrieve this information from the INFORMATION_SCHEMA.XXX views (or a lot of
it at least)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Thomas Abraham" <thomas_rp (AT) hotmail (DOT) com> wrote

Quote:
Hi,

I have a DTS package that contains an activeX script and a "Microsoft
OLE DB Provider for SQL Server" connection. I have defined the server
and database to use in the connection. How can I from my activeX
script get a list of tables, table indexes by somehow referencing the
connection I defined:

DTSGlobalVariables.Parent.Connections("MyConnectio n")

Is it possible to get these properties from the object above?

I am currently using SQLDMO to create an object

CreateObject("SQLDMO.SQLServer")

opening the connection, getting the table list etc. and closing the
connection.

If I already have a connection defined ("MyConnection"), why do I have
to use SQLDMO to open an extra connection that accesses properties of
the database? Shouldn't I able able to use the object
DTSGlobalVariables.Parent.Connections("MyConnectio n") to get these
same properties?


Thanking you,
-tom



Reply With Quote
  #3  
Old   
Thomas Abraham
 
Posts: n/a

Default Re: Accessing connection properties - 04-18-2004 , 10:27 PM



Allan,

Thanks for the reply.

Quote:
For what do you require the list of tables?
I need to get the .Script property of the table object (used to create
the tables) for all the user tables in the database. The SQLDMO method
works for me.

Thanks again,

-tom


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
There is nothing in the connection itself for you to use. When you use the
connection in a datapump then DTS has to go away and query the tables
seperately as well (Note how long it takes on a large DB). For what do you
require the list of tables?

You can use the connection but you would only be mapping to ADO properties
the same properties from the connection object.

SQLDMO is the way forward if you want stuff like this although you can
retrieve this information from the INFORMATION_SCHEMA.XXX views (or a lot of
it at least)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Thomas Abraham" <thomas_rp (AT) hotmail (DOT) com> wrote in message
news:5cf0e3b0.0404171611.4fd072b (AT) posting (DOT) google.com...
Hi,

I have a DTS package that contains an activeX script and a "Microsoft
OLE DB Provider for SQL Server" connection. I have defined the server
and database to use in the connection. How can I from my activeX
script get a list of tables, table indexes by somehow referencing the
connection I defined:

DTSGlobalVariables.Parent.Connections("MyConnectio n")

Is it possible to get these properties from the object above?

I am currently using SQLDMO to create an object

CreateObject("SQLDMO.SQLServer")

opening the connection, getting the table list etc. and closing the
connection.

If I already have a connection defined ("MyConnection"), why do I have
to use SQLDMO to open an extra connection that accesses properties of
the database? Shouldn't I able able to use the object
DTSGlobalVariables.Parent.Connections("MyConnectio n") to get these
same properties?


Thanking you,
-tom

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.