Tags
SQL Server group by dates
24 Monday Sep 2012
Posted Databases, MS SQL Server
in≈ Comments Off on SQL Server group by dates
24 Monday Sep 2012
Posted Databases, MS SQL Server
in≈ Comments Off on SQL Server group by dates
Tags
18 Wednesday Jul 2012
Posted Databases, MS SQL Server
in≈ Comments Off on MS SQL Server 2008: force server to listen on a particular port
Tags
Trying to make a dev server instance listen on the same port as the production counterpart. Had to remove the 0 for each IP address and set the desired port for the IPALL section…see http://msdn.microsoft.com/en-us/library/ms177440.aspx
To assign a TCP/IP port number to the SQL Server Database Engine
- In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for <instance name>, and then double-click TCP/IP.
- In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1, IP2, up to IPAll. One of these is for the IP address of the loopback adapter, 127.0.0.1. Additional IP addresses appear for each IP Address on the computer. Right-click each address, and then click Properties to identify the IP address that you want to configure.
- If the TCP Dynamic Ports dialog box contains 0, indicating the Database Engine is listening on dynamic ports, delete the 0.
- In the IPn Properties area box, in the TCP Port box, type the port number you want this IP address to listen on, and then click OK.
- In the console pane, click SQL Server Services.
- In the details pane, right-click SQL Server (<instance name>) and then click Restart, to stop and restart SQL Server.
After you have configured SQL Server to listen on a specific port, there are three ways to connect to a specific port with a client application:
- Run the SQL Server Browser service on the server to connect to the Database Engine instance by name.
- Create an alias on the client, specifying the port number.
- Program the client to connect using a custom connection string.
18 Wednesday Jul 2012
Posted Databases, MS SQL Server
in≈ Comments Off on MS SQL Server check data file free space
Tags
Because your filegroup will run out of space sooner or later…
SELECT DB_NAME() AS DbName, name AS FileName, size/128.0 AS CurrentSizeMB, size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS INT)/128.0 AS FreeSpaceMB FROM sys.database_files;
18 Wednesday Jul 2012
Posted Databases, MS SQL Server
in≈ Comments Off on MS SQL Server transaction log full and out of disk space
Tags
Not sure where I was headed with this one…
error like
Alter failed for Database (Microsoft.SqlServer.Smo) The transaction log for database is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases (Microsoft SQL Server, Error: 9002)
you can refer this thread it will answer your questions,
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2728787&SiteID=1
When your log file has grown enormously you have 2 options to curtail the growth,
- Take a transaction log backup which will truncate the log file and then perform shrinking of log file using DBCC SHRINKFILE statement it will be successful.
- You can execute the command Backup log your database name with truncate_only (or backup log your database name with no_log) and shrink the log file. But running those commands (backup log with truncate_only or no_log) will truncate the log file but will break the log chain and hence it should NEVER BE USED. The ONLY case it can be used is when the disk in which the transaction log resides is completely FULL and there is no way to clear the disk space.
– Deepak