Subhankar
Subhankar

Reputation: 537

How to convert .sql file into .mdf file?

I have a .sql file. How can I convert this .sql file to a .mdf SQL Server database file?

I know that .sql file is nothing but a script file if I open the .sql file in notepad it will show me the db code I can simply copy those code and paste into SQL Server Management Studio.

Is there any other way to convert .sql to .mdf file?

Upvotes: 1

Views: 3308

Answers (1)

PM 77-1
PM 77-1

Reputation: 13334

Unless your SQL file contains the script to create a database, your question wouldn't make any sense. If it does contain such script you need an environment to execute it. There are many tools that will allow you to do that. For example, many IDE tools that integrate with SQL Server have such capability.

So to answer your question: it is impossible to convert SQL file to MDF. You, however, can sometimes use an SQL file to build MDF.

Upvotes: 4

Related Questions