Pages

Tuesday, September 20, 2011

How to strip spaces.

UPDATE [TABLE]
SET [COLUMN] = LTRIM(RTRIM([COLUMN]))
WHERE LEN([COLUMN]) <> DATALENGTH([COLUMN])

Thursday, September 1, 2011

Free Stanford Introduction class on Databases

Stanford is teaching a free class on databases. You should check it out.

Wednesday, August 24, 2011

Ran into a new error today when working with Linked Servers.

The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server " " was unable to begin a distributed transaction.

OLE DB provider "SQLNCLI10" for linked server " " returned message "The partner transaction manager has disabled its support for remote/network transactions."

As the error mentioned above this is a distributed transaction error.

1st I verified that the "Distributed Transaction Coordinator" service was started, which it was but still got the error. I then verified in the properties of the service and made sure that all the security information was checked to allow inbound and outbound communication, still had error.


What ended up happening was my IT team cloned the servers which caused these issue.


Solution:

The cloned servers copied the same DTC names to the linked servers. To fix the issue you need to uninstall and reinstall DTC.

Ran the following command prompt commands:

Net stop medic

Msdtc –uninstall

Msdtc –install

Net start medic


The key now which is not in any other article that I have found is to:

Restart SQL Server


Wednesday, June 29, 2011

How to grab dates using built in system functions.

Select [DATE] = DATEADD(m,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0))
- First Day of the month with time of 00:00:00

Select [DATE] = DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0))
- Last Day of the month

Tuesday, May 31, 2011

SSRS Empty Parameter

I stumbled upon this at work and wanted to share this to everyone. In SSRS create a parameter and give it Multi-Value. Keep the Default and Shared Values Null. When you are viewing the report you can copy and paste or hand-enter in a value to that parameter.

If you use a stored procedure parameter you can pass in multiple values with a ",". Try it out!

Tuesday, May 24, 2011

Fusion IO Drives

My work uses a Fusion IO drive, probably one of the lower current models, and we were thinking about possibly getting another.  I was checking out their website and found that they have an insane model called the IO Drive Octal, which holds 5.12 TB of disk space with read speeds of 6 GB/s!  That's insane!  I've seen ours do ridiculous things which was probably only on the scale of ~750 MB/s!

http://www.fusionio.com/products/iodriveoctal/