June 22, 2010 at 7:35 am
Can I use keywords as column names?
June 22, 2010 at 7:40 am
it is not a great idea but if you abosultley have to then you can do so by eclosing the column name in brackets. for example if you had to name a column select then you could refer to it as
select [select] from table
Dan
If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.
June 22, 2010 at 7:44 am
DECLARE @table AS TABLE(
VARCHAR(10),
[SELECT] VARCHAR(10),
[UPDATE] VARCHAR(10),
[VARCHAR] VARCHAR(10))
DECLARE @cnt INT
--25 rows
SET @cnt=25
WHILE @cnt > 0
BEGIN
SET @cnt=@cnt - 1
INSERT INTO @table
SELECT Upper(LEFT(Newid(), 10)),
Upper(LEFT(Newid(), 10)),
Upper(LEFT(Newid(), 10)),
Upper(LEFT(Newid(), 10))
END
SELECT *
FROM @table
*EDIT*
Dan. . . you ninja'd me :smooooth:
June 22, 2010 at 8:00 am
OK, thanks.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply