Blogs
September 09, 2010
Filter by Category
Blogs
Author: Thomas Hundley Created: 4/21/2007 12:22 AM
This blog will be used to post technical problems and solutions that we have encountered with SQL Server.

 

I only need to do this every so often, but I always forget how to and end up looking it up.  Thus, I'm posting it here for reference.

 

 

USE DatabaseName

GO

BACKUP LOG DatabaseName> WITH TRUNCATE_ONLY

DBCC SHRINKFILE(TransactionLogName>, 1)

Tom Hundley Elegant Software Solutions, LLC



...

Read More »

Here is a script to rebuild all of your indexes on your database.  I find that indexes are often ignored once an application moves to production.  It's a good idea to evaluate your usage patterns and setup automated maintenance jobs to proactively rebuild indexes before fragmentation has a chance to adversely effect performance.  This is especialy important if you are using guids as primary keys and don't move the clustered index to a more logically sequential column. 

 

 -- Show fragmentation for all tables EXEC sp_MSforeachtable @command1="print '?' DBCC SHOWCONTIG('?')"



 

--Rebuild all indexes (note this method locks the tables while the indexes are being rebuilt)

USE [myDatabase]

 

DECLARE @TableName varchar(255)

 

DECLARE TableCursor CURSOR FOR

SELECT table_name FROM information_schema.tables

WHERE table_type = 'base table'

 

OPEN TableCursor

 

FETCH NEXT FROM TableCursor INTO @TableName

...

Read More »

Did you know you can connect to SQLServer from your application using SSL?

Read More »

Quick reference to the Microsoft SQL Server 2005 Whitepaper

Read More »

Viewing and editing an existing SSIS package is limited to SQL Server Business Intelligence Development Studio (SSBIDS) or Visual Studio 2005 Team Suite (VSTS).

Read More »

I used SQL Server Integration Services (SSIS) Import & Export Wizard from SQL Server Management Studio (SSMS) to create an SSIS package and saved it to the server. I beat my head against the wall trying to find it via SSMS after I saved it.

Read More »

Home  |  Clients  |  Blogs  |  Contact Us
Copyright© Elegant Software Solutions, LLC