UPDATE STATISTICS for tables with / as job

  • UPDATE STATISTICS for tables with "/" in the table name as job failes

    use AAA

    go

    --update aaa./AAA/AAA_AA_AAAA column AAAAA_A for/AAA/AAAAA_AA_AAAAAAA select

    UPDATE STATISTICS aaa."/AAA/AAA_AA_AAAA" _WA_Sys_00000011_484FE00B

    go

    The statement from above failes if the job runs in back ground in the SQL agent enviornment; in the Query window it works fine. What is wrong with my syntax?

    Message

    Executed as user: aaa. Incorrect syntax near '/AAA/AAA_AA_AAAA'. [SQLSTATE 42000] (Error 102). The step failed.

  • have you hard coded this update stmt in job or using the maintenance plan for it ?

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • UPDATE STATISTICS aaa.[/AAA/AAA_AA_AAAA] _WA_Sys_00000011_484FE00B

    The job likely doesn't have quoted identifiers enabled.

    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
  • perfect... [] solved my problem

    it is hard coded in the job step

  • when a maintanence plan is available why are you using this query.?

    if the table grows the statistics will grow is it right then in that case the query has to be updated right?

    Regards
    Durai Nagarajan

  • Hi Durai, we don't use maintenance plans or auto create statistics. We use the build in auto update statistics for all objects and use manually daily an update for statistics on objects what are changed extremly often but don't growth up. So were the auto update statistics don't work.

    To use the auto update statistics is the recommendation of the software provider SAP. We at the moment only tune up single objects with known problems by cached execution plans.

    The problem is the default parameter sniffing by MSSQL, but it is not allowed to disable it like ORACLE.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply