Forum Replies Created

Viewing 15 posts - 601 through 615 (of 1,473 total)

  • RE: Stored Procedure Metadata

    Here's a test script. You'll notice that it doesn't actually delete any rows when executed with FMTONLY ON.

    USE tempdb

    CREATE TABLE Test( TestIntint)

    INSERT INTO Test(TestInt) SELECT 1

    GO

    CREATE PROCEDURE TestSP

    AS

    DELETE FROM...

  • RE: Stored Procedure Metadata

    Matt Whitfield (9/29/2009)


    with SET FMTONLY, it doesn't do any data changes, just gives you the schema of the result. So passing in any old default value for the parameters will...

  • RE: string concatination

    sql_novice_2007 (9/29/2009)


    Hi Pradeep,

    I need to have a comma between each location. Mark's idea was very close to my requirement .

    Thank you very much for your help.

    Pradeep's method can also use...

  • RE: How do I sum the results of a Select?

    ;WITH Filter AS (

    SELECT TOP 500 Convert(money,SubString(strrow,8,5) amount

    FROM tComments

    where strrow like '%Value:%'

    ORDER BY DateStamp DESC)

    SELECT SUM(Amount) Amount FROM Filter

    Or if you prefer the 2000 version:

    SELECT SUM(Amount) Amount

    FROM (

    SELECT...

  • RE: Execute sql script against multiple db's via Management Studio

    This is what cursors were made for. This is a basic gist because I never remember the exact cursor syntax off the top of my head. (And make it...

  • RE: Nested Case statement

    Need more information. What precisely is your question? What does that query return?

    Also, is there a reason you're converting dates to varchars in your case statements?

  • RE: How do I sum the results of a Select?

    Can you be a little more specific about what 'didn't work' means?

    SELECT SUM(Convert(money,SubString(strrow,8,5)))

    from tComments

    where strrow like '%Value:%'

    should work. If it doesn't, post the error/result.

  • RE: Help writing a SQL

    While updating the view is an interesting addition, it does not necessarily prove anything in regards to the 3 part update. Your examples use only a 2 part update....

  • RE: Help writing a SQL

    I realized after the fact that it might have been a little unclear as to why I didn't believe Barry's solution didn't *beat* the quirky update, as the quirky takes...

  • RE: Help writing a SQL

    Ok, so I had some time back at my machine to test your solution Barry. It comes very close to tying the quirky update, but doesn't *quite* manage it....

  • RE: Help writing a SQL

    Dave Ballantyne (9/28/2009)


    Jeff Moden (9/28/2009)

    Heh... what ordering issues?

    Well , just that on your base table , you dont ( disclaimer More testing needed) need a clustered index in the...

  • RE: Help writing a SQL

    Sorry, I just got back from a cruise to the Bahamas, have been completely unplugged from the world for 4 days now. May take today to 'recover' from my...

  • RE: Dynamic SQL for OpenQuery() in a Table Function

    Is there any reason you have to use openquery instead of just a linked server query?

  • RE: COALESCE question

    SSSolice (9/23/2009)


    SUM(coalesce(Case_Count,0)) ...should return 0 when Case_Count IS NULL. I would try it on a narrow result set without the other aggregate and without the other attributes.

    This is true...

  • RE: Pivot Table in T-SQL 2000

    From your sample data, it looks like you have two issues. The first is how to identify which is the first, second or third color. Not sure if...

Viewing 15 posts - 601 through 615 (of 1,473 total)