Forum Replies Created

Viewing 15 posts - 166 through 180 (of 532 total)

  • RE: How to extract a values from the table

    It's really surprising to me that so many people are suggesting "solutions" based on such an incredibly flawed design. I understand that sometimes you just need to get things...

  • RE: Tall and skinny to short and fat

    Steve, I would highly suggest that you read Jeff Moden's article on pivots and crosstabs[/url], especially the section on performance at the end. If you're not only using a...

  • RE: How to extract a values from the table

    Having a table with a column of comma delimited values is very poor design. It really goes against the whole purpose of using a relational database.

    The table should be...

  • RE: I need to create a function that returns a date 6 months from getutc date

    If you literally want exactly +6 months (including the hh:mm:ss) then ...

    select DATEADD(mm, 6, GETUTCDATE())

    Otherwise (if you just want the mm/dd/yy) then ..

    select DATEADD(mm, 6, DATEADD(dd, DATEDIFF(dd, 0, GETUTCDATE()), 0))

  • RE: Tall and skinny to short and fat

    I generated some data to use as a test ...

    CREATE TABLE #TEST

    (recIDINT PRIMARY KEY

    ,theKeyVARCHAR(10)

    ,theYearINT

    ,theValue INT)

    INSERT INTO #TEST

    SELECT 1,'key 2',1934,50 UNION ALL

    SELECT 2,'key 2',1935,30 UNION ALL

    SELECT 3,'key 2',1936,96 UNION ALL

    SELECT 4,'key...

  • RE: Select an ID that matches data from mutiple rows

    It's unclear from your post what your actual tables are and what your expected output is. Please see the link in my signature for information on how to post...

  • RE: Complex SQL 2005 Query Help Needed

    Not sure that I exactly understand the question but take a look at this and see if it answers any part of your question ...

    DECLARE

    @n_TicketNoint,

    @vc_Type varchar(1), --debit/credit

    @vc_Entity varchar(10),

    @d_Amount decimal(10,2))

    --set variable...

  • RE: How to write an elegant query to get top users

    Generally, my understanding is that it's better for performance to avoid UDF's and just do it inline:

    SELECT u.ID,

    Count(1) as Total, u.FirstName + ' ' + u.LastName as [Name],

    convert(varchar(13),e.CreatedOn,120) + ':00:00'...

  • RE: Query to Find Birthday using Index Seek

    Rob Schripsema (7/29/2010)


    I assume that "birthday" means just month and day, so my first thought is to add a computed column that just extracts the month and day in 'mmdd'...

  • RE: Are the posted questions getting worse?

    Kit G (7/28/2010)


    The question of what reality is is actually easily answered. Reality is what we agree it is. Change our agreement, change our reality.

    Well this is the...

  • RE: how to update millions of records quickly........

    gah (7/28/2010)


    update statement required somewhere?

    The OP said

    "Now the requirement is that when I get this whole data from Source, have to update all the indicator records where indicator =00000".

    To...

  • RE: Creating Counts

    You can also just use

    SELECT visitor_cnt,

    ROW_NUMBER() OVER (PARTITION BY visitor_cnt ORDER BY visitor_cnt) AS grp_seq_nbr

    FROM @Visitors

  • RE: how to update millions of records quickly........

    Wasn't trying to be overly critical ... just pointing out that the quirky update method isn't used for it's efficiency, it's used for when a regular set based approach won't...

  • RE: Talking baseball

    Ray K (7/26/2010)


    So, with the non-waiver trade deadline looming, here are some questions to contemplate.

    • Does the Dan Haren trade help the Angels down the stretch?
    • What needs do you foresee for...

  • RE: Are the posted questions getting worse?

    Never been a Dicaprio fan myself but his latest films have been pretty solid ... Blood Diamond, The Departed (wow), Body of Lies and now Inception ... all very different...

  • Viewing 15 posts - 166 through 180 (of 532 total)