Forum Replies Created

Viewing 15 posts - 256 through 270 (of 1,082 total)

  • RE: Multi Column Sort

    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 ...

  • RE: SQL query Problem

    oh and why do you have an order by if you doing a count?

  • RE: SQL query Problem

    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

  • RE: How to write this SELECT better

    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...

  • RE: How to write this SELECT better

    have you tried removing the correlated subqueries as Chris mentioned?

  • RE: Querying the view

    could you show us your code please 🙂

    And perhaps the execution plan for both queries

  • RE: IO Statistics

    what would you like to know about IO statistics?

  • RE: Problem sending messages

    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

  • RE: Problem with Dynamic SQL

    Excellent stuff 🙂

  • RE: SELECT TOP 100 based on sub query

    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...

  • RE: Problem with Dynamic SQL

    what is the value of the table name that you passing in?

  • RE: Problem with Dynamic SQL

    If I change the VARCHAR to NVARCHAR and run the code there are no problems?

    can you confirm?

  • RE: Problem with Dynamic SQL

    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

  • RE: Problem with Dynamic SQL

    ok there goes the concat solution, as you can't concat with sp_executeSQL

  • RE: Problem with Dynamic SQL

    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...

Viewing 15 posts - 256 through 270 (of 1,082 total)