Forum Replies Created

Viewing 15 posts - 1,261 through 1,275 (of 2,894 total)

  • RE: [SQL Server 2005] Problem with ORDER BY clause

    cms9651 (9/6/2012)


    The rule for the sorting is mat geographic NAME.

    MAW = My Area West

    MAE = My Area East

    MAC = My Area Center

    MAS = My Area South

    Oh, why we couldn't see...

  • RE: How to find a Query in all stored procedure

    ... I am stumped on why that is not working...

    Try to read other posts.

    Any solution will be very limited to finding very simple queries and only in case if...

  • RE: [SQL Server 2005] Problem with ORDER BY clause

    ...

    True but as I said there seems to be a bit of clarity needed on what the order should be. The MAT column is not ordered in the desired output.

    then...

  • RE: Deleting duplicate record

    Richard Warr (9/6/2012)


    Approach can also depend on whether this is a one-off repair or something that needs to happen on a regular basis. It's also wise to avoid the following...

  • RE: Order by with case

    Luis Cazares (9/6/2012)


    Using Eugene suggestion (@index is declared int to prevent injection, but might create errors):

    ...

    [/code]

    You don't need to worry about injection here, check this:

    declare @index VARCHAR(100) = 'DROP EVERYTHING...

  • RE: [SQL Server 2005] Problem with ORDER BY clause

    Sean Lange (9/6/2012)


    ...

    This query will produce the same results:

    SELECT

    COALESCE ([MAT], 'Tot') AS [MAT],

    [DVD],

    SUM ([SALES])

    FROM

    TestTable

    GROUP BY

    (MAT),

    [DVD] --with rollup

    ORDER BY

    [DVD] DESC

    ...

    Try to add one more data row:

    INSERT INTO [dbo].[TestTable] ([MAT],...

  • RE: [SQL Server 2005] Problem with ORDER BY clause

    You show in your setup that your table already holds the calculated Total record (looks like it is total per DVD). Then to sort results as you want you need...

  • RE: Deleting duplicate record

    MVDBA (9/6/2012)


    Eugene Elutin (9/6/2012)


    MVDBA (9/6/2012)


    eugene... just out of interest... why avoid the windowing???

    Because using them may be slower then implementation without them...

    hmmm.... yes, but also alternate solutions might use other...

  • RE: Order by with case

    Phil Parkin (9/6/2012)


    mssqlsrv (9/6/2012)


    I think you can not use variable in order by clause.

    Variables are only allowed when ordering by an expression referencing a column name.

    Yeah you can. Just tried...

  • RE: Deleting duplicate record

    I wonder what we are rally discussing here?

    There are many different ways to remove duplicate data. Decision on which one to use will depend on exact situation. Sometimes, you...

  • RE: Deleting duplicate record

    MVDBA (9/6/2012)


    example 2 wont work -you'll end up with a table called demo1 not demo

    Are you serious? :w00t:

    It is just an EXAMPLE 🙂

    So, I've named the table in a second...

  • RE: Deleting duplicate record

    MVDBA (9/6/2012)


    eugene... just out of interest... why avoid the windowing???

    Because using them may be slower then implementation without them...

  • RE: How to find a Query in all stored procedure

    Luis Cazares (9/6/2012)


    IMO, different queries, same result. Just like:

    SELECT CAST(SUBSTRING(CAST(FLOOR(NULLIF(ISNULL(COALESCE(1,NULL),NULL),NULL)) AS CHAR(1)),1,1) AS INT) AS one

    and

    SELECT 1 one

    Very arguable! And not very good example.

    In my case queries are exactly the...

  • RE: How to find a Query in all stored procedure

    Luis Cazares (9/6/2012)


    I would say that those are different queries.

    It's not the same thing to have

    SELECT col1 FROM TableA

    or

    SELECT a.col1 AS mycol FROM TableA a

    Even comments would make a query...

Viewing 15 posts - 1,261 through 1,275 (of 2,894 total)