Hi,
I have the following SP (snippet)
I keep getting the following error
You can see I have highlighted the fact I have included the local default collation on the data being selected and assume the temp table is being created using the default collation.
I am obviously missing something, but can't work it out.
Line 42 is the FROM clause
All help appreciated.
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
I have the following SP (snippet)
Code:
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Set default date
Set @StartDate = coalesce(@StartDate, '2008-01-01')
Set @EndDate = coalesce(@EndDate, Convert(char(10), GetDate(), 121))
-- create members table for joining
CREATE TABLE #members (
Adv_MemNo varchar(15) NOT NULL,
Adviser varchar(101) NOT NULL,
CompanyName varchar(100) NOT NULL,
)
-- populate members table
INSERT INTO #members (Adv_MemNo,Adviser,CompanyName)
SELECT [Membership Number] AS Adv_MemNo, FirstName + ' ' + LastName AS Adviser, CompanyName
FROM [MyServer].[MyDB].[dbo].[Contacts]
WHERE ContactTypeID LIKE @Members + '%' AND CompanyName IS NOT NULL AND
[Membership Number] IS NOT NULL AND FirstName IS NOT NULL AND LastName IS NOT NULL
AND [Membership Number] LIKE 'M00%'
[b]COLLATE DATABASE_DEFAULT[/b];
I keep getting the following error
Msg 468, Level 16, State 9, Procedure sp_MySP, Line 42
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
You can see I have highlighted the fact I have included the local default collation on the data being selected and assume the temp table is being created using the default collation.
I am obviously missing something, but can't work it out.
Line 42 is the FROM clause
All help appreciated.
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music