Incorrect syntax with OPENDATASOURCE in Sql server -


i stuck @ passing parameter opendatasource , got error message:

msg 102, incorrect syntax near 'sqlncli'

----@connectionstring passing ui

 if exists(select cm.customerid [customer id] cardmaster cm inner join customertail ct             on cm.customerid = ct.customerid             inner join opendatasource(sqlncli, @connectionstring).mercfuelprod.dbo.customer cr              on cm.customerid = cr.custid cm.cardnumber = @cardnumber) -         begin             set @result = 'success'         end     else 

pleas me problem.

you have pass string:

opendatasource('sqlncli'... 

https://msdn.microsoft.com/en-us/library/ms179856.aspx

also have dash before begin keyword...


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -