Hi, everyone:
I need to drop&re-create an index containing a restricted word (DATE) in a scheduled job. The script works from the Query Analyzer, but doesn't from a job command window. Is there some sort of setting that can resolve this problem?
Thanks
Andrei
Try enclosing the column name in brackets - [DATE]. SQL Server provides the ability to use reserved words if they are delimited. Read more under "Reserved Keywords" in SQL BOL.
1- Create a stored proc containing the DROP and CREATE statements. Execute the proc from the job.
2- Use DBCC DBREINDEX to rebuild the index. The basic syntax is DBCC DBREINDEX ('dbname.owner.tblname', indexname)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.