SQL Server Performance

worring about the performance issue

Discussion in 'General DBA Questions' started by aaronsandy, Mar 30, 2005.

  1. aaronsandy New Member

    Hi!
    I have written 2 sp which will give the db size of all db on a weekely basis.However I am worring about the performance issue.Here is the difference between the two.
    sp 1)Truncating the table and inserting the dbsize weekely
    sp 2)dropping -reating a new table each time and inserting dbsize weekely.
    I want to exec the sp by a job step scheduled weekly.I dont want a temp tbl as I need to query the tbl created, every monday.I dont want data to be stored more than 1 week.
    Now I am wondering which of this 2 will gv a better performance.Will be there any fragmentation issue of data pages if we truncate-insert again and again?
  2. satya Moderator

    What is the size of table you're talking here, it is very very minimal compared to return the query results.

    In order to update the statistics of the table after the data load, you can either run DBCC DBREINDEX on that table or UPDATE STATISTICS in order keep the upto date stats.

    And do not keep this table under a user database which is used frequently by other applications.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.

Share This Page