Archive for September, 2008

Extracting The Date From a SQL DateTime In SQL Queries

September 30 2008   Leave a Comment   

Ever wondered how to quickly and easily get the date portion of a datetime field in a SQL query? Seems like it should be easy, right? Unfortunately, it isn’t. I’ve found a lot of solutions, but this one is the most elegant I’ve seen. CONVERT(datetime, FLOOR(CONVERT(float, DateTime))) I’ve put this into a user-defined function below: [...]

Leave a Comment

SQL Server 2005 Service Broker Error Code 25 (Event ID 28054)

September 2 2008   Leave a Comment   

Another issue I’ve run into with the service broker and moving databases between servers is this error message: Error code:25. The master key has to exist and the service master key encryption is required. The solution that I found was the regenerate the key for the database using the following code: CREATE MASTER KEY ENCRYPTION [...]

Leave a Comment
 
     
Copyright © 2009 All Rights Reserved. Powered by WordPress 2.7 Subscribe to RSS