(1)啟用TCP:
SQL Server Express預設沒有啟用TCP
1. 開啟SQL Server Configuration Manager > SQL Server 網路組態 > SQLEXPRES的通訊協定 > TCP/IP > 內容 > IP位址 > 找到 IPAll > TCP通訊埠 (例如輸入1433)
2. 重啟 SQL Server Express 服務
以下為截取自網路的SQL Express相關設定可做為參考
Step 1: Enable TCP/IP connections
use TCP/IP to
In SQL Server Configuration Manager, expland the SQL Server
Network Configuration > Protocols for SQLEXPRESS node.Right -click the TCP/IP item on the right;then select Properties .On the
General tab,change Enabled to
.Yes On the IP
Addresses tab, under the IPAll node,clear the TCP DynamicPorts box .In TCP
Port ,enter theport tolisten on . Forexample ,1450
.Remember thisport , because itneeds to be used in the connectionstring .Click OK.Restart the Microsoft SQL Server Express
service using either the standardservice control panel or the SQL Expresstools .
Step 2: Enable SQL Server authentication
When require SQL Server authentication to be enabled on the instance of SQL Express. To do this:
In SQL Server Management
Studio Expresstool ,right -click the instance of SQL Express to configure;then select Properties .Select the Securitysection on theleft .Change the Server Authentication to SQL Server andWindows Authentication mode.Restart the Microsoft SQL Server Express
service using either the standardservice control panel or the SQL Expresstools .
Step 3: Create a database user
When require a user to
In SQL Server Management
Studio Expresstool ,right -click the Security > Logins node;then select New Login.Enter the username (e.g. web ).Change the Server Authentication to SQL Server andWindows Authentication mode.Enter the user’s password.Disable password expiration.
Click OK.After
creating database , assign this userdb_owner
permissions on thedatabase , so that it cancreate the requireddatabase tables .
Step 4: Set statistics to auto update
In SQL Server Management
Studio Express,right -click thedatabase ;then select Properties .The
Database Properties dialog isdisplayed .Scroll to the
top of theOther optionslist .In Auto
Update Statistics,select True .Click OK.