User Tools

Site Tools


windows:sqlserver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
windows:sqlserver [2015/01/14 03:51] – [install SQLEXPR_x64_ENU.exe(sql server 2012)] adminwindows:sqlserver [2015/03/11 15:35] – [The actual stored procedure line number from an error message] admin
Line 2: Line 2:
 ===== Install  SQL server ===== ===== Install  SQL server =====
 ==== install sql server 2012 with Manage studio tools ==== ==== install sql server 2012 with Manage studio tools ====
-Download and Install SQLEXPRWT_x64_ENU.exe+Download and Install SQLEXPRWT_x64_ENU.exe(SQL management studio was integrated in this package)
   * Authentication: **mixed mode**(authenticate with windows authentication and sql server authentication)   * Authentication: **mixed mode**(authenticate with windows authentication and sql server authentication)
   * Change Data directories:{{:windows:sqlserver-directory.png|}} => change **data root directory** to d:\data   * Change Data directories:{{:windows:sqlserver-directory.png|}} => change **data root directory** to d:\data
Line 9: Line 9:
     * to {{:windows:sqlserver-network-enable.png|}}     * to {{:windows:sqlserver-network-enable.png|}}
   *   * In SQL Server Configuration:  go to SQL Server Network Configuration→Protocols for MSSQLServer→TCP/IP, Config port 1433(not dynamic port) for TCP/IP{{:windows:sqlserver-ipconfig.png|}}   *   * In SQL Server Configuration:  go to SQL Server Network Configuration→Protocols for MSSQLServer→TCP/IP, Config port 1433(not dynamic port) for TCP/IP{{:windows:sqlserver-ipconfig.png|}}
-==== install SQLManagementStudio_x64_ENU.exe ==== +==== install SQL server 2008  ==== 
-to manage sql server(must install SQLEXPR_x64_ENU.exe before install this package)+  - step1: SQLEXPR_x64_ENU.exe  2008 
 +  - step2: install SQLManagementStudio_x64_ENU.exe
 ===== Basic Config with SQL Server Configuration Tool ===== ===== Basic Config with SQL Server Configuration Tool =====
 ==== Change config TCP/IP connection ==== ==== Change config TCP/IP connection ====
Line 25: Line 26:
 </code> </code>
   * Step2: Using SQL Server Configuration Tool, go to **SQL Server Network Configuration**->**Protocols for MSSQLServer**->**TCP/IP**{{:windows:sqlserver-ipconfig.png|}}   * Step2: Using SQL Server Configuration Tool, go to **SQL Server Network Configuration**->**Protocols for MSSQLServer**->**TCP/IP**{{:windows:sqlserver-ipconfig.png|}}
 +==== view database config(data config, log config...) ====
 +  * step1: select database as below image:
 +{{:windows:database-config.png|}}
 +  * step2: right-click the database and click **properties** to see the database settings as below image:
 +{{:windows:database-setting.png|}}
 ==== reset password ==== ==== reset password ====
 ===== Backup and restore ===== ===== Backup and restore =====
 ==== backup and restore bak file ==== ==== backup and restore bak file ====
 +  * to restore: right click **databases** and select restore database
 +  * to backup:  right click **database name** and select **tasks -> backup**
 +==== backup and restore sql scripts ====
 +  * backup: right click **database name** and select **tasks->generate scripts**
 +==== attach database file(mdf file) ====
 +===== debug in sql server =====
 +==== query log in sql server ====
 +  * to view query log in sql server, we use sql server profiler
 +  * with sql server express, we use expressprofiler(because in this version, the sql server profiler not exists): https://expressprofiler.codeplex.com/
 +==== The actual stored procedure line number from an error message ====
 +Error line numbers may not match the number returned in the error always, this is because when **the SQL server executes a stored proc, it has its own compilation & execution methodology**, so the line numbers vary based on the execution order it takes
 +==== Debug stored procedure with break point ====
windows/sqlserver.txt · Last modified: 2022/10/29 16:15 by 127.0.0.1