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.
| Author |
Topic |
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2006-05-19 : 09:59:23
|
I get the following error message when I run the sp below. How do I set these connections please ? Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS> options> to be set for the connection. This ensures consistent query> semantics.> Enable these options and then reissue your query.Here's the spCREATE Procedure [dbo].[spRMU_GetUserPCCCore]@strSurname nvarchar (100),@strFirstname numericasSelect *, EmpFirstname + ' ' + EmpSurname as FNamefrom OPENDATASOURCE('SQLOLEDB','User ID=PCCCOREUser;Password=pccc0re').PCCCore.[dbo].vweEmpDetailswhere EmpSurname Like '%'+ @strSurname +'%' andEmpFirstname like '%'+@strFirstname+'%'GO |
|
|
Nitu
Yak Posting Veteran
81 Posts |
Posted - 2006-05-19 : 10:03:59
|
| set ansi_nulls onset ansi_warnings on |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2006-05-19 : 10:05:22
|
| How do I do that ? In the sp or in Query Analyser or in some settings somewhere ? |
 |
|
|
Nitu
Yak Posting Veteran
81 Posts |
Posted - 2006-05-19 : 10:15:52
|
| You can just add these lines to your sp (after the begin). |
 |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2006-05-19 : 10:18:40
|
| I now have this and I get same errorCREATE Procedure [dbo].[spRMU_GetUserPCCCore]@strSurname nvarchar (100),@strFirstname numericasset ansi_nulls onset ansi_warnings onSelect *, EmpFirstname + ' ' + EmpSurname as FNamefrom OPENDATASOURCE('SQLOLEDB','User ID=PCCCOREUser;Password=pccc0re').PCCCore.[dbo].vweEmpDetailswhere EmpSurname Like '%'+ @strSurname +'%' andEmpFirstname like '%'+@strFirstname+'%'GO |
 |
|
|
Nitu
Yak Posting Veteran
81 Posts |
|
|
Pinto
Aged Yak Warrior
590 Posts |
Posted - 2006-05-19 : 10:38:13
|
| Thank you for your help - you knew a lot more than I did ! Nobody else answered so it may not be any easy answer ! |
 |
|
|
|
|
|