This is a step by step guide which will show you how to restore a .bak file in Microsoft SQL Server Management Studio. This technique can be used to move databases between servers or restore an existing database to a previous state.
Learn exactly how you can restore a .bak file in SQL Management Studio with this step-by-step guide
Posted on: Saturday, 31 October 2009 01:24
Using aspnet_regsql via the command line to setup membership roles and profiles only
Posted on: Monday, 24 August 2009 19:29
When you setup the asp.net membership, profile, etc using the aspnet_regsql wizard its pretty much an all or nothing affair - it adds all of the possible features in one go with no option to select which features are added.
When setting up the login systems you only need to add the following feature support: Membership, Role Manager and Profiles. The two remaining features (Personalization and SQL Web event provider) are not needed.
So to only install the features you require you should use the command line version of the tool.
Note: The version listed below (v2.0.50727) is valid for both .net 2.0 and .net 3.5. Without going into the technical details .net 3.5 is a layer on top of 2.0 and the same tool is used for both versions.
If you are working with a version that is newer than 3.5 then check that versions folder for an updated version of this tool as it may be updated in future versions.
Getting the command window open (Windows Vista)
- Click the start button then copy and paste this into the search box C:\Windows\Microsoft.NET\Framework\
- While holding the shift key down, right click on the folder called "v2.0.50727".
- You will see the normal context menu but with an extra option called "Command Window Here"
Getting the command window open (Older versions of Windows)
- Click the start button, select Run.
- Type "cmd" without the speech marks and press enter
- Copy this line of text: cd C:\Windows\Microsoft.NET\Framework\v2.0.50727\
- Right click in the command prompt window and choose paste.
- Press enter
Setting up the database
Now that you are in the correct location you should type the text below into the command line.
aspnet_regsql.exe -E -S .\SQLEXPRESS -A mrp -d databasenameThe -E, -S, -A and -d are all case-sensitive so make sure you type the line exactly!
Replace SQLEXPRESS with the instance name of your database server - if you're using the free version of Sql Server then you will almost certainly be called .\SQLEXPRESS. The .\ bit at the start means "this computer" so if your sql server is on a different server then put the computer name there such as COMPUTER\SQLEXPRESS.
Replace databasename with the name of the database you want to add these features to.
What do the command line parameters mean?
You can get a full explanation of all the options available by typing:
aspnet_regsql -?
Here is a run down of the parameters we used:
-E Auth with windows credentials -S server instance -A services to add (membership, roles, profiles) -d database name
REMEMBER - Parameters are case sensitive
Did it work?
Press enter and you should see this:
Start adding the following features: Membership Profile RoleManager ....... Finished. C:\Windows\Microsoft.NET\Framework\v2.0.50727>
A final tip
One thing that I did not realise the first time I used these features is that you can use an existing database when you set these tables up. In my first site that I used these features I ended up with two databases like ClientDatabase and ClientDatabaseAspNetDB because I thought that it would overwrite my data! This is NOT the case! You can specify the same database you are using for all your other development.Further Reading
Where can I get Microsoft SQL Server Management Studio Express 2008 from?
Posted on: Sunday, 26 July 2009 12:20
Direct Download
Microsoft have now updated their download page so that you can download the Microsoft SQL Server Management Studio Express as an individual download.
Visit this website:
Scroll down to the "Other Installation Options" section and you will see that at the bottom of the column titled "Management Tools" there is a Install link.
Microsoft Web Platform
You can also get the application via the Microsoft Web Platform Installer which can be downloaded here:
Backup your database using an SQL command (Export to .bak)
Posted on: 11:25
This article has been updated and published on CodeAsp.Net
You can read it here:
Backup your database using Microsoft SQL Server Management Studio Express (Export to .bak)
Posted on: Saturday, 25 July 2009 16:20
This article has been updated and published on CodeAsp.Net
You can read it here:
