Results 1 to 6 of 6

Thread: Dummy Table?

  1. #1
    Join Date
    Jan 2004
    Posts
    7

    Unanswered: Dummy Table?

    Hi!

    I'm new in SQL SERVER 2000 and i'm looking for some kind of predefined dummy table. You know something like the "dual"-Table in Oracle. I want to use it for queries like that:

    Select 1, 'auto' from dummy_table

    Does anyone know, if something like that in SQL SERVER 2000 exists?

    Nick

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523

    Re: Dummy Table?

    Originally posted by nick792
    Hi!

    I'm new in SQL SERVER 2000 and i'm looking for some kind of predefined dummy table. You know something like the "dual"-Table in Oracle. I want to use it for queries like that:

    Select 1, 'auto' from dummy_table

    Does anyone know, if something like that in SQL SERVER 2000 exists?

    Nick
    There is no dummy table in sql server.
    you can just use
    select 1,'auto'
    it will select 1 and the literal 'auto'
    what is 'auto'?
    regards,
    harshal.

  3. #3
    Join Date
    Jul 2003
    Location
    Penang, Malaysia
    Posts
    212
    U don't have to mention the "from dummytable" part.

    Just
    "select '123' " would be fine in SQL Server, as opposite to Oracle
    where u need to have it as
    "select '123' from dual"
    Patrick Chua
    LBMS ( Learn By My Self) NPQ ( No paper Qualification )

  4. #4
    Join Date
    Jan 2004
    Posts
    7

    Re: Dummy Table?

    Thanks!
    It works!

    "auto" is german for "car"!

    Nick

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I was wondering...Oracle, DB2, ect all have this 1 Row system table so you can do like sql server does, but without the FROM clause...

    The question is...does ANSI consider this a "malformed" query syntax without the FROM?

    Just curious.
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    seems to me i've heard someone say that the FROM clause is not required in some recent sql standard, however, when i test a sample query in the various sql versions of the Mimer SQL Validator, they all come back with an error
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •