By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

create database at shared hoster site

P: n/a
I have an sql script that I ran on my local system using osql. It
created all the tables, views, and even inserted sample data into the
tables.

Now I need to create that same database on a shared hoster site. Only
the hoster does not allow the running of osql.

How can I create my sql server database on my shared hoster site?

Can I save and restore my database somehow?

Is there a stored procedure I can run which will run the .sql script
file?

thanks,

-Steve

Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
That depends on how your provider expects you to execute SQL code - if
they don't allow osql.exe, then what do they allow? And how do you
connect to the hosted database - do you use Enterprise Manager? Since
osql.exe is just a client application, if you can connect to the SQL
server then you should be able to use it.

Simon

Jul 23 '05 #2

P: n/a

Simon Hayes wrote:
That depends on how your provider expects you to execute SQL code - if they don't allow osql.exe, then what do they allow?
the hoster is godaddy.com You do get a panel where you can manually
config the database. There is something called "Query Analyser" which
provides a window to run sql statements. I dont think this is the same
as the Microsoft Query Analyzer that I read about yesterday. In this
godaddy qa window I cannot "run sqlscript.sql" like I think you can do
in Microsoft Query Analyzer.

What I was able to do was cut and paste large sections of my script.sql
from my PC editor into the GoDaddy "Query Analyser" window. Then I
clicked the "submit" button and it basically worked.
And how do you
connect to the hosted database - do you use Enterprise Manager? Since
osql.exe is just a client application, if you can connect to the SQL
server then you should be able to use it.


well my asp.net code can use the SqlConnection class to connect to the
database, then use SqlCommand to run SQL commands. Can osql be run in
that context?

I am curious to know if there is a stored procedure I can use which
will run an .sql script.

thanks,

-Steve

Jul 23 '05 #3

P: n/a
You might be able to re-use this code in ASP:

http://groups-beta.google.com/group/...72b5441b?hl=en

A web interface which doesn't allow uploading scripts is quite limited
- I would definitely ask the provider if they can enhance it.

There's no stored proc to run a file, probably because the server would
need to have access to the script file somehow, which is tricky if it's
on your workstation. It's common to use xp_cmdshell to call osql.exe as
a way of executing scripts, but that's only really useful for syadmins,
because of the security implications.

Simon

Jul 23 '05 #4

P: n/a

Simon Hayes wrote:
You might be able to re-use this code in ASP:

http://groups-beta.google.com/group/...72b5441b?hl=en
that looks to be exactly what I am looking for.

thanks very much,

-Steve

A web interface which doesn't allow uploading scripts is quite limited - I would definitely ask the provider if they can enhance it.

There's no stored proc to run a file, probably because the server would need to have access to the script file somehow, which is tricky if it's on your workstation. It's common to use xp_cmdshell to call osql.exe as a way of executing scripts, but that's only really useful for syadmins, because of the security implications.

Simon


Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.