my6solutions

asp .net, the social web & other distractions

 

Running Apps


PayPal - The safer, easier way to pay online!

Disclaimer

I am in no way affiliated with Microsoft or Google. I am just another developer trying to make a difference. All opinions and observations are usually my own.

Executing SQL scripts on a SQL Server Express database

To be able to do the above you will need to install SQL Server Management Studio Express or SQL Server Management Studio (the not so free version), SSMS. The following describes the steps necessary to execute a script called createDatabaseAndTablesTest.sql:

 

  1. Connect to the SQL Express Server from SSMS. Usually the SQL Express Server is located at <COMPUTERNAME>/Express.
  2. Attach the *.mdf file, the SQL Server Express database, that you wish to execute the script on. You may need to detach this database first if you have it attached via Visual Studio or somewhere else.
  3. Execute the sql script once you've selected the appropriate database, ie. the attached database above. If this database does not appear in the selections, which happened in my case, right-click on the database and choose "New Query". And then just copy and paste the content of your script into this new query and execute it.

 

Bookmark and Share

Tags: ,
Categories: ASP .NET
Permalink | Comments (0) | Post RSSRSS comment feed