Difference between revisions of "MS SQL Server FAQs"

From Hostek.com Wiki
Jump to: navigation, search
m
Line 30: Line 30:
 
#Click Ok, and you're done.
 
#Click Ok, and you're done.
  
 +
[[Category:Databases-MSSQL]]
 
[[Category:ColdFusion-VPS]]
 
[[Category:ColdFusion-VPS]]
 
[[Category:Linux-VPS]]
 
[[Category:Linux-VPS]]
 
[[Category:Railo-VPS]]
 
[[Category:Railo-VPS]]
 
[[Category:Windows-VPS]]
 
[[Category:Windows-VPS]]

Revision as of 14:36, 8 January 2013

MS SQL Server Frequently Asked Questions (FAQ)

How to Enable TCP/IP Connections in MS SQL Server

Some versions of SQL Server (including the Express edition) have TCP/IP services disabled by default, which effectively disables remote connections to SQL Server. To enable TCP/IP services for SQL Server on your VPS or Virtual Dedicated server, follow these steps:

  1. Open the SQL Server Configuration Manager
    Remote-connections1.png

  2. Expand the SQL Server Network Configuration-->Protocols for SQLEXPRESS section (it may be named Protocols for MSSQLSERVER in some installations.)

  3. Right-Click on the TCP/IP item, and click Properties
    Remote-connections2.png

  4. Toggle the Enabled property to Yes.
    Remote-connections3.png

  5. Switch to the IP Addresses tab, and enable the ports you wish to use to access SQL Server
    Remote-connections4.png

Restart the SQL Server Service, and you'll be able to connect remotely via IP or hostname.

Note: You will need to ensure your Windows Firewall has the appropriate ports open to allow connections to MS SQL Server.

How to Clear Space in Your Transaction Log

  1. Roll back any pending transactions and clear all connections first. To do that, run the following three statement query before attempting to backup the log again:
    USE master;
    ALTER DATABASE mydatabasename SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    ALTER DATABASE mydatabasename SET MULTI_USER;
  2. Back up your transaction log by opening SQL Server Management Studio, right-clicking the database and choosing: Tasks-->Back Up....
  3. In the popup that appears be sure to set the Backup type to "Transaction Log".
  4. Set the backup destination, and give the file name a .trn extension.
  5. Once the backup is complete right-click the database, click Tasks-->Shrink-->Files.
  6. In the popup that appears, set the File Type to Log.
  7. Click OK.

When you check the size of the database's log file, it should be nearly empty (~ 1 MB).

How to add a Full Text Index

  1. Log into the SQL Server with Management Studio and find your database
  2. Expand the Storage Folder, right click "Full text Catalogs" then click "Create New"
  3. Enter only Full-text Catalog Name and Owner fields. Select any options you require.
  4. Right-Click the new Full Text catalog then select "Properties"
  5. Select "Tables/Views" and assign table/views to catalog
  6. Click Ok, and you're done.