Home All Groups Group Topic Archive Search About

update database I don't know its name till runtime

Author
14 May 2005 9:31 AM
Ahmed
Hi all,

I want to insert a row in a table that resides in DB on another server.

I don't know the database, server, username and password till runtime.

The stored procedure will take 4 arguments represent the connectivity
settings:

@Server,@DB,@UserName,@PWD

1. HOw can I connect to the server?

2. How to update the table?

thank you!

Author
14 May 2005 11:00 AM
mark baekdal
see OPENDATASOURCE in Books Online.


regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Build, Comparison and Synchronization from Source Control = Database change
management for SQL Server




Show quote
"Ahmed" wrote:

> Hi all,
>
> I want to insert a row in a table that resides in DB on another server.
>
> I don't know the database, server, username and password till runtime.
>
> The stored procedure will take 4 arguments represent the connectivity
> settings:
>
> @Server,@DB,@UserName,@PWD
>
> 1. HOw can I connect to the server?
>
> 2. How to update the table?
>
> thank you!
Author
14 May 2005 11:09 AM
David Portas
Just parameterize the connection string in the client or middle tier.

--
David Portas
SQL Server MVP
--

AddThis Social Bookmark Button