Wednesday, October 1, 2014

Declaring a list variable in SQL

DECLARE @Vowels TABLE (ColumnName CHAR(1))
INSERT INTO @Vowels VALUES ('a')
INSERT INTO @Vowels VALUES ('e')
INSERT INTO @Vowels VALUES ('i')
INSERT INTO @Vowels VALUES ('o')
INSERT INTO @Vowels VALUES ('u')
INSERT INTO @Vowels VALUES ('y')
INSERT INTO @Vowels VALUES ('å')
INSERT INTO @Vowels VALUES ('ä')
INSERT INTO @Vowels VALUES ('ö')


SELECT ColumnName FROM @Vowels

No comments: