Skip to content

Instantly share code, notes, and snippets.

@FilipDeVos
Created May 13, 2011 08:01
Show Gist options
  • Select an option

  • Save FilipDeVos/970174 to your computer and use it in GitHub Desktop.

Select an option

Save FilipDeVos/970174 to your computer and use it in GitHub Desktop.
Create Collation safe TempTables
SELECT cast(null as varchar(50)) as name, cast(null as varchar(400)) as information
INTO #RockStarInfo2
WHERE 1=2
INSERT INTO #RockStarInfo2 VALUES ('Mick Jagger', 'Alive and kicking')
INSERT INTO #RockStarInfo2 VALUES ('Jim Morrison', 'Passed away')
SELECT *
FROM Rockstars s
LEFT JOIN #RockStarInfo2 i
ON s.name = i.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment