views:

41

answers:

0

I can connect to a linked server with this:

SELECT testNo, soruTuruId, soruNo, cevap , degerlendirenTcNo, degerlendirilenTcNo FROM OPENDATASOURCE('SQLOLEDB', 'Data Source=192.168.150.42;User ID=readerUser;Password=1').akreditasyon.dbo.tblPerfCevap

But I have to pass the password as parameter. and I try like this:

SET @connectionString = 'Data Source=192.168.150.42;User ID=readerUser;Password='+@pw

SELECT testNo, soruTuruId, soruNo, cevap , degerlendirenTcNo, degerlendirilenTcNo FROM OPENDATASOURCE('SQLOLEDB', @connectionString ).akreditasyon.dbo.tblPerfCevap

and

SELECT testNo, soruTuruId, soruNo, cevap , degerlendirenTcNo, degerlendirilenTcNo FROM OPENDATASOURCE('SQLOLEDB', 'Data Source=192.168.150.42;User ID=readerUser;Password='+@pw ).akreditasyon.dbo.tblPerfCevap

but didnt work:S

does anyone have an idea?

related questions