Forum Replies Created

Viewing 15 posts - 47,611 through 47,625 (of 49,552 total)

  • RE: Newbie needs help with query

    My ASP is rusty but ....

    Ray M (1/23/2008)


    'str = "if not exists (SELECT * FROM Checklist_Justify WHERE iAsmtID="&iAsmtID&")"

    'str = "INSERT INTO Checklist_Justify (iAsmtID, sQuest, sJustify) VALUES ("&iAsmtID&","&sQuest&",'Testing')"

    Unless I'm very mistaken,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SQLProfiler : Deadlock Graph doesn't dispaly SQL stmt

    Switch trace flag 1204 on. That makes SQL write the deadlock graph into the error log. It's not as pretty as the profiler version, but it will work.

    If you're unsure...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Issue with date field calculations

    Jeff Moden (1/19/2008)


    No, no... it won't fail if the IGNORE DUPLICATES option is turned on for the unique index. It will just give a warning that at least one...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Top hash operations Performed

    Shouldn't make a difference. Certainly won't cause a hash-operation. Probably they're queries someone 'wrote' using enterprise manager, which puts that in by default.

    In the exec plan, you should see the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Deadly table scans

    dsc (1/23/2008)


    There is a high degree of fragmentation on the indexes.

    Rebuilding your indexes is an obvious suggestion.

    Can you post the table structure, indexes and the code that's causing the table...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Table Valued functions Vs Scalar Valued Functions

    One of the things to watch for with table-valued functions (especially the multi-statement table valued functions) is that the resultant table, just like a table variable) has no column statistics...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Restore

    I haven't tried it, but it should be possible to recover all the way.

    Full backups don't truncate the transaction log (only tran log backups do that) so you should...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Slower and slower.. what will you do...?

    And the code you're using to check existence and insert also, please.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: how to join to build an expected output result set?

    You're looking for a left outer join (to get all rows from tab1 even where there aren't matches) and a case statement to construct the WorkFlag depending on the existence...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Count function with nulls in columns

    Count (*) will give you the total number of rows in the result set. Count(column name) give you the number of non-null values in the column.

    If there are nulls in...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: locking an entire table

    If you have an explicit transaction and within that transaction you reference a remote server, the transaction will be promoted to a distributed transaction.

    From the error, it looks like the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Issue with date field calculations

    Terry Gamble (1/18/2008)


    Here is what I think is happening, but not sure how to prove it.

    The table being imported into is indexed against duplicates based on cust_id field.

    What I'm thinking...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Issue with date field calculations

    Terry Gamble (1/18/2008)

    truncate table [LM_Date1]

    insert into [LM_Date1]

    select

    ...

    Order by H.[Sold_Date] DESC

    Order bys have no real use in an insert statement. The 'order' that the data's stored in the table depends...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Would this stored procedure kill other traces?

    It looks like it gets the trace ID from the nic_aud_trace table. Check that table, see what's in there

    declare get_traces cursor for

    select curr_trace_id from nic_aud_trace

    Also, it's not tracing to a...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Restoring a table

    Not with the native SQL backup/restore. I know litespeed can restore a single table from a backup. It's a time-intensive operation on a larger DB, but it can be done....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 47,611 through 47,625 (of 49,552 total)