Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

coalsce not working

Status
Not open for further replies.

mflancour

MIS
Apr 23, 2002
379
US
I'm receiving the following error when I attempt to run the query; Implicit conversion of varchar value to varchar cannot be performed because teh collation of the value is unresolved due to a collation conflict.

I've checked the tables and the field types are identical..not sure if that makes a difference or not.
 
Your collations are not the same
change table1 and table2 to the real table names in the where clause
Code:
SELECT TABLE_NAME,COLUMN_NAME,COLLATION_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME IN ('Table1','Table2')
ORDER BY TABLE_NAME,ORDINAL_POSITION

Denis The SQL Menace
SQL blog:
Personal Blog:
 
What are the collations on the fields involved? Sounds like they're out of sync.

Show us your statement and the DDL of pertinent fields.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
SELECT COALESCE (dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode, dbo_Order_Line_Invoice_Grouped2006.StockCode) AS Expr1,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue + dbo_Order_Line_Invoice_Grouped2006.NetSalesValue AS Expr5,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced + dbo_Order_Line_Invoice_Grouped2006.QtyInvoiced AS Expr6,
dbo_Order_Line_Invoice_Grouped2006.QtyInvoiced, dbo_Order_Line_Invoice_Grouped2006.NetSalesValue,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue AS Expr7,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced AS Expr8
FROM dbo.ARTRNDETAILGroupedByCustStcdYearMonth FULL OUTER JOIN
dbo_Order_Line_Invoice_Grouped2006 ON
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode = dbo_Order_Line_Invoice_Grouped2006.StockCode AND
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.Customer = dbo_Order_Line_Invoice_Grouped2006.Customer AND
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Month] = dbo_Order_Line_Invoice_Grouped2006.[Month] AND
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Year] = dbo_Order_Line_Invoice_Grouped2006.[Year] AND
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced = dbo_Order_Line_Invoice_Grouped2006.QtyInvoiced AND
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue = dbo_Order_Line_Invoice_Grouped2006.NetSalesValue
 
SELECT TABLE_NAME,COLUMN_NAME,COLLATION_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME IN ('ARTRNDETAILGroupedByCustStcdYearMonth','Order_Line_Invoice_Grouped2006')
ORDER BY TABLE_NAME,ORDINAL_POSITION

then look at these columns
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode , dbo_Order_Line_Invoice_Grouped2006.StockCode ,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.Customer , dbo_Order_Line_Invoice_Grouped2006.Customer ,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Month] ,dbo_Order_Line_Invoice_Grouped2006.[Month] ,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Year] , dbo_Order_Line_Invoice_Grouped2006.[Year] ,
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced , dbo_Order_Line_Invoice_Grouped2006.QtyInvoiced

dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue = dbo_Order_Line_Invoice_Grouped2006.NetSalesValue

Is the collation the same


Denis The SQL Menace
SQL blog:
Personal Blog:
 
Wow, way out of my comfort zone. :p Well here goes:

dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode,
SQL_Latin1_General_CP1_CI_AS

dbo_Order_Line_Invoice_Grouped2006.StockCode ,
SQL_Latin1_General_CP850_CI_AS
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.Customer ,
SQL_Latin1_General_CP1_CI_AS

dbo_Order_Line_Invoice_Grouped2006.Customer ,
SQL_Latin1_General_CP850_CI_AS
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Month] ,
Null

dbo_Order_Line_Invoice_Grouped2006.[Month] ,
Null
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Year] ,
Null

dbo_Order_Line_Invoice_Grouped2006.[Year] ,
Null
dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced ,
Null

dbo_Order_Line_Invoice_Grouped2006.QtyInvoiced
Null
 
what happens now??
Code:
SELECT     COALESCE (dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode, dbo.Order_Line_Invoice_Grouped2006.StockCode) AS Expr1, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue + dbo.Order_Line_Invoice_Grouped2006.NetSalesValue AS Expr5, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced + dbo.Order_Line_Invoice_Grouped2006.QtyInvoiced AS Expr6, 
                      dbo.Order_Line_Invoice_Grouped2006.QtyInvoiced, dbo.Order_Line_Invoice_Grouped2006.NetSalesValue, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue AS Expr7, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced AS Expr8
FROM         dbo.ARTRNDETAILGroupedByCustStcdYearMonth FULL OUTER JOIN
                      dbo.Order_Line_Invoice_Grouped2006 ON 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode = dbo.Order_Line_Invoice_Grouped2006.StockCode COLLATE  SQL_Latin1_General_CP1_CI_AS AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.Customer = dbo.Order_Line_Invoice_Grouped2006.Customer COLLATE  SQL_Latin1_General_CP1_CI_AS AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Month] = dbo.Order_Line_Invoice_Grouped2006.[Month] AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Year] = dbo.Order_Line_Invoice_Grouped2006.[Year] AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced = dbo.Order_Line_Invoice_Grouped2006.QtyInvoiced AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue = dbo.Order_Line_Invoice_Grouped2006.NetSalesValue

Denis The SQL Menace
SQL blog:
Personal Blog:
 
Looks like they are incompatible

IF (SELECT 'hi there' COLLATE SQL_Latin1_General_CP1_CI_AS)
= (SELECT 'Hi There' COLLATE SQL_Latin1_General_CP850_CI_AS)
PRINT 'Strings are equal'
ELSE
PRINT 'Strings are unequal'

this will throw this error
Server: Msg 449, Level 16, State 1, Line 1
Collation conflict caused by collate clauses with different collation 'SQL_Latin1_General_CP1_CI_AS' and 'SQL_Latin1_General_CP850_CI_AS'.

Denis The SQL Menace
SQL blog:
Personal Blog:
 
I dont understand what the problem is...can you elaborate in lamens terms for me?
 
okay try this, i just did a test on my PC
Code:
SELECT     COALESCE (dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode, dbo.Order_Line_Invoice_Grouped2006.StockCode) AS Expr1, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue + dbo.Order_Line_Invoice_Grouped2006.NetSalesValue AS Expr5, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced + dbo.Order_Line_Invoice_Grouped2006.QtyInvoiced AS Expr6, 
                      dbo.Order_Line_Invoice_Grouped2006.QtyInvoiced, dbo.Order_Line_Invoice_Grouped2006.NetSalesValue, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue AS Expr7, 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced AS Expr8
FROM         dbo.ARTRNDETAILGroupedByCustStcdYearMonth FULL OUTER JOIN
                      dbo.Order_Line_Invoice_Grouped2006 ON 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.StockCode COLLATE  SQL_Latin1_General_CP1_CI_AS = dbo.Order_Line_Invoice_Grouped2006.StockCode COLLATE  SQL_Latin1_General_CP1_CI_AS AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.Customer COLLATE  SQL_Latin1_General_CP1_CI_AS = dbo.Order_Line_Invoice_Grouped2006.Customer COLLATE  SQL_Latin1_General_CP1_CI_AS AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Month] = dbo.Order_Line_Invoice_Grouped2006.[Month] AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.[Year] = dbo.Order_Line_Invoice_Grouped2006.[Year] AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.QtyInvoiced = dbo.Order_Line_Invoice_Grouped2006.QtyInvoiced AND 
                      dbo.ARTRNDETAILGroupedByCustStcdYearMonth.NetSalesValue = dbo.Order_Line_Invoice_Grouped2006.NetSalesValue

Not sure If I missed a column

Denis The SQL Menace
SQL blog:
Personal Blog:
 
mmmm, works for me
run this and let me know what happens
BTW what version of sql server are you running?

Code:
create table Testcollate (Col1 varchar(20) collate SQL_Latin1_General_CP850_CI_AS,
Col2 varchar(20) collate SQL_Latin1_General_CP1_CI_AS)
insert into Testcollate values('hello','Hello')

--will fail
select * from Testcollate t1 join Testcollate t2 on t1.col1 =t2.col2


--success
select * from Testcollate t1 join Testcollate t2 on t1.col1 =t2.col2 collate SQL_Latin1_General_CP850_CI_AS
--success
select * from Testcollate t1 join Testcollate t2 on t1.col1  collate SQL_Latin1_General_CP1_CI_AS =t2.col2

Denis The SQL Menace
SQL blog:
Personal Blog:
 
Thank you sooo much for all your help... I'm afraid I will need to creat a work around (create a table with the results of one of the queries) for now as I need to get this report out for tomorrow. If I have time, I'll revisit this and try to figure it out.
 
As SQLDenis said...what version of SQL Server do you have?

Run this and let us know the result:
Code:
SELECT ServerProperty('Edition'),
       ServerProperty('ProductLevel'),
       ServerProperty('ProductVersion')

-SQLBill

Posting advice: FAQ481-4875
 
That is the 'out of the box' version. You should be having problems. There are SOOOOOOOO many bugs with 194. Go to Microsoft's web site, search for SQL Server SP3a, download it and apply it NOW.

That might solve your problem.

BTW-you are very vulnerable to the SLAMMER worm that targets SQL Server. SP3a was the patch that protected against it.

-SQLBill

Posting advice: FAQ481-4875
 
Hi again Denis, thanks for sending me to this thread.
I think this thread was the one which triggered me to contact you.

The thing is, I know a little about T-SQl, but not that much. So, I've got this stored procedure, someone else made and I tried to modify it.

I originally did this (sorry for the amount of code):


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER procedure [dbo].[ListSearchZMVoorzieningen]

@CSVInstellingID varchar(1000) = '',
@InstellingNaam varchar(25) = '',
@PlaatsNaam varchar(25) = '',
@SorteerKolom varchar(25) = '',
@SorteerVolgorde varchar(4) = '',
@NetwerkID int = Null,
@InstellingSoortCatWeergave int = 1

as
begin
set nocount on

IF @NetwerkID = -1
BEGIN
select
pr.ProductID as ProductID,
pd.ProductDetailsAantalPlaatsen as AantalPlaatsen,
pd.ProductDetailsAantalPlaatsenVrij as PlaatsenVrij,
st.InstellingSoortNaam as InstellingSoort,
bi.BasisIndelingNaam as BasisIndeling,
lo.LocatieBezoekPlaatsnaam as Plaats,
i.InstellingNaam as InstellingNaam,
lo.LocatiehoofdNetwerkid as Netwerkid
from
ZMProduct pr
inner join ZMInstellingSoort st on (pr.ProductInstellingSoortID = st.InstellingSoortID)
inner join ZMBasisIndeling bi on (pr.ProductBasisIndelingID = bi.BasisIndelingID)
inner join ZMLocatie lo on (pr.ProductLocatieID = lo.LocatieID)
left join ZMProductDetails pd on (pr.ProductProductDetailsID = pd.ProductDetailsID)
inner join ZMInstelling i on (lo.LocatieInstellingID = i.InstellingID)
where
pr.ProductPublicatieStatus = 1
and st.InstellingSoortCategorie = @InstellingSoortCatWeergave
and ((@CSVInstellingID = '') or (st.InstellingSoortID in (Select convert(int,Value) from dbo.Split(@CSVInstellingID,','))))
and ((@InstellingNaam = '') or (i.InstellingNaam like '%' + @InstellingNaam + '%'))
and ((@PlaatsNaam = '') or (lo.LocatieBezoekPlaatsnaam like '%' + @PlaatsNaam + '%'))

order by

case @SorteerVolgorde
when 'DESC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
end
end DESC,
case @SorteerVolgorde
when 'DESC' then
case @SorteerKolom
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end DESC,

case @SorteerVolgorde
when 'ASC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
end
end ASC,
case @SorteerVolgorde
when 'ASC' then
case @SorteerKolom
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end ASC
end
ELSE
BEGIN
select
pr.ProductID as ProductID,
pd.ProductDetailsAantalPlaatsen as AantalPlaatsen,
pd.ProductDetailsAantalPlaatsenVrij as PlaatsenVrij,
st.InstellingSoortNaam as InstellingSoort,
bi.BasisIndelingNaam as BasisIndeling,
lo.LocatieBezoekPlaatsnaam as Plaats,
i.InstellingNaam as InstellingNaam,
lo.LocatiehoofdNetwerkid as Netwerkid
from
ZMProduct pr
inner join ZMInstellingSoort st on (pr.ProductInstellingSoortID = st.InstellingSoortID)
inner join ZMBasisIndeling bi on (pr.ProductBasisIndelingID = bi.BasisIndelingID)
inner join ZMLocatie lo on (pr.ProductLocatieID = lo.LocatieID)
left join ZMProductDetails pd on (pr.ProductProductDetailsID = pd.ProductDetailsID)
inner join ZMInstelling i on (lo.LocatieInstellingID = i.InstellingID)

where
pr.ProductPublicatieStatus = 1
and st.InstellingSoortCategorie = @InstellingSoortCatWeergave
and ((@CSVInstellingID = '') or (st.InstellingSoortID in (Select convert(int,Value) from dbo.Split(@CSVInstellingID,','))))
and ((@InstellingNaam = '') or (i.InstellingNaam like '%' + @InstellingNaam + '%'))
and ((@PlaatsNaam = '') or (lo.LocatieBezoekPlaatsnaam like '%' + @PlaatsNaam + '%'))
and ((lo.LocatiehoofdNetwerkid = @NetwerkID) or EXISTS (select * from ZMNetwerkPZProduct Where ZMNetwerkPZProduct.ProductID = pr.ProductID AND ZMNetwerkPZProduct.NetwerkPZID = @netwerkid))
order by

case @SorteerVolgorde
when 'DESC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
end
end DESC,
case @SorteerVolgorde
when 'DESC' then
case @SorteerKolom
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end DESC,

case @SorteerVolgorde
when 'ASC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
end
end ASC,
case @SorteerVolgorde
when 'ASC' then
case @SorteerKolom
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end ASC
END

end
GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO


Now at the front end of the website, when I try to sort on Plaatsnaam, it would give an error:

"Conversion failed when converting the varchar value 'Breda' to data type int."

So I figured the SP should be:


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER procedure [dbo].[ListSearchZMVoorzieningen]

@CSVInstellingID varchar(1000) = '',
@InstellingNaam varchar(25) = '',
@PlaatsNaam varchar(25) = '',
@SorteerKolom varchar(25) = '',
@SorteerVolgorde varchar(4) = '',
@NetwerkID int = Null,
@InstellingSoortCatWeergave int = 1

as
begin
set nocount on

IF @NetwerkID = -1
BEGIN
select
pr.ProductID as ProductID,
pd.ProductDetailsAantalPlaatsen as AantalPlaatsen,
pd.ProductDetailsAantalPlaatsenVrij as PlaatsenVrij,
st.InstellingSoortNaam as InstellingSoort,
bi.BasisIndelingNaam as BasisIndeling,
lo.LocatieBezoekPlaatsnaam as Plaats,
i.InstellingNaam as InstellingNaam,
lo.LocatiehoofdNetwerkid as Netwerkid
from
ZMProduct pr
inner join ZMInstellingSoort st on (pr.ProductInstellingSoortID = st.InstellingSoortID)
inner join ZMBasisIndeling bi on (pr.ProductBasisIndelingID = bi.BasisIndelingID)
inner join ZMLocatie lo on (pr.ProductLocatieID = lo.LocatieID)
left join ZMProductDetails pd on (pr.ProductProductDetailsID = pd.ProductDetailsID)
inner join ZMInstelling i on (lo.LocatieInstellingID = i.InstellingID)
where
pr.ProductPublicatieStatus = 1
and st.InstellingSoortCategorie = @InstellingSoortCatWeergave
and ((@CSVInstellingID = '') or (st.InstellingSoortID in (Select convert(int,Value) from dbo.Split(@CSVInstellingID,','))))
and ((@InstellingNaam = '') or (i.InstellingNaam like '%' + @InstellingNaam + '%'))
and ((@PlaatsNaam = '') or (lo.LocatieBezoekPlaatsnaam like '%' + @PlaatsNaam + '%'))

order by

case @SorteerVolgorde
when 'DESC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
end
end DESC,
case @SorteerVolgorde
when 'DESC' then
case @SorteerKolom
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end DESC,

case @SorteerVolgorde
when 'ASC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
end
end ASC,
case @SorteerVolgorde
when 'ASC' then
case @SorteerKolom
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end ASC
end
ELSE
BEGIN
select
pr.ProductID as ProductID,
pd.ProductDetailsAantalPlaatsen as AantalPlaatsen,
pd.ProductDetailsAantalPlaatsenVrij as PlaatsenVrij,
st.InstellingSoortNaam as InstellingSoort,
bi.BasisIndelingNaam as BasisIndeling,
lo.LocatieBezoekPlaatsnaam as Plaats,
i.InstellingNaam as InstellingNaam,
lo.LocatiehoofdNetwerkid as Netwerkid
from
ZMProduct pr
inner join ZMInstellingSoort st on (pr.ProductInstellingSoortID = st.InstellingSoortID)
inner join ZMBasisIndeling bi on (pr.ProductBasisIndelingID = bi.BasisIndelingID)
inner join ZMLocatie lo on (pr.ProductLocatieID = lo.LocatieID)
left join ZMProductDetails pd on (pr.ProductProductDetailsID = pd.ProductDetailsID)
inner join ZMInstelling i on (lo.LocatieInstellingID = i.InstellingID)

where
pr.ProductPublicatieStatus = 1
and st.InstellingSoortCategorie = @InstellingSoortCatWeergave
and ((@CSVInstellingID = '') or (st.InstellingSoortID in (Select convert(int,Value) from dbo.Split(@CSVInstellingID,','))))
and ((@InstellingNaam = '') or (i.InstellingNaam like '%' + @InstellingNaam + '%'))
and ((@PlaatsNaam = '') or (lo.LocatieBezoekPlaatsnaam like '%' + @PlaatsNaam + '%'))
and ((lo.LocatiehoofdNetwerkid = @NetwerkID) or EXISTS (select * from ZMNetwerkPZProduct Where ZMNetwerkPZProduct.ProductID = pr.ProductID AND ZMNetwerkPZProduct.NetwerkPZID = @netwerkid))
order by

case @SorteerVolgorde
when 'DESC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
end
end DESC,
case @SorteerVolgorde
when 'DESC' then
case @SorteerKolom
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end DESC,

case @SorteerVolgorde
when 'ASC' then

case @SorteerKolom
when 'INSTELLING' then i.InstellingNaam
when 'INSTELLINGSOORT' then st.InstellingSoortNaam
when 'PLAATSNAAM' then lo.LocatieBezoekPlaatsnaam
end
end ASC,
case @SorteerVolgorde
when 'ASC' then
case @SorteerKolom
when 'AANTALPLAATSEN' then pd.ProductDetailsAantalPlaatsen
when 'PLAATSENVRIJ'then pd.ProductDetailsAantalPlaatsenVrij
end
end ASC
END

end
GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO


But then when I try to run this, SQL Server says:

Msg 457, Level 16, State 1, Procedure ListSearchZMVoorzieningen, Line 18
Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.

Line 18 is:

begin




So since my t-sql is no good, can someone please try and explain what this all means....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top