May 2, 2012 at 9:14 am
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.
May 2, 2012 at 10:25 am
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;-)
May 2, 2012 at 10:29 am
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
May 3, 2012 at 3:26 am
perfect... [] solved my problem
it is hard coded in the job step
May 3, 2012 at 3:29 am
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
May 3, 2012 at 4:03 am
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