Hello Experts,
I have a problem with OPENROWSET:
exec('
select x.*,getdate() as datum
from openrowset(''SQLOLEDB'',''SERVER1'';''user'';''pw'',''
select anr,alist,aidnr,
(select sum(bpstueck) from nachschau.dbo.bestkp where bpbeltyp=''B'' and bpidnr=mlidnr)
from main.dbo.table1
left join main.dbo.table2 on lfdnr=aidnr
'') as x
')
I get the error:
wrong syntax near 'B'
Please Help
I have a problem with OPENROWSET:
exec('
select x.*,getdate() as datum
from openrowset(''SQLOLEDB'',''SERVER1'';''user'';''pw'',''
select anr,alist,aidnr,
(select sum(bpstueck) from nachschau.dbo.bestkp where bpbeltyp=''B'' and bpidnr=mlidnr)
from main.dbo.table1
left join main.dbo.table2 on lfdnr=aidnr
'') as x
')
I get the error:
wrong syntax near 'B'
Please Help