SQL server name Wednesday, Aug 18 2010 

You can get the server name from SQL with this:

SELECT @@SERVERNAME AS 'Server Name'

to rename:

SP_DROPSERVER 'OLD_SERVER'
sp_addserver 'NEW_NAME' , local
*then restart SQL service

This may be useful if you have renamed your server, but the database doesn’t reflect the change.  OR you have changed servers and a program require the original SERVERNAME.

SQL Links Wednesday, Apr 28 2010 

 

Rename (move) SQL databases – Detach, Move, Attach

CASE examples:

Max by group: http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/

MySql commands
http://www.pantz.org/software/mysql/mysqlcommands.html

SQL: Cannot resolve the collation conflict Thursday, Jan 15 2009 

After resolving a @variable table JOIN issues, I was trying to JOIN usernames between two different databases when up pops a big:
Cannot resolve the collation conflict between "Latin1_General_CI_AS_KS_WS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

 

Pinal Dave to the rescue again:
http://blog.sqlauthority.com/2007/06/11/sql-server-cannot-resolve-collation-conflict-for-equal-to-operation/

 

 

Yup, when joining two databases, you may have to use:
COLLATE DATABASE_DEFAULT