Forum Replies Created

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

  • RE: CROSS APPLY on named sets

    The T-SQL parses OK but does not compile. A lesson re-learnt this morning for me; the difference between parse and compile. 🙂

  • RE: Send ssrs report to variable emails

    Take a look at the T-SQL in the job step though, you will see that it executes something like this below.

    exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='35e240e6-6ca7-415e-8eeb-36a880d264b7'

    There is no way of sending...

  • RE: Copy of 1 TB prod database

    In my experience backup time was significantly reduced. I had a 1TB database that was taking 5 hours to backup. Changed the backup to stripe to 8 files...

  • RE: Copy of 1 TB prod database

    Striping the backup to multiple backup files can help you reduce the backup/restore time.

    I've also found that writing the backup files to a local drive and not over...

  • RE: Byte Me: Get-Help

    My current affliction is trying to use all my favourite SSMS keyboard shortcuts in other editors; 🙁

  • RE: Create Procedure

    Iulian -207023 (11/4/2015)


    paul 25096 (11/4/2015)


    I think the reason "Options 1, 2 and 3" has more votes than "Option 2" is because of course you should also avoid statements that cause...

  • RE: More wildcard searches

    Am I missing something here?

    All rows are returned, but that is five rows not four.

    Off to get my coffee.......

  • RE: Cross Apply

    None of the columns returned by the query would represent a product.

  • RE: Painful datetime conversion

    Or you could create a lookup table with all 86400 seconds in and then use a query like the one below....

    SELECT

    S.DesiredDateTimeValue

    , CONVERT(DATETIME, CONVERT(VARCHAR(8), S.VHRGDT)) + CONVERT(DATETIME, T.ATime) [DateTime]

    FROM...

  • RE: Painful datetime conversion

    Another option for you....

    SELECT CONVERT( DATETIME, CONVERT(VARCHAR(8), VHRGDT), 113) + CONVERT(DATETIME, STUFF(STUFF(RIGHT('0'+CONVERT(VARCHAR(6), VHRGTM), 6),3,0,':'),6,0,':'),108) , DesiredDateTimeValue FROM #Something

  • RE: Painful datetime conversion

    Hi Sean, was your code as nasty looking as mine below?

    SELECT

    DATEADD(SECOND, CONVERT(INT, SUBSTRING(RIGHT('0' +(CONVERT(VARCHAR(6), VHRGTM)),6),1,2)) * 60 * 60 + CONVERT(INT, SUBSTRING(RIGHT('0' +(CONVERT(VARCHAR(6), VHRGTM)),6),3,2)) * 60 +...

  • RE: I cannot finish COUNT (*) query on a table with more than billion records.

    I like to use sp_spaceused with the table name.

    That stored procedure uses dm_dp_partition_stats internally.

  • RE: What are your five most common T-SQL commands

    sp_who2

    dbcc showfilestats

    restore filelistonly from disk = ''

    restore database z from disk = '' with move 'x' to 'x', move 'y' to 'y', stats=1

    sp_readerrorlog

  • RE: Multiple Backup Files

    Yep, I've done this one large database. 1.2TB backup was taking over 5 hours and the same for the restore. Implemented striped backup set with 8 files and...

  • RE: Unable to access physical server to backup transaction log

    Assuming you have got access to run queries on the server it might be worth checking when the log was last backed up and also how much of the log...

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