Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_addlinkedserver from MS SQL 2000 to Sybase

Status
Not open for further replies.

AceFM

Programmer
Jun 16, 2008
10
US
I am running into an issue trying to link from MS SQL 2000 to Sybase. I run the sp_addlinkedserver, which appears to work successfully:

exec sp_addlinkedserver @server='test',
@srvproduct = '',
@provider = 'msdasql',
@datasrc = 'Data Source=mySrc;UserID=usrID;Password=pwd',
@location = null,
@provstr = '',
@catalog = null
exec sp_addlinkedsrvlogin 'test','true',NULL,userid,pwd

But when I try to query the db:

select top 10 * from [test].mydb.dbo.mytable

I get the following error:

OLE DB provider 'msdasql' reported an error.
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Data source name too long]

I have searched the forum and the online help, and am coming up blank. Any thoughts?
 
Shouldn't the datasource simply be the name of the DSN you use to connect to the Sybase DB? The information you have in the Data Source field appears to be the provider string.

Phil H.
Some Bank
-----------
Time's fun when you're having flies.
 
Thanks, philhege for pointing that out. I've used opendatasource mostly in the past, and just grabbed the data source string from that, and was mis-reading the error message I got when I tried to run a query against the linkedserver.

I did get it to work finally:

exec sp_addlinkedserver @server='test',
@srvproduct = 'Sybase',
@provider = 'msdasql',
@datasrc = 'Test_Syngo',
@location = null,
@provstr = '',
@catalog = ''

exec sp_addlinkedsrvlogin 'test','false',null,userid,pwd

Thanks for helping me get past the mental block.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top