简体   繁体   中英

How to import a SQL file into SQL Server 2008 using Visual Studio 2010?

What I tried so far is to go to server explorer:

  • connect to a database
  • choose server name

and tried to attach a database file but it asks for an .mdf file and I don't know what is this and how to create it. My database is a .sql file

A .sql file, is a file that contains statements that can be executed. They can contain statements that create database and tables (and other stuff) or that manipulate the data in an existing database (like inserting records).

If you want to execute the .sql file, you can open it in Visual Studio and then run it. It will ask you for a connection to a Sql Server instance and then the statements will be executed.

Here is the MSDN documentation that explains this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM