Compatible :: Microsoft SQL Express 2005 and 2008 Install MS SQL Express 2008 SQL Query Command -- ## Change login mode to 2 = "Windows and SQL Server Authentication", 1 = "Windows Authentication Only" EXEC master.dbo.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2 -- ## Enable sa and change password to "aaaa" ALTER LOGIN [sa] WITH PASSWORD='aaaa', CHECK_POLICY=OFF ALTER LOGIN [sa] ENABLE -- ## Change Port to 1433 EXEC master.dbo.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\Microsoft SQL Server\MSSQLServer\SuperSocketNetLib\Tcp\IpAll', N'TcpDynamicPorts', REG_DWORD, 1433 -- ## Enable Network TCP/IP and Change Port Run Command Prompt netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT net stop "SQL Server (SQLEXPRESS)...