Forum Replies Created

Viewing 15 posts - 2,086 through 2,100 (of 3,011 total)

  • RE: Help with datetime column

    select distinct *

    from

    tableA

    where

    -- Greater than or equal to yesterday at 00:00:00.000 (midnight)

    h.created >= dateadd(dd,datediff(dd,0,getdate())-1,0)

    -- Less than today at 02:00:00.000 (2am)

    h.created < dateadd(dd,datediff(dd,0,getdate()),'02:00')

  • RE: The Cost of Reboots

    Ross McMicken (1/26/2009)[hr

    From what I've read, this is mostly a call center workers issue. They seem to get the worst of it from all sides - management and customers. That's...

  • RE: How can I convert UTC datetime to local (EST) time

    Sergiy (1/24/2009)


    [created date] + GETDATE() - GETUTCDATE()

    That really only works correctly if the [created date] is from the current date.

    The OP posted an example date of '1/12/2004 7:04 PM'...

  • RE: How can I convert UTC datetime to local (EST) time

    Pat_B (1/24/2009)


    I have a column called [created date ] that is of the datetime data type. This column has the date and time stored in UTC. About 13000 records are...

  • RE: DBA job without experience? Is it possible?

    Anything’s possible, but a DBA job is usually for someone with significant industry experience as a developer, administrator, or both, and usually a BS\BA degree. It’s more of a...

  • RE: Page/Sec seem a little high?

    You really need to look at the type of paging. There are many types of paging that have nothing to do with the page file. They can just...

  • RE: SQL Server Architecture? What's going on behind the scenes?

    Back to the original question, I would speculate there were a lot of possible correct answers, and what the question was really about was probing your level of understanding of...

  • RE: Co-worker Dispute

    The only really valid test is with production levels of data in the tables.

    I have used temp tables for things like this when it prevented SQL Server from choosing a...

  • RE: Why do people need to do this?

    Lynn Pettis (1/21/2009)


    Garadin (1/21/2009)


    Jeff Moden (1/21/2009)


    Garadin (1/20/2009)


    Michael Valentine Jones (1/20/2009)


    In the end, does the reason why really matter?

    We had a meeting where we objected to a project as complete waste...

  • RE: 16 digit unique number

    This code generates 16 character, unique strings increasing in value. There may be gaps in the sequence.

    See my last post for a link to the code for F_NUMERIC_TO_BASE_N .

    declare...

  • RE: 16 digit unique number

    Using the function on the link below, this code will generate a random string that is highly likely to be unique.

    However, the nature of random numbers is that they they...

  • RE: Selecting random

    select top 4

    a.*

    from

    (...query to select top 10, whatever that is...) a

    order by

    newid()

  • RE: Why do people need to do this?

    In the end, does the reason why really matter?

    We had a meeting where we objected to a project as complete waste time and money, and were trying to talk our...

  • RE: Why do people need to do this?

    I had requirements for a datamart application where we had to produce many reports with rankings within various hierarchies. Example: product sales ranked within departments, product categories, regions, stores,...

  • RE: How to find out next business day

    Assuming you have a calendar table with all dates in it:

    select

    NextBusinessDay = min(a.MyDate)

    from

    MyDateTable a

    where

    a.MyDate > @MyStartDateand

    a.MyDayOfWeek not in ('Saturday','Sunday')and

    a.MyHolidayIndicator <> 1

    If you need to load a calendar table, this code...

Viewing 15 posts - 2,086 through 2,100 (of 3,011 total)