Click here to Skip to main content
15,903,012 members
Home / Discussions / Database
   

Database

 
Generalsql structure Pin
Tara1411-Mar-08 21:02
Tara1411-Mar-08 21:02 
GeneralRe: sql structure Pin
andyharman12-Mar-08 0:08
professionalandyharman12-Mar-08 0:08 
GeneralRe: sql structure Pin
Tara1412-Mar-08 7:45
Tara1412-Mar-08 7:45 
GeneralRe: sql structure Pin
Syed Mehroz Alam12-Mar-08 0:17
Syed Mehroz Alam12-Mar-08 0:17 
GeneralRe: sql structure Pin
Tara1412-Mar-08 5:50
Tara1412-Mar-08 5:50 
GeneralRe: sql structure Pin
Tara1412-Mar-08 7:36
Tara1412-Mar-08 7:36 
GeneralPassword Expiry Pin
manowj11-Mar-08 20:24
manowj11-Mar-08 20:24 
GeneralCannot resolve collation conflict for equal to operation. Pin
AlexeiXX311-Mar-08 14:44
AlexeiXX311-Mar-08 14:44 
Thanks for looking

I have this query:
select * from Table1 where field1 in (SELECT Value FROM fnSplitString ('a,b,c', ','))
Ive also tryed casting Value:
select * from Table1 where field1 in (SELECT cast(Value as varchar(50)) FROM fnSplitString ('a,b,c', ','))
Field1 has <database default> as collation and is of type varchar(50)
fnSplitString returns a table, in this case, it would return:
Value
a
b
c
of type varchar
Im getting error: Cannot resolve collation conflict for equal to operation.

And i dont know why
I am able to use this function but using it with integer values:
select * from table where ID in (SELECT Value FROM fnSplitString ('1,2,3', ','))

Ill appeciate any help


Code of the function
<br />
CREATE function dbo.fnSplitString(<br />
	@String varchar (4000),<br />
	@Delimiter varchar (10)<br />
)<br />
returns @ValueTable table ([Value] varchar(4000))<br />
begin<br />
 declare @NextString varchar(100)<br />
 declare @Pos int<br />
 declare @NextPos int<br />
 declare @CommaCheck varchar(1)<br />
 <br />
 --Initialize<br />
 set @NextString = ''<br />
 set @CommaCheck = right(@String,1) <br />
 <br />
 --Check for trailing Comma, if not exists, INSERT<br />
 --if (@CommaCheck <> @Delimiter )<br />
 set @String = @String + @Delimiter<br />
 <br />
 --Get position of first Comma<br />
 set @Pos = charindex(@Delimiter,@String)<br />
 set @NextPos = 1<br />
 <br />
 --Loop while there is still a comma in the String of levels<br />
 while (@pos <>  0)  <br />
 begin<br />
  set @NextString = substring(@String,1,@Pos - 1)<br />
 <br />
  insert into @ValueTable ( [Value]) Values (@NextString)<br />
 <br />
  set @String = substring(@String,@pos +1,len(@String))<br />
  <br />
  set @NextPos = @Pos<br />
  set @pos  = charindex(@Delimiter,@String)<br />
 end<br />
 <br />
 return<br />
end<br />
<br />


Alexei Rodriguez

GeneralRe: Cannot resolve collation conflict for equal to operation. Pin
AlexeiXX311-Mar-08 15:17
AlexeiXX311-Mar-08 15:17 
QuestionProblems Exporting From DataSet to .DBF File Pin
Snaider11-Mar-08 9:00
Snaider11-Mar-08 9:00 
GeneralRe: Problems Exporting From DataSet to .DBF File Pin
perryf_0011-Mar-08 12:12
perryf_0011-Mar-08 12:12 
GeneralRe: Problems Exporting From DataSet to .DBF File Pin
Snaider12-Mar-08 0:18
Snaider12-Mar-08 0:18 
GeneralDataRelation and NOCHECK add constraint Pin
CJacobus11-Mar-08 6:21
CJacobus11-Mar-08 6:21 
GeneralRe: DataRelation and NOCHECK add constraint Pin
Mark J. Miller11-Mar-08 7:28
Mark J. Miller11-Mar-08 7:28 
GeneralRe: DataRelation and NOCHECK add constraint Pin
CJacobus12-Mar-08 11:15
CJacobus12-Mar-08 11:15 
GeneralRe: DataRelation and NOCHECK add constraint Pin
Mark J. Miller13-Mar-08 3:29
Mark J. Miller13-Mar-08 3:29 
QuestionHow can i improve the performance of this query? Pin
tonyong11-Mar-08 4:24
tonyong11-Mar-08 4:24 
AnswerRe: How can i improve the performance of this query? Pin
Scott Dorman11-Mar-08 4:42
professionalScott Dorman11-Mar-08 4:42 
GeneralRe: How can i improve the performance of this query? Pin
tonyong11-Mar-08 4:59
tonyong11-Mar-08 4:59 
GeneralRe: How can i improve the performance of this query? Pin
Scott Dorman11-Mar-08 5:07
professionalScott Dorman11-Mar-08 5:07 
GeneralRe: How can i improve the performance of this query? Pin
tonyong11-Mar-08 5:28
tonyong11-Mar-08 5:28 
GeneralRe: How can i improve the performance of this query? Pin
Pete O'Hanlon11-Mar-08 12:23
mvePete O'Hanlon11-Mar-08 12:23 
GeneralRe: How can i improve the performance of this query? Pin
tonyong12-Mar-08 0:34
tonyong12-Mar-08 0:34 
GeneralRe: How can i improve the performance of this query? Pin
andyharman12-Mar-08 5:19
professionalandyharman12-Mar-08 5:19 
GeneralRe: How can i improve the performance of this query? Pin
tonyong12-Mar-08 14:22
tonyong12-Mar-08 14:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.