Forum Replies Created

Viewing 15 posts - 1,846 through 1,860 (of 3,011 total)

  • RE: sp_dates add this proc to your code collection

    Didn't you leave out a few numbers?

    declare @date datetime

    set @date = getdate()

    select

    convert(varchar(35),@date,a.Code) AS FormattedDate,

    Code = convert(varchar(3),a.Code),

    convert(varchar(40),'select convert(varchar(35),@date,'+convert(varchar(20),a.Code)+')') as [SQL]

    from

    (

    select Code = 0 union all

    select Code = 1 union all

    select Code...

  • RE: Select all tables from all databases using T-SQL

    This will do what you want:

    declare @a nvarchar(max)

    select

    @a = isnull(@a+N' union all ',N'')+

    '

    select [Database] = convert(sysname,'''+a.name+

    '''), [Table] = a.name collate SQL_Latin1_General_CP1_CI_AS from '+

    quotename(a.name)+'.sys.tables...

  • RE: Just Walk Away - Blacklisting - and Twits without Twitter

    Bob Hovious (4/7/2009)


    I had a job interview once where I was asked if I had ever thrown large manuals at people. I thought it was a joke question...

  • RE: Verify my current backup strategy n suggest

    Any backup strategy that does not include getting your database backups to tape is incomplete and a disaster waiting to happen.

    It doesn't have to be database corruption. It could...

  • RE: Query Yesterday's Date

    drodriguez (4/7/2009)


    Thanks! This is what I came up with.

    Let me know what you think.

    WHERE dtStartTimeStamp >= CONVERT(varchar(10),DATEADD(day,-1, GETDATE()),20) + ' 00:00:00.000' AND dtStartTimeStamp <= CONVERT(varchar(10),DATEADD(day,-1, GETDATE()),20) + ' 23:59:59.000'

    I...

  • RE: Verify my current backup strategy n suggest

    Sudiendra (4/7/2009)


    Michael Valentine Jones (4/7/2009)

    We have San replication, so we switched off tape backups..

    Thanks,

    Sudhie.

    That is an extermely bad idea. If your database becomes corrupt, you will have nothing to...

  • RE: Verify my current backup strategy n suggest

    Yes, you will need to restore the transaction log backups created after your last full backup up until the point of time you want to recover to.

    It is no different...

  • RE: Query Yesterday's Date

    This is a better way to code date range queries:

    WHERE

    -- Greater than or equal to 00:00:00.000 yesterday

    dtStartTimeStamp >= '2009-04-06 00:00:00.000' AND

    -- Before 00:00:00.000 today

    dtStartTimeStamp < '2009-04-07 00:00:00.000'

    --Using getdate() to...

  • RE: Verify my current backup strategy n suggest

    Sudiendra (4/7/2009)


    T-Log backup - Every 15 Minutes and Retention Period - 2 Days

    Differential Backup - Every day and Retention Period - 1 day (Until the next Diff backup)

    Full Backup -...

  • RE: Just Walk Away - Blacklisting - and Twits without Twitter

    GilaMonster (4/7/2009)

    Similar thing here. In my country, woman and IT don't usually go in the same sentence. The number of times I've been 'mistaken' for the project manager, the token...

  • RE: Challenging SQL interview questions

    RBarryYoung (4/4/2009)


    Why would our helping you to get a job that you are apparently unqualified for be a good thing?

    That wasn't harsh.

    My first reply on this thread below wasn't harsh...

  • RE: Best way to strip time from datetime stamp.

    I have always found the DATEADD/DATEDIFF method to be the fastest when I tested it.

    I would avoid using FLOOR method for the simple reason that it is an unsupported method...

  • RE: Timestamp to Datetime

    You cannot reset the timestamp generation.

    What you are describing is bug that needs to be fixed. There was never any reason to assume that a timestamp column can be...

  • RE: The T-SQL Paradigm

    YSLGuru (4/6/2009)


    Jason Miller (4/6/2009)


    GSquared (4/3/2009)


    For example, why doesn't this work:

    select Col1, count(*)

    from dbo.MyTable;

    And the follow-up where,

    select Col1, Col2, count(*)

    from dbo.MyTable

    GROUP BY Col1, Col2;

    select Col1, Col2, count(*)

    from dbo.MyTable

    GROUP BY Col2, Col1;

    Are...

  • RE: Is it possible to keep tempdb on a separate disk?

    Yes, you can place the files anywhere you want.

Viewing 15 posts - 1,846 through 1,860 (of 3,011 total)