Hi
I am using SQL Server 2000 and I would like to know how to create a database
on a remote server.
Right now, my application has to be on the same pc as the Server to create
the database using SQLDMO, I do use scripts to create the database but one
of our customer has a problem, they have a saperate dedicated SQL Server
2000 PC and on another PC they have my application. My application crashes
as it unable to create the database on the remote Server using ADO/SQLDMO.
For example:
I have a Server running SQL2K/MSDE and 1 workstation running my
application. From the workstation I would like to send command to Server to
create a database using ADO/SQLDMO.
Let me know if it's possible to create database on the remote server?
Thanks>> Let me know if it's possible to create database on the remote server?
If you are using 4-part naming, you can use sp_ExecuteSQL like:
EXEC server.master.dbo.sp_ExecuteSQL N'CREATE DATABASE db..'
Anith|||Can explain what is 4-part naming?
Right now, I have a create database script that does the creation.
How do I use the existing script with sp_Execute?
Thanks for the info.
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:%23s3ARcKuFHA.3756@.tk2msftngp13.phx.gbl...
> If you are using 4-part naming, you can use sp_ExecuteSQL like:
> EXEC server.master.dbo.sp_ExecuteSQL N'CREATE DATABASE db..'
> --
> Anith
>|||>> Can explain what is 4-part naming?
4-part naming is a way to refer to objects (tables, views, procedures etc. )
in a remotely located server, say a linked server using
server.database.owner.object scheme. Using it you can express distributed
queries across servers using appropriate OLEDB providers. Details can be
found in SQL Server Books Online under the topic "Linked Servers".
If you already have a CREATE DATABASE script, you can wrap it as a string
and execute it. See the topic sp_ExecuteSQL in SQL Server Books Online for
details and examples.
Anith
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment