question

Oleg avatar image
Oleg asked

Invalid use of keyword dummy

This question has been occasionally bothering me for more than 10 years, and I still don't know the answer to it. Once upon a time (back in the good old days of last millennium) I was trying to test a solution to a problem, and typed something like this on a hurry: create proc dummy as begin -- the body of the proc with some valid syntax end go To my surprise, I received the following greeting from the SQL-Server 7 parser: > Invalid use of keyword dummy Intrigued, I searched the BOL and the web hoping to find some information about the purpose of the aforementioned keyword, but could not find anything. There were some paranoid posts about some hidden meaning of **dummy** due to existence of some mysterious hidden table in SQL Server 7 similar in its design to the dual table in Oracle which I believe is designed as create table dual (dummy varchar2(1) not null); insert into dual (dummy) values ('X'); commit; but those posts did not make any sense. I know that **dummy** is no longer a keyword as it is possible to create a procedure named **dummy** in any version of SQL Server starting from 2000, but I still would love to find out what did it mean back then.
historysql-7
5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image Fatherjack ♦♦ commented ·
+1 from the Miss Marple in me that likes this kind of thing :)
1 Like 1 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
Uh, wow... Let me check. I have a resource that might know this. I'll get back to you if I get anything.
0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
@Fatherjack Ditto. But whose portrayal of Miss Marple?
0 Likes 0 ·
Mark avatar image Mark commented ·
So you can't use a "dummy" procedure, you'll have to create a dummy for your dummy! :-D
0 Likes 0 ·
Oleg avatar image Oleg commented ·
@Mark No, I cannot use a "dummy" procedure. As a matter of fact the first time I saw
Invalid use of keyword dummy
message was the last time when I attempted to do it. On the unrelated note, your vote was the one which moved me over 3k lelel :) Thank you.
0 Likes 0 ·

1 Answer

·
Scot Hauder avatar image
Scot Hauder answered
I think you are right. I believe Dummy or sys.Dummy has its roots in Sybase and is similar to the Dual table to return scalar or non-table results. My guess is this is a vestige from Sybase that leached over into the early MS SQL product.
5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sp_lock avatar image sp_lock commented ·
Found it on MSDN under reserved keywords ... http://msdn.microsoft.com/en-us/library/aa238507%28SQL.80%29.aspx
0 Likes 0 ·
Oleg avatar image Oleg commented ·
@Scot Hauder This makes so much sense, thank you very much for your help. SQL Server originally started as a venture between Sybase amd Microsoft, and I remember reading an article stating that when SQL Server 7 was released, it was considered that the last line of Sybase code was finally yanked out of the product, and that SQL Server 7 is indeed all-Microsoft. They even had developers party to celebrate the occasion. Perhaps it was not the case about the last line of Sybase code until some later service pack :( I remember not able to recreate the error message after (I think SP 2) of SQL Server.
0 Likes 0 ·
Oleg avatar image Oleg commented ·
@Jonlee Lockwood I have read reserved keywords list, but it made the matters even worth: the keyword is there but its purpose is unknown :(
0 Likes 0 ·
Oleg avatar image Oleg commented ·
@Matt Whitfield Thank you so much, this was the reference I was looking for but could never find. I wish I fugured out earlier that logging to this site and asking for help is what it takes when stumped :)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.