Forum Replies Created

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

  • RE: I got burned today at a SQL Server Interview!

    In my interview for my first full time DBA Position, I was bemused with the following; the interviewer, a in-house recruiter from the company where I was applying, said

    "You've...

  • RE: How to lay out SQL Code

    Steve,

    I took your first example and ran though my favorite online formatter and it came out as this:

    select a.name

    ,b.address

    ...

  • RE: Importing The Latest File In A Folder Via DTS

    First, sorry this has taken a while to get back to you and post.

    Second, this is a function taken from a vbs script, but it should work in a DTS...

  • RE: Group by where MAX can be the same

    Yes Chris, that's exactly what I was chasing down. šŸ™‚

    I mean I knew you could do this without a correlated sub-query, but I was struggling to prove...

  • RE: Group by where MAX can be the same

    Mark (2/28/2008)


    Using a different approach

    select X.h_id, X.l_id, X.ton

    from #t1 X

    where not exists (select * from #t1 Y

    ...

  • RE: Group by where MAX can be the same

    Kev (the developer) has come up with this

    select h_id, max(l_id), max(ton)

    from #t1 X

    where ton =

    (

    SELECT MAX(ton)

    from #t1 Y

    WHERE Y.h_id = X.h_id

    )

    group by h_id

  • RE: The Cost of Function Use In A Where Clause

    Jeff Moden (2/28/2008)


    David Jackson (2/28/2008)


    This looks complex but will use your index.

    where CreatedDate between dateadd(dd, datediff(dd,0,Getdate()),0) --midnight TODAY

    and ...

  • RE: The Cost of Function Use In A Where Clause

    This looks complex but will use your index.

    where CreatedDate between dateadd(dd, datediff(dd,0,Getdate()),0) --midnight TODAY

    and dateAdd(ss,-1,dateAdd(dd,1,dateadd(dd, datediff(dd,0,Getdate()),0))) --23:59:59 TODAY...

  • RE: Type A, B, or C

    From a page on my site.

    Personality Tests

    I’m a sucker for these, which no doubt says something about my personality type, (Gullible?), so here are the results of a couple I...

  • RE: Finding the Next Business Day Recursively

    without disagreeing with any of the above, I got bit by having a "list of holidays" table yesterday.

    We have a table, unimaginatively called ms_holiday.

    The structure is similar to

    CREATE TABLE...

  • RE: Importing The Latest File In A Folder Via DTS

    I would do this by iterating through the files collection of the folder object, and moving them after processing into a 'Processed' Folder. Is that possible?

    If none of the...

  • RE: Favorite Book Quote

    Funny, I could remember the opening line, but had to look up the title of the book. šŸ™‚

    The Gun Seller

    by Hugh Laurie (of House M.D. Fame)

    From memory

    "Imagine you...

  • RE: Using WAITFOR and PRINT in a loop does not show any result

    It's not the WAITFOR that is the problem, it's the Print statement.

    Try

    while 0=0

    begin

    raiserror ('Martin',0,1) with nowait

    waitfor delay '00:00:05'

    end

    HTH

    Dave J

  • RE: Problem with Joining to Empty Strings

    Can you not add a where clause (or add to it) ?

    SalesData.dbo.tbl_CYProcessedSales ps

    INNER JOIN SalesData.dbo.vw_Product_CYProcessedSalesXref xr

    ON ps.Prod = xr.Prod

    AND ps.Acct = xr.AcctCode

    INNER JOIN TxnRptg.dbo.vw_NetNewRevenueUnion nn

    ON xr.BillingType = nn.BillingType

    AND xr.ProdGroup =...

  • RE: Updating rows with a join

    Try

    update i

    set i.INV_QTYONORDER = 0

    from inventory i

    full outer join inventory_supplier

    on (i.INV_ID = inventory_supplier.INVSUP_INVID)

    where i.INV_QTYONORDER <> 0

    and inventory_supplier.INVSUP_SUPPNUM = 11

    HTH

    Dave J

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