Forum Replies Created

Viewing 15 posts - 6,241 through 6,255 (of 26,490 total)

  • RE: What could be disabling triggers?

    Not to my knowledge. You may not be able to use Audit but you could setup database triggers to capture the use of DDL to disable triggers and even...

  • RE: 1 Quick question for all the DBA's

    Jeff Moden (7/22/2014)


    Also not being snarky, but I've found that the reason a lot of people turn to PowerShell is because they don't actually know what they're doing in SQL...

  • RE: Comparing records to previous records in query

    Sean Lange (7/22/2014)


    Sean Lange (7/21/2014)


    First you have to define what you mean by previous. I am guessing you mean InvoiceID? If you can post some consumable ddl and sample data...

  • RE: Comparing records to previous records in query

    tarr94 (7/21/2014)


    Hi,

    Here is a sample table:

    CustomerID------InvoiceID------Total

    ----95---------------3546--------#30

    ----100--------------3547--------$12

    ----95---------------3548--------$42

    ----100--------------3549--------$25

    ----100--------------3550--------$30

    I'm looking to write a query that will only return the invoices for each customer that have a Total difference of greater than $10. ...

  • RE: Insert sequence number

    ChrisM@home (7/22/2014)


    @wBob, you might find a TOP() -limited IBG-style inline tally even more efficient.

    Sort of like this:

    IF OBJECT_ID('dbo.numbers') IS NULL

    BEGIN

    CREATE TABLE dbo.numbers ( x INT, CONSTRAINT PK_numbers PRIMARY KEY (...

  • RE: Insert sequence number

    wBob (7/22/2014)


    Having taken all your comments into consideration, and with a similar approach to Chris, this option was best for me at scale ( 1 million ):

    USE tempdb

    GO

    IF OBJECT_ID('#claims') IS...

  • RE: Insert sequence number

    pietlinden (7/22/2014)


    What's totally odd is that MS does that with their examples of CTEs - all of them begin with a semi-colon, which was really weird to me. Gotta...

  • RE: disk space 90% full...

    mtassin (6/21/2012)


    If your version of sQL supports it, look at using Backup Compression to make your backups smaller.

    Make sure to clean up your backups and only keep a small number...

  • RE: 1 Quick question for all the DBA's

    New Born DBA (7/22/2014)


    Grant Fritchey (7/22/2014)


    Learn PowerShell.

    Automate all the things.

    Would love to, but where should I start?

    Not to be snarky (I am just now starting to learn PowerShell), at...

  • RE: Insert sequence number

    Luis Cazares (7/22/2014)


    Hey Bob,

    I suggest that you stop using rCTEs to count as they're a form of hidden RBAR and will cause problems. And low row counts don't justify the...

  • RE: Fantasy Football 2014

    Well, I figured out who is still missing: Truncate Y'All and NFL Soldiers.

  • RE: Fantasy Football 2014

    Well, day time State side works best for me since Afghanistan is 10.5 hours ahead of the States and I work nights out here.

    Only thing I have to worry about...

  • RE: Fantasy Football 2014

    Who hasn't checked back in yet, or are we all here for another year??

  • RE: Insert sequence number

    adonetok (7/21/2014)


    I need help to code to add sequence number.

    One claim number may have various max sequence number.

    For example,

    1) Claim number: 111 max sequence: 17

    2) Claim number: 222 max...

  • RE: SQL Help

    wBob (7/21/2014)


    I would approach that using TOP and CROSS APPLY, eg:

    SELECT c2.*

    FROM ( SELECT DISTINCT CoverageCode FROM dbo.[Contract] ) x

    CROSS APPLY ( SELECT TOP 5 * FROM dbo.[Contract] c WHERE...

Viewing 15 posts - 6,241 through 6,255 (of 26,490 total)