Forum Replies Created

Viewing 15 posts - 1,321 through 1,335 (of 5,502 total)

  • RE: Update Column WHEN table1.field_name = table2.field_name WITH table2.field_name_2

    What are you trying to do?

    It seems like you're looking for a join. Maybe something like this?

    --UPDATE dbo.MasterStage

    --SET Client =

    ...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Too much code for this T-SQL

    aaron.reese (7/6/2011)


    unfortunately, the people who wrote the NHS datasets are morons....

    The data gets extracted like this from the source systems in flat file format and loaded to the DW like...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: loops

    kritikamehtani (7/6/2011)


    logic :---

    SELECT @message = queue_message FROM tablename

    WHERE PK= @pk

    IF (@PK is not null and...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Transactions In Stored Procedure

    duplicate post. no replies please.

    Discussion already started here



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: loops

    jasonwi1202 (7/5/2011)


    If you do find yourself stuck in a situation where you need to cycle through every record in a table, here is a good example of how to code...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Pivot Table Help

    Please have a look at the CrossTab article referenced in my signature for a different way to do it.

    If you need additional help, please post table def and sample data...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Another Query help

    I second Johns alternatives and would prefer option 2.

    To be a little more specific regarding the splitter function: search for DelimitedSplit8K.

    The basic concept: shred the comma delimited list into a...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Using SET DATEFIRST 1 (Monday as day 1 )

    pwalter83 (7/4/2011)


    ...

    Thanks, Lutz, I tried but could not work out how to use a calendar date and then storing the same. Do you know if there's another way to do...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Interesting datepart results

    Just check the definitions (straight from BOL):

    ISO_WEEK datepart : ...Each week is associated with the year in which Thursday occurs. ...

    and for DATEPART(week):

    ...When datepart is week (wk, ww) or weekday...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Different Query Requirement

    Here's a slightly different approach:

    select

    col1,

    col2,

    stuff(

    (select ',' + col3

    from @data d2

    where d2.col1=d1.col1 and d2.col2=d1.col2 and d2.col4=d1.col4

    order by col3

    for xml path('')

    ),1,1,'') col3,

    col4

    from...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Transaction Log

    May I kindly ask to stop the discussion at that point?

    I don't see any new (question related) information added since several posts.

    Let's just agree to disagree and move on.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: PLz help to fix the error

    Are you aware the year 2009 did not have a February 29th?



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: PLz help to fix the error

    It seems like you're trying to compare a varchar and a datetime data type.

    Since the datetime data type has a higher precedence than varchar, the varchar value needs to be...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: overhead for declaring a cursor?

    An even more efficient solution might be to replace the c.u.r.s.o.r. *cough* with a set based solution. But we would need much more detailed information to help any further.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • RE: Need variance between current day - previous day

    duplicate post.

    original post including a number of replies.

    @bhargava

    Please don't cross post. Instead of open yet another thread with the very same question it would have been better to provide the...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 15 posts - 1,321 through 1,335 (of 5,502 total)