Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 refer to remote table

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2005-06-01 : 11:25:07
I created linkedserver and want to refer to ID in a table. If I code: remote_server_name.db_name.dbo.table_name.ID, I got error said over maximu prefix.

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-06-01 : 13:36:22
Look up PARSENAME in BOL

Does this work then

SELECT a.OrderID
FROM LinkedServerName.Northwind.dbo.Orders a

Andy

Beauty is in the eyes of the beerholder
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2005-06-01 : 13:54:10
Thank you. Can tell me more detail?
What is mean: Look up PARSENAME in BOL?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-01 : 14:00:20
It means open up SQL Server Books Online. Go to the index tab, type in PARSENAME.

Check out Damian's article for more information as well:
http://www.sqlteam.com/item.asp?ItemID=15044

Tara
Go to Top of Page

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-06-01 : 14:03:10
BOL = Books Online
Start > Programs > Microsoft SQL Server > Books Online

Search for PARSENAME - has its other uses as well (IP addresses)

Snippet from BOL
quote:

Returns the specified part of an object name. Parts of an object that can be retrieved are the object name, owner name, database name, and server name.



Note The PARSENAME function does not indicate whether or not an object by the specified name exists. It just returns the specified piece of the given object name.


Syntax
PARSENAME ( 'object_name' , object_piece )

Arguments
'object_name'

Is the name of the object for which to retrieve the specified object part. object_name is sysname. This parameter is an optionally qualified object name. If all parts of the object name are qualified, this name can consist of four parts: the server name, the database name, the owner name, and the object name.

object_piece

Is the object part to return. object_piece is int, and can have these values.

Value Description
1 Object name
2 Owner name
3 Database name
4 Server name



Andy


Beauty is in the eyes of the beerholder
Go to Top of Page

AndyB13
Aged Yak Warrior

583 Posts

Posted - 2005-06-01 : 14:04:32
Aaaaaahhhhhh!!!
Thats twice today



Beauty is in the eyes of the beerholder
Go to Top of Page
   

- Advertisement -