Tools – ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)

The ASP.NET SQL Server Registration tool is used to create a Microsoft SQL Server database for use by the SQL Server providers in ASP.NET, or to add or remove options from an existing database. The Aspnet_regsql.exe file is located in the [drive:]%windir%Microsoft.NETFrameworkversion folder on your Web server.

You can run Aspnet_regsql.exe without any command-line arguments to run a wizard that will walk you through specifying connection information for your SQL Server installation, and installing or removing the database elements for the membership, role management, profile, Web Parts personalization, and health monitoring features. (Setting session state and SQL cache dependency are not covered by the wizard.) You can also run Aspnet_regsql.exe as a command-line tool to specify database elements for individual features to add or remove, using the options listed in the table below. (from MSDN)

This tool is especially useful when you create an ASP.NET website and want to replace the default aspnetdb.mdf file with a database like SQL Server 2008 database etc.
Microsoft has explained what this tool does on their MSDN site, but to see it working you can try it out. It is quite useful.
1- Open SSMS
2- Create an empty database
3- Go to “C:WindowsMicrosoft.NETFramework64v4.0.30319” -> this is for Windows ┬áServer 2008 and for that specific version of .NET framework
4- Double-click aspnet_regsql.exe
5- Follow the steps in the wizard, choose your Database Server and Database you want to prepare for ASP.NET SQL Server Providers
6- Finish the wizard, check the tables, stored procedures etc. in your empty database.

Cool huh?

Hope this helps someone.

Good luck,
Serdar

Leave a Reply

Your email address will not be published. Required fields are marked *