If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > <Tablename> . . <ColumnName>

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
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
Reply With Quote
  #2 (permalink)  
Old
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 12,556
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
Reply With Quote
  #3 (permalink)  
Old
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 14,744
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On