Forum Replies Created

Viewing 15 posts - 736 through 750 (of 1,347 total)

  • RE: stripping numeric text out of a field

    What size is the column PRIMARY_KEY_DATA. It's more than 20 characters, right, but you're trying to stuff it into @Testdata which is a varchar(20). The reason you only see '419'...

  • RE: A terrible performance need to be improved

    Well, that's too much code to wade thru, but I doubt removing the cursors are an option unless you have the time & budget for a major re-write.

    Inside the cursor...

  • RE: problem using getdate() in "where" clause

    Yes, but you don't need that user-defined function. SQL's DateDiff works on day boundaries if days is the requested interval:

    Using the example of an invoice at 1 second before midnight on...

  • RE: SUM problem

    >>Try to break up the statement into smaller pieces and see if they work properly.

    Agreed. I also think a derived table would really help with clarity, considering the number of...

  • RE: Creating HUGE TEXT FILE HELP!!!!

    >>Select RecordID+RecordCode+TotalTaxAmounts+QuarterTaxAmounts+YearTaxAmounts

    So you're concatenating all the columns together in SQL before exporting it ?

    You're probably running into max size of a varchar, hence the truncation. Use each part of...

  • RE: A terrible performance need to be improved

    >> DELETE FROM dbo.[Latest Mail Received]

    Use TRUNCATE TABLE instead of DELETE for improved performance, if you are emptying the entire table.

    The cursor appears to be a simple 2 table SQL...

  • RE: Decimal precision and scale

    Nope, SQL Server knows nothing about the source system generating this import data and has no way of knowing that the source system has apparently multiplied the data by 10,000...

  • RE: A terrible performance need to be improved

    Not possible without more details on the problem.

  • RE: problem using getdate() in "where" clause

    You could use DateDiff(), but there's not enough info to know if that gives the correct answer:

    WHERE DateDiff(dd, GetDate(), ARJOBHD.INVDATE) = 10

    However, how do you treat days ? For eaxmple,...

  • RE: A terrible performance need to be improved

    >>I have to fetch each row from the first cursor, and start the second cursor, go through it, close it,

    You don't have to. You get your head out of...

  • RE: Execution plans

    >>ensured that the indexes etc have been updated on both.

    What does "updated" mean in this context ?

    - DBCC DbReIndex() or IndexDefrag() ?

    - Statistics updated ?

  • RE: A terrible performance need to be improved

    >>They don't have no index.

    I think it's pretty obvious what you need to do.

    - Add index(es) to support the joins, and add a clustered index to prevent 2 large fragmented table...

  • RE: UserDefinedFunction

    There must be a bug in the function. We need to see the source code.

     

  • RE: Query execute too long, any help

    >>SELECT field_1, field_2, select(select()), select(Select()), function(select()), field_n.

    >>What is the best strategy to reduce time of execution.

    When you place a sub-SELECT within a SELECT, you are building a performance nightmare-in-waiting...

  • RE: Loop or Cursor needed? Questions on SQL Query...

    >>I was thinking it would need a while loop to build a temporary table?

    Nope, this is just a simple 3 table join:

    Select t.UserID, t2.QuestionName, t3.Response

    From TableOne as t1

    Inner Join TableThree...

Viewing 15 posts - 736 through 750 (of 1,347 total)