Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to run a SQL script

Posted on 2011-09-11
7
Medium Priority
?
429 Views
Last Modified: 2012-08-14
I've been developing VB6 apps for many years, and now I have to develop a VB10 (Visual Studio 2010) database app that is to be hosted on the web.

I've created the program, which connects to a local SQL Server database, and it runs ok

I've uploaded the code to a Fasthosts folder via FTP, and I've created a SQL Server database with Fasthosts, which has an IP address, user name and password

What I cannot figure out is how to upload the database schema and data to Fasthosts !!

VS 2010's Database Publishing Wizard let me create a .SQL script file, but how and where do I run it?

I'm sure this is fairly straightforward, but I can't find out what to do next

Grateful for any help
Geoff
0
Comment
Question by:lybreeze
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 36518913
you have to read the file contents, and use the connection's execute method for the sql.

however, there is a gotcha, if there are lines that are just "GO", you have to split the file contents by the separator, because GO is not t-sql, actually.

hope this clarifies
0
 

Author Comment

by:lybreeze
ID: 36519301
Thanks for your reply.

However, could you please provide a bit more detail about how I go about reading the file contents and using the connection's execute method.  Where am I to do this - in VS 2010 or when connected to Fasthosts?

Thanks
Geoff
0
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 1000 total points
ID: 36519347
what interface do fasthosts provide for you to adminisiter you site/server?

you are probably best to contact there support line.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:lybreeze
ID: 36519482
Thank you. I'll give them a call and get back
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 36521639
here some example:
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/ee667e6d-d34a-48b4-b0f1-de875c183f3f/
check that you get the code that reads the file AND splits by the GO line ...
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 1000 total points
ID: 36526396
FastHost has a PDF guide regarding their SQL Server and it appears that you can connect your Management Studio to their servers directly which means you can directly import export stuff

http://help.fasthosts.co.uk/euf/assets/pdf-guides/Getting-started-with-MS-SQL.pdf

http://msdn.microsoft.com/en-us/library/ms141209.aspx
0
 

Author Closing Comment

by:lybreeze
ID: 36554214
Thank you to you all for your help.

I contacted Fasthosts, and they suggested I use SQL Server Management Studio, a link to which is available on their website (although there seems a bit of confusion about the Express and Compact versions - can anyone shine any light on this?)

However, when I tried to install that on my PC with VS2010 it didn't install, probably because VS2010 already includes a copy of SQL Server (accessed via the Server Explorer and Solution Explorer tabs).  The problem is that when I use the SQL Server built into VS2010 it will only connect to a local server, not to a remote one.

I've got round it by installing SQL Server Management Studio on a separate PC, and creating the SQL Server database on that machine.  Nevertheless, I'm sure that I'm missing something here, as it ought to be possible to administer a remote database using VS2010 !!

Thanks again
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question