Forum Replies Created

Viewing 15 posts - 1,111 through 1,125 (of 1,228 total)

  • RE: Complex T-SQL query

    lmu92 (3/6/2010)


    @Chris: You're using a CTE? How comes?

    I've been studying your solutions mate - finally saw the light 😛

    You've posted a third method for resolving this job, late on a...

  • RE: Complex T-SQL query

    lmu92 (3/6/2010)


    clive-421796 (3/6/2010)


    Would like to hear from the likes of Jeff Moden, Lynn Pettis, etc. if they have a solution for this.

    I'm by far not at the level of Jeff...

  • RE: Very complex - How to count difference data

    Here's a CROSS APPLY version of Jeff's derived table solution:

    drop TABLE #AAATable

    CREATE TABLE #AAATable(

    [col1] [int] NULL,

    ...

  • RE: TSQL query problems

    There are two distinct stages to this problem, data selection, then transformation. This query makes a start on data selection based on Lutz' suggestion of using ROW_NUMBER():

    DROP table #Accounts

    create table...

  • RE: Subquery in case statement

    vbprogrammer1986 (3/3/2010)


    Can Also Use Top .

    TOP1, preferably with ORDER BY regardless of whether or not the returned values are the same. Just good practice.

  • RE: Subquery in case statement

    Run this part:

    select adminpermission from appadmin where addId=1

    If the returned values are different, then you will have to decide which to use, using MIN()/MAX() or ROW_NUMBER() with OVER() or GROUP...

  • RE: Help with CASE statement in my query

    lmu92 (3/2/2010)


    Why not joining the temp table directly to the query?

    Something like

    SELECT *

    FROM cElements A

    LEFT JOIN sectionList D ON D.sectionID = A.sectionID

    LEFT JOIN fList E ON E.fID...

  • RE: Help with CASE statement in my query

    Magy (3/2/2010)


    It is an ugly query...I know

    In English it would be like:

    Is 2006 in the temp table? Then add this to the query....

    Is 2007 in the temp table? ...

  • RE: Get Similar recordes base on usage and matching criteria

    pritesh-807803 (3/1/2010)


    My input and output values are there in attached excel.

    Pritesh, I know you've provided sample data in a spreadsheet, but I simply don't have the time to turn the...

  • RE: Get Similar recordes base on usage and matching criteria

    pritesh-807803 (3/1/2010)


    Hi Chris,

    My above posted query is wroking fine. I have problem with order by Status.

    I wand distinct CandidateIDs from Candidate and CandidateProject table where i want to give...

  • RE: sp_executesql doesn't pass parameters, exec does

    ma-516002 (2/28/2010)


    Don't know what happened there. I recreated the database and everything works now 🙂 (Gremlins?)

    Well done - but your observation that rebuilding the db solved the problem is almost...

  • RE: sp_executesql doesn't pass parameters, exec does

    ma-516002 (2/28/2010)


    No, your suggested command has the same result as the auto generated one, an empty table.

    This looks like there is something missing to sp_executesql or the target procedure in...

  • RE: sp_executesql doesn't pass parameters, exec does

    ma-516002 (2/28/2010)


    No, your suggested command has the same result as the auto generated one, an empty table.

    This looks like there is something missing to sp_executesql or the target procedure in...

  • RE: sp_executesql doesn't pass parameters, exec does

    ma-516002 (2/28/2010)


    That statement is generated by System.Data.Common.DbCommand, you cannot modify it.

    Thanks for the extra info.

    I think the problem is with setting up the command string in your interface code....

  • RE: sp_executesql doesn't pass parameters, exec does

    ma-516002 (2/28/2010)


    I have a stored procedure which expects a few parameters, all have a default value. The procedure returns a table, that is it ends with SELECT ... FROM. I...

Viewing 15 posts - 1,111 through 1,125 (of 1,228 total)