Showing posts with label BUG & FIX. Show all posts
Showing posts with label BUG & FIX. Show all posts

Tuesday, September 3, 2013

Rebuild System Database (Master.mdf) in SQL Server 2008

  • Open command prompt (Run -> cmd)
  • Change to directory "<<drive>>:\<<installation folder>>\Microsoft SQL Server\100\Setup Bootstrap\Release" (eg:  C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release)
  • USE THE FOLLOWING COMMAND 
Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts [/ SAPWD= StrongPassword ] [ /SQLCOLLATION=CollationName]

If you have SQL configured for Windows Authentication Mode :

               
setup /ACTION=REBUILDDATABASE /QUIET /INSTANCENAME=<instance name> /SQLSYSADMINACCOUNTS=<accounts>


Eg: setup /ACTION=REBUILDDATABASE /QUIET /INSTANCENAME=SQLEXPRESS /SQLSYSADMINACCOUNTS=mypc\Administrators

If you have SQL configured for Mixed Authentication Mode

 setup /ACTION=REBUILDDATABASE /QUIET /INSTANCENAME=<instance name> /SQLSYSADMINACCOUNTS=<accounts> /SAPWD=<password>

When setup has completed rebuilding the system databases, it will return to the command prompt with no messages

After rebuilding the databases, user instance disabled.
You can enable it either using the command prompt tool named sqlcmd or by using Management Studio.
If using Command tool:

C:\>SQLCmd -S.\sqlexpress -E
1> EXEC sp_configure 'user instances enabled', 1  
2> go  
Configuration option 'user instances enabled' changed from 0 to 1. Run the RECONFIGURE statement to install.  
1> RECONFIGURE  
2> GO  

FOR MORE DETAILS
http://technet.microsoft.com/en-us/library/dd207003%28v=sql.100%29.aspx

http://blogs.msdn.com/b/psssql/archive/2008/08/29/how-to-rebuild-system-databases-in-sql-server-2008.aspx

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8dabc79b-edef-45fe-a50a-7cf8515c6ed1/how-do-i-run-the-spconfigure-stored-procedure

Thursday, June 6, 2013

ERROR - BulletedList and AJAX Toolkit


Error : Generation of designer file failed: The server tag 'asp:BulletedList' is ambiguous....
(if an Ajax Toolkit Manager and a BulletedList placed in same page(.aspx))

Reason: Same "TagPrefix"  'asp' to AJAX toolkit controls and ASP.NET controls

Solution:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
 TagPrefix="asp" %>
 
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">  
    </asp:ToolkitScriptManager> 
  
//Modify like this.
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="ajx" %>
 

<ajx:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">  
    </ajx:ToolkitScriptManager> 
 
 
 
  

Thursday, May 30, 2013

ERROR :- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance.

Sql Server 2008 Express Run Under Windows 7.

Connection String:- Data Source=.\SQLEXPRESS; AttachDbFilename= '|DataDirectory|\Database1.mdf'; Integrated Security=True;User Instance=True;Connect Timeout =60


Connection failed with Following Error Message.
"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance."

Solution
 
1. Stop all user instance processes of SQL Server running under your local account (open up task manager and look for sqlsrv.exe process and end it)

2. Delete all files in the %LOCALAPPDATA%\Microsoft\Microsoft SQL Server Data\SQLEXPRESS folder
(In Windows XP 'C:\Documents and Settings\<<<currentuser>>>\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS)'

3. Restart sql server instance

The problem is known issue.
SQL Express cannot create a user instance using the set of engine files in your local app data folder, deleting them should allow sql server to recreate them with the correct credentials.