Forum Replies Created

Viewing 15 posts - 121 through 135 (of 208 total)

  • RE: Twenty tips to write a good stored procedure

    GilaMonster (8/10/2009)


    Sorry, but I'm going to greatly disagree with a number of these 'tips'

    Also, try to avoid IN. While checking the existence of some values, then use EXISTS instead of...

    Random Technical Stuff[/url]

  • RE: Twenty tips to write a good stored procedure

    You say that the following is about to be deprecated as it isn't SQL-92 compliant:

    SELECT * FROM employee e1, employee_dtl e2

    WHERE e1.id = e2.id

    Where did you get this info from?...

    Random Technical Stuff[/url]

  • RE: How to wrap a Recursive CTE in a view?

    Jeff Moden (8/7/2009)


    ... and thanks for making it easy with all the code in your original post. 🙂

    Hey - thank you Jeff! Brilliant... now I'm all set to fix...

    Random Technical Stuff[/url]

  • RE: How to wrap a Recursive CTE in a view?

    Jeff Moden (8/7/2009)


    Bob Hovious (8/7/2009)


    (Walks in and hoses Jeff down with high pressure ice water hose, just prior to meltdown.)

    😉

    BWAA-HAA!!! Man, I probably shouldn't be posting... let's see... I'm...

    Random Technical Stuff[/url]

  • RE: How to wrap a Recursive CTE in a view?

    I got this from http://www.sqlservercentral.com/Forums/FindPost764457.aspx

    But indeed it isn't a recursive CTE! It's just two CTEs, but the second doesn't recurse on the first, it just uses it to derive...

    Random Technical Stuff[/url]

  • RE: how to copy one table data to another table

    Oops... sorry, didn't read that carefully enough.

    Random Technical Stuff[/url]

  • RE: how to copy one table data to another table

    insert into table1

    select * from table2

    You need to be sure that the columns types match on both tables.

    Random Technical Stuff[/url]

  • RE: Using CURSOR

    No need to.

    Just run:

    set @value = 3

    exec dbo.dummystoredprocedure @value

    print @value

    where dummystoredprocedure has some sort of NOP (e.g. select 1).

    You'll see that the value after the exec doesn't change....

    Random Technical Stuff[/url]

  • RE: Using CURSOR

    It doesn't reset to 0 (I'm assuming you mean that you are calling another SP from the first SP, which is then reentering the first SP...).

    If you are concerned...

    Random Technical Stuff[/url]

  • RE: Using CURSOR

    Slick84 (8/6/2009)


    Lynn Pettis (8/4/2009)


    I may have missed it, but you will want to ensure that @RESULT is initialized to zero (0) before you start the update.

    How would you initiliaze the...

    Random Technical Stuff[/url]

  • RE: Using CURSOR

    I'm a bit curious... what was the issue? I know that you can't do a "top 100 per cent" ... "order by ..." statement in a view... is this the...

    Random Technical Stuff[/url]

  • RE: Compatibility issue and CROSS APPLY

    Ummm... good article, but surely as a matter of course you would be careful to check the version being run when using new SQL Server statements? For instance, if you...

    Random Technical Stuff[/url]

  • RE: Curly question I can't work out without cursors!

    Jeff Moden (8/4/2009)


    ta.bu.shi.da.yu (8/3/2009)


    I'm hoping Jeff Modem can help me on this one 🙂

    Heh... thank you for the compliment but, as you can see, I'm not the only show in...

    Random Technical Stuff[/url]

  • RE: Curly question I can't work out without cursors!

    andrewd.smith (8/3/2009)


    WITH StartStop AS (

    SELECT Ref, IsNull(StartStop, 'Start') AS StartStop, theDate

    FROM #TempTable

    )

    SELECT a.Ref, a.theDate AS Start, Min(b.theDate) AS Stop, DateDiff(dd, a.theDate, Min(b.theDate))...

    Random Technical Stuff[/url]

  • RE: Curly question I can't work out without cursors!

    drew.allen (8/3/2009)


    ta.bu.shi.da.yu (8/3/2009)


    I'm thinking that I'll just use a cursor or a while loop. I was thinking of running the query as the select statement in the cursor, then find...

    Random Technical Stuff[/url]

Viewing 15 posts - 121 through 135 (of 208 total)