Forum Replies Created

Viewing 15 posts - 4,801 through 4,815 (of 5,504 total)

  • RE: Combining Update Statements

    homebrew01 (11/11/2009)


    The original post is much easier to understand. Consider someone looking at or modifying the code a year from now, and the risk of introducing bugs or errors. ...

  • RE: Performance problems with (unnecessary) nested stored procedures

    What is the root cause to have the validation implemented in almost every proc?

    As far as I can see, there should be room for improvement in terms of the frequency...

  • RE: OPENXML problem

    Glad I could help 🙂

    When learning XQuery you should consider looking into the great series of articles by Jacob Sebastian on this site. Search for "XML Workshop".

    His series covers a...

  • RE: OPENXML problem

    I'm not sure how openxml can handle typed xml date (meaning xml data using namespaces).

    However, since you're using SS2K5 or above I strongly recommend to look into XQuery. It is...

  • RE: Combining Update Statements

    I don't recommend dsdeming's solution since it will set all other values for column USER_ORDER_QTY to NULL that don't match the CASE condition!!

    @dsdeming: you might want to change the code...

  • RE: I have a scenario where there are 4 records with same ID. I need to write a code so that i can take only last 3 records

    Look for ROW_NUMBER() in BOL (BooksOnLine, the help system usually installed together with SQL Server).

    It requires an column for sorting. So you have to think what would be the definition...

  • RE: horizontalTo vertical Columns

    Ok, now it makes sense...

    Would have helped a lot if the statement

    SELECT 1,2,3,4,5,6

    had SQL tags around (maybe even with expected output) to look like

    SELECT 1,2,3,4,5,6

    /* result set

    (No column name)(No column...

  • RE: Combine SQL Query together

    Lewis Dowson (11/11/2009)


    lmu92, I agree you could do the same in one query but I find that it is both more maintainable and readable if you use the CTE method....

  • RE: horizontalTo vertical Columns

    The only difference I can see is the word "SELECT" aat the beginning of the output...

    SELECT 'Select '+ stuff((SELECT ', ' + Value From @Temp FOR XML path('')),1,2,'')

    Based on your...

  • RE: Best Practise

    s_shah-977123 (11/10/2009)


    ...the max number of users is 15 per application.

    A decision whether to go for one or more database(s) is much more related to the context to be stored than...

  • RE: Combine SQL Query together

    Why don't you add the WHERE clause to your CASE statement and do all in one query?

    To get the count for each group would be the same as do SUM(CASE...

  • RE: Incorrect syntax near 'xml' - SQL2000

    I'm not sure if it helps to explicit cast the xml result as varchar(8000) or nvarchar(4000).

    Another option could be to put the XML subselect into a separate (temp?) table with...

  • RE: Solving the "Running Total" & "Ordinal Rank" Problems (Rewritten)

    Thanxalot for the effort in (re-)writing this great article Jeff!

    Adding cross-references to several other great articles and the amount of code to support/prove your point makes it not "only" an...

  • RE: horizontalTo vertical Columns

    Usually, a ColToRowConversion of this kind is done using the FOR XML clause:

    SELECT stuff((SELECT ', ' + Value From @Temp FOR XML path('')),1,2,'')

    Using your sample data it will result in...

  • RE: Import XML into a SQL Server 2005 table

    The problem is described pretty clear:

    The system cannot find the path specified

    It looks like you're trying to open a file located on a client PC from a (SQL) server.

    Either you...

Viewing 15 posts - 4,801 through 4,815 (of 5,504 total)