p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4.5 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=710)
-   -   Ch 19 Re-creating the Database (http://p2p.wrox.com/showthread.php?t=92191)

AlanWheeler February 14th, 2014 06:31 PM

Ch 19 Re-creating the Database
 
Hi Imar,

My hosting provider uses a service called Plesk developed by Parallels in case that will prompt any special comments from you. There is a page on the hosting control panel to create databases and they allow SSMS to connect to their 2012 SQL Server (SP1).

I created the script from the Export Database Try-It-Out and now need to connect to the SQL server so I can re-create the database at the hosting provider.

I have: (1) the IP address of the server, (2) created an SQL Server database at the server called PlanetWrox, (3) a User Name and Password to access the database.

I'm still learning SSMS. I didn't intuitively see how to connect to the hosting provider SQL server from my desktop. If I missed that in the book please point to it, or is that simple enough for you to relate in this forum? I saw some tutorials at Microsoft for SSMS, but I was hoping you might have a few quick steps to follow to establish the connection.

If I understood things from your book and App B, I simply need to (1) connect to the hosting SQL server, (2) run the script we prepared, (3) change the 2 connections strings in web.config (plus the rest of your deployment checklist) and (4) reload the site to the server. Then the database should work, yes?

Thanks.

Best Regards,
Alan

Imar February 15th, 2014 10:27 AM

Hi Alan,

Take a look at Figure 12-3 on page 425. It shows the Login box for SQL Server. Change Windows Authentication to SQL Authentication (or whatever it's called) in the drop down list and enter your details. You should enter your IP as the server name.

Cheers,

Imar

AlanWheeler February 16th, 2014 12:36 PM

Hi Imar,

That was perfect. I didn't quite understand that I could type in an IP address to reach the server. So,

1) I logged in, saw the tremendous list of everyone else's databases on that server, and found my PlanetWrox database.

2) I loaded my .sql script created according to the Ch 19 'Exporting' Try-It-Out.

3) But before I clicked execute, I reviewed the script a little. The first line is 'CREATE DATABASE [PlanetWrox]... . In order to gain access to the server I had to create the database called PlanetWrox, so it already exists. Do I need to alter the script, or will it just bypass this command if it sees the database already exists?

Or, should I delete everything on the server, recreate another 'temp' database, and then run the full script and expect the server to allow me to create the PlanetWrox database from within the Server to SSMS interface?

Thanks.

Best Regards,
Alan

Imar February 16th, 2014 01:43 PM

You can use delete the code that creates the database, and then run the script against your existing database.

Cheers,

Imar


All times are GMT -4. The time now is 11:59 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.