Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    15

    Question <Tablename> . . <ColumnName>

    Hi,
    What is the difference between
    <Tablename> . . <ColumnName> and <Tablename> . <ColumnName>
    this syntax we are using in Storedprocedures.
    In SQL 2000, <Tablename> . . <ColumnName> is not working

    Eg:
    Tablename =a
    Column Name = b
    Difference between a..b and a.b

    Can anyone let me know.

    TIA,
    Ravi

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,566
    The difference would be that [Table].[Column] works, while [Table]..[Column] doesn't. At least I've never used syntax like that and I don't know of any reason why it would work.

    I think you are getting this confused with table references, which may or may not include the object owner's name.

    The full reference for an object (such as a table) is:
    [Database].[Owner].[Object]

    ...but if the object is in the current database you can simply refer to it as
    [Owner].[Object]

    In either case, you are allowed to omit the owner. SQL Server will search first for an object owned by the current user, and if it cannot find one then it will search for an object that is owned by DBO:
    [Database]..[Object]
    or..
    [Object]
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    14,910
    If you mean that your code refers to something like:
    Code:
    SELECT name FROM master..sysdatabases
    The "master" is a database, the "sysdatabases" is a table, and the ".." implies either your own user or more likely dbo.

    SQL Server has never allowed the use of tablename..columname in any circumstances that I remember.

    -PatP

Posting Permissions

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