Can you create a SQL Database from Visual Studio?

  • Thread starter Thread starter Gustaf
  • Start date Start date
G

Gustaf

Can't find a good place for this, but hopefully, this group isn't too far off. I just installed SQL Server Developer Edition, and found a tutorial online to get started. In the tutorial, which is made for Express Edition, they create a database from Visual Studio with the command Add New Item -> SQL Database. And then it's just to start working on the columns. Very simple.

But when I tried it, Visual Studio complained that Express Edition wasn't installed! Isn't Developer Edition good enough for Visual Studio? Well, I downloaded the basic Express Edition, and installed it (it was installed with Visual Studio, but I removed it before installing Developer Edition), and now I get another, even more cryptic message: "Failed to generate a user instance of SQL Server due to failure in starting the process for the user instance. The connection will be closed."

Googling for this message and you end up in a hopeless mess of proposed solutions, most of which doesn't work for most people. All I want to know is: can you create a SQL Database from within Visual Studio, using anything other than SQL Server Express Edition?

Gustaf
 
Yes, you can. There are any number of ways including:
1.. Use SQL Server Management studio's object explorer.
2.. Use Visual Studio's Server Explorer (assuming don't have VS Express, in which case it only works with SQL Server Express--which I expect is what you have).
3.. Create the database programmatically using SqlCommand objects setup with CREATE DATABASE scripts.
4.. Use SQLCMD
All of these techniques and more are in my book "Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)".

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
William said:
Yes, you can. There are any number of ways including:

All of these techniques and more are in my book "Hitchhiker's Guide to
Visual Studio and SQL Server (7th Edition)".

Very helpful, thanks. Interesting book too. :-)

Gustaf
 
Back
Top