Forum Replies Created

Viewing 15 posts - 46 through 60 (of 3,010 total)

  • RE: DBA vs Developer

    At least 92,045 terabytes is below the maximum database size of 524,272 terabytes, but you would need to have at least 5,753 files in tempdb at a maximum of 16...

  • RE: Today's Humor..

    GilaMonster (7/31/2014)


    Michael Valentine Jones (7/31/2014)


    The last vendor I had to deal with had an application that required the use of a specific SA password to connect to the database on...

  • RE: series of transactions

    salomon.frid (7/31/2014)


    Thank you Gail

    I am aware of that one, just some people in my shop have told me that is not the preferred way of doing this ...

    😉

    Any alternatives?

    You...

  • RE: Today's Humor..

    As a general rule, vendors have very little knowledge of DBA best practices, so they just toss out some misinterpreted stuff that some junior developer found on some web site...

  • RE: Get next primary key without identity

    This should do what you need.

    Why do you have WAITFOR DELAY '00:00:20' in your sample code?

    declare @NextId_output table ( NextId int not null )

    UPDATE TableIds

    SET

    NextId = NextId + 1

    output

    inserted.NextId...

  • RE: Missing Century in Date

    select [Date] = convert(date,'7/26/29')

    Results:

    Date

    ----------

    2029-07-26

  • RE: Converting Hour and Minute to Decimal

    ba.saidou (7/31/2014)


    Could you provide an example please?

    Thanks,

    An example of what?

    You haven't really explained your problem well enough for anyone to know what you are asking, and you haven't explained the...

  • RE: Converting Hour and Minute to Decimal

    Not sure what decimal you are actually after, but here are some examples of what you might be after.

    select

    a.CurrentDatetime,

    a.CurrentTimeOfDay,

    HourOfDay=

    convert(numeric(18,4),round(datediff(ms,0,a.TimeOfDay)/3600000.000000,4)),

    MinuteOfDay=

    convert(numeric(18,4),round(datediff(ms,0,a.TimeOfDay)/60000.000000,4)),

    SecondOfDay=

    convert(numeric(18,4),round(datediff(ms,0,a.TimeOfDay)/1000.000000,4)),

    MillisecondOfDay=

    datediff(ms,0,a.TimeOfDay)

    from

    (

    selectCurrentDatetime= getdate(),

    CurrentTimeOfDay= convert(time(3),getdate()),

    TimeOfDay= convert(datetime,convert(time,getdate()))

    ) a

    Results:

    CurrentDatetime ...

  • RE: How to keep Canadian and US customers database separate in their country

    ChrisSut (7/25/2014)


    >>>Why do the different databases need to be in two different countries?

    This is a legal requirement, we cannot keep health records of US citizens in Canada or health records...

  • RE: Creating a Test DB from a full backup of Prod

    J.Faehrmann (7/23/2014)


    If you set it to single user mode and some process connects to it before you start the restore, you will find it very difficult to disconnect that user.

    That...

  • RE: Creating a Test DB from a full backup of Prod

    This is a sample of a restore command to use after dropping the restore target database:

    declare @BackupFile nvarchar(500)

    set @BackupFile = '\\MyBackupServer\MyBackupShare\MyBackupFolder\MyTestDBBackup.bak'

    restore database [MyTestDB]

    from disk = @BackupFile

    with

    -- Logical names to...

  • RE: Creating a Test DB from a full backup of Prod

    MrG78 (7/23/2014)


    the ALTER DATABASE....SINGLE_USER method as suggested earlier is a good suggestion. Remember to add the WITH ROLLBACK IMMEDIATE otherwise it will wait for the connection to be closed...

  • RE: Creating a Test DB from a full backup of Prod

    J.Faehrmann (7/23/2014)


    I don't drop it, because I want to keep the old db in case the restore fails 😉

    Bringing it offline and online again to drop the connections is elegant.

    I...

  • RE: Creating a Test DB from a full backup of Prod

    It's simpler if you just drop the test database before starting the restore to prevent it from being in use.

    Example:

    use master;

    -- Set offline to disconnect all users from the database

    alter...

  • RE: Generate script to restore log backups

    Jeff Moden (7/21/2014)


    SQLRNNR (7/21/2014)


    Jeff Moden (7/21/2014)


    Jack Corbett (7/21/2014)


    SQLRNNR (7/21/2014)


    I am a bit surprised this hasn't been asked yet and it seems REALLY important.

    Why do you have 2000 log...

Viewing 15 posts - 46 through 60 (of 3,010 total)