Created
May 13, 2011 08:11
-
-
Save FilipDeVos/970185 to your computer and use it in GitHub Desktop.
Create Collation safe TempTables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TYPE NameType FROM varchar(50) | |
| CREATE TYPE LocationType FROM varchar(50) | |
| CREATE TABLE MoreRockStars (id int, name NameType, location LocationType) | |
| INSERT INTO MoreRockStars VALUES (1, 'Jeff Buckley', 'Heaven') | |
| INSERT INTO MoreRockStars VALUES (2, 'Neil Young', 'USA') | |
| DECLARE @Name NameType, | |
| @Location LocationType | |
| SELECT @Name as name, @Location as information into #RockStarInfo3 | |
| INSERT INTO #RockStarInfo3 VALUES ('Jeff Buckley', 'Drowned sadly') | |
| INSERT INTO #RockStarInfo3 VALUES ('Neil Young', 'Keeps on rocking') | |
| SELECT * | |
| FROM MoreRockstars s | |
| LEFT JOIN #RockStarInfo3 i | |
| ON s.name = i.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment