Reputation: 193312
I created a "Service-Based Database" (.MDF) in Visual Studio and now want to import a SQL script into it, but cannot find any way to do this:
Does the Visual Studio 2008 Database Explorer have a way to enter or import SQL query text?
Upvotes: 3
Views: 3854
Reputation: 7614
When you choose "New Query", the default behavior is to open the Query Editor. So you have to close the Add Table. After that, you should see a window with four panes - Diagram, Criteria, SQL and Result pane. You should be able to put your script to SQL pane and run from it. The Studio may complain about being unable to parse the script, just ignore it and hit ok, the script should run.
If you cannot see these panes, ensure you have "Query Designer" toolbar enabled and "SQL pane" button pushed.
However, I would recommend installing SQL Management Studio, there is a free express version available.
Upvotes: 2
Reputation: 2158
Why don't you just attach the database directly to your SQL Server (or SQLExpress) and then copy the database objects. The detach from the sql server again.
Upvotes: 0