Forum Replies Created

Viewing 15 posts - 286 through 300 (of 582 total)

  • RE: Deleting duplicate records

    Absolutely right, If your system has (genuine) duplicates in, then the system is broken.

    Guessing based on the schema, I'd say you need a unique constraint on date,employee. You also need...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: don''''t know how to use a cursor to insert rows from one table to another elinimating dups

    If you do need to make sure the two text columns come from the same row, you'll need to do something like:

    select V.ORG, V.ACCT, V.CLASS,  V.PROD, t.NOTE_TEXT, t.HTML_TEXT
    from(
    SELECT ORG, ACCT, CLASS,  PROD, MIN(KEY) KEY  ...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: SQL script with "unusual" results

    post execution plans for the simplest version of the two queries.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Update single rows with multiple values

    Yes, you want a big flat denormalised recordset for Crystal - unless you want to use subreports, but they are a pain, though good if you need to cause side-eefects...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: how to parse a T-SQL script to get the tables touched by the query?

    That's to find the stored procs that access a given table. I expect the results would contain a lot of duplicates. Note also that sysdepends is not reliable for sps....

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: inserting multiple insert statement questions

    insert Products(ProductName,UnitPrice)

    select V.pn, V.up from(

     select @ProductName pn, @UnitPrice  up union all

    select @ProductName2, @UnitPrice2 union all
    select @ProductName3, @UnitPrice3 union all
    select...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Script to Sync Permissions

    alter authorisation on schema <schname> to <newuser>

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: inserting multiple insert statement questions

    if @ProductName is not null
      insert Products(ProductName,UnitPrice)
      VALUES (@ProductName, @UnitPrice)

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Divide update into batches

     INNER JOIN #ActiveAccounts A ON L.AccountID = A.AccountID

       WHERE A.Id between @N and @N + @Range - 1

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Case statement in where clause

    So is this cumulative YTD - type data?

    if so, I would

    - get the relevant Fiscal year start ('@FYS')

    -get the end date for the calculation, truncate time portion, add...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Monitor an application connection

    You could poll sysprocesses every so often, but the only way of getting a 'push' from those events is with a trace, I think. But for a snapshot, it would...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Unusual -- Violation of PRIMARY KEY constraint ERROR

    could you script out the PRIMARY KEY constraint and post the DDL? I have an idea... and you definitely ran DBCC with NORESEED first, before RESEED?

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Count number of tables referenced in a query / view

    If you have a query to test, make it into a view, or if necessary a stored proc. The code can be amended to cover sps, but sysdepends is not...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Trying to return a return code and a recordset from a stored proc

    Have you changed the stored proc to actually return a value? (If so, is it set up to be responsive to all errors?) - ah reading your last post again,...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Script to Sync Permissions

    Come on 'Jules', you remember this - it's the sysusers/syslogins SID disparity in SQL8. Listen to Sean.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

Viewing 15 posts - 286 through 300 (of 582 total)