Forum Replies Created

Viewing 15 posts - 676 through 690 (of 3,011 total)

  • RE: selecting only hour and minute from datetime.

    Lowell (12/9/2011)


    this trick of adding the # minutes to the minimum sql date will trucate to the last minute that occurred:

    select DATEADD(minute, DATEDIFF(minute,0,getdate()), 0)

    Your code works, provided the date is...

  • RE: selecting only hour and minute from datetime.

    The following links have functions that will find the start of Century, Decade, Year, Quarter, Month, Week, Day, Hour, 30 Minutes, 20 Minutes, 15 Minutes, 10 Minutes, 5 Minutes, x...

  • RE: Prevent Deadlocks on EF Generated select statements

    Did you change the database where you are still seeing the deadlocks to Read Committed Snapshot?

  • RE: Partitioning Key Opinion

    This doesn't sound like a very good plan if you are just going to update the partition column, since it would force the data to move physically form one disk...

  • RE: No Overtime

    Revenant (12/5/2011)


    Michael Valentine Jones (12/5/2011)


    Michael Valentine Jones (12/3/2011)


    The worst abuse is when they set short project deadlines without any attempt to match the workload to the available staff, and then...

  • RE: LiteSpeed command line to perform the restore

    Refer to the Litespeed help for other options:

    -- Sample Litespeed Database Restore Command

    exec master.dbo.xp_restore_database

    @database = 'MyDBName'

    , @filename = '\\MyServer\MyShare\MyDirectory\MyDBName_db_201111060700.BAK'

    , @with = 'stats = 5'

    , @with = 'NORECOVERY'

    , @with = 'move...

  • RE: No Overtime

    Michael Valentine Jones (12/3/2011)


    The worst abuse is when they set short project deadlines without any attempt to match the workload to the available staff, and then expect people to work...

  • RE: No Overtime

    The worst abuse is when they set short project deadlines without any attempt to match the workload to the available staff, and then expect people to work extremely long hours...

  • RE: Last day of Month

    Jeffrey Williams 3188 (12/2/2011)


    Select dateadd(month, datediff(month, -1, cast(@year as char(4)) + '-' + cast(@month as varchar(2)) + '-01'), -1)

    That code is sensitive to the setting of DATEFORMAT. In the...

  • RE: Splitting a Date range

    You might find the function on the link below useful for what you are doing.

    Finding the midpoint between two datetimes

    The function in this script finds the midpoint in time...

  • RE: Prevent Deadlocks on EF Generated select statements

    There is a very good chance that you can eliminate the deadlocks without making any code changes by setting the database to read_committed_snapshot.

    ALTER DATABASE [MyDatabase] SET READ_COMMITTED_SNAPSHOT ON;

    You should read...

  • RE: Dropping and restoring DB to fix file fragmentation

    There is a good chance that you will not see any performance improvement from physically defragging the database files.

    If you still want to, you can use Diskeeper to defrag the...

  • RE: Last day of Month

    This is probably the fastest and shortest method for finding the last day of the month, given the year and month as integers, since it uses only a single DATEADD...

  • RE: Access to the code in the CLR Stored Procedures

    No, you would need access to the source code repository that was used to build the assembly.

  • RE: Dynamic SQL in a Function (again)

    Just to make sure you understand a couple of points:

    1. Dynamic SQL (including sp_executesql) is not allowed in a TSQL function. If you need to use it, code it...

Viewing 15 posts - 676 through 690 (of 3,011 total)