Viewing 15 posts - 256 through 270 (of 1,082 total)
Am I correct in saying the values need to stay in the same rows?
or could I sort this sample as follows:
Sample
Col1 Col2 Col3
9 ...
April 9, 2009 at 2:01 am
oh and why do you have an order by if you doing a count?
April 3, 2009 at 10:16 am
try this
select @Filas = count(*)
from
VariablePromedio B,dbo.Homologacion H
where B.IDVariableProm = H.IDPagoVariable
and SUBSTRING (convert(varchar(20), H.IDEmpresa) , 4 , 1 ) = '4'
and H.IDOcupacion = 1
and B.SalOtrasNoPetroleras <> 0
ORDER BY SalOtrasNoPetroleras
April 3, 2009 at 10:15 am
I've taken out the correlated queries how does it run now?
SELECT u.USERID,
(CASE WHEN e.ISACTIVE = 1 THEN 'Active' ELSE 'Inactive' END) AS STATUS,
(CASE WHEN e.OPTOUT = 1 THEN...
April 3, 2009 at 9:27 am
have you tried removing the correlated subqueries as Chris mentioned?
April 3, 2009 at 9:16 am
could you show us your code please 🙂
And perhaps the execution plan for both queries
March 30, 2009 at 3:28 am
All seems to be working now.
I was getting an error, but it seems that the messges actually ended up going through 🙂
Thanks again guys
March 26, 2009 at 4:31 am
try this:
Subqueries in a select can only return one result, you could use a correlated sub-query not sure how that would perform , but here is a another solution:
SELECT TOP...
March 24, 2009 at 9:08 am
what is the value of the table name that you passing in?
March 24, 2009 at 8:59 am
If I change the VARCHAR to NVARCHAR and run the code there are no problems?
can you confirm?
March 24, 2009 at 8:51 am
I thought your problem was in SQL 2000? as there is no VARCHAR(MAX) in 2000
ALSO if you USE sp_executeSQL you must use a NVARCHAR
I'll work on a solution now
March 24, 2009 at 8:49 am
ok there goes the concat solution, as you can't concat with sp_executeSQL
March 24, 2009 at 8:48 am
arr.nagaraj (3/24/2009)
@ Christopher,exec takes the param nvarhcar which can have max 4000.
So no matter how many '+' u do if ur total is gretaer than 4000 it doesnt work..
I...
March 24, 2009 at 8:36 am
Viewing 15 posts - 256 through 270 (of 1,082 total)