.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SQL Server Maintenance Plan - Update Statistics fails if schema contains special chars

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :Sql Server

We have a database schema with a period in it's name.  This is valid as per http://msdn.microsoft.com/en-us/library/aa224033(SQL.80).aspx. When we create a maintenance plan to update statistics it will succeed if the object property is set to 'Tables and Views'. If this is set to 'Table' it will fail.

Steps to Reproduce

  • Create a new schema in a user database with a period in it's name, ie
    CREATE SCHEMA [Windows.EventLog] AUTHORIZATION [dbo]
  • Create a table with owner using schema created in #1, ie
    CREATE TABLE [Windows.EventLog].[Computer](
    	[ComputerId] [smallint] IDENTITY(1,1) NOT NULL,
    	[ComputerName] [varchar](255) NOT NULL,
    ) ON [PRIMARY]
  • Create a new maintenance plan, drag 'Update Statistics Task' to designer surface, edit properites, choose the user database, View T-SQL and test execution: it will work
  • Edit maintenance plan and modify 'Update Statistics Task', change Object to Table, change selection to all, execute task and it will fail. Also, if you now try to click 'View T-SQL' or change it back to 'Tables and Views', a error dialog with title 'Microsoft.SqlServer.MaintenancePlanTasksUI' shows will message 'Object

    View Complete Post

More Related Resource Links

Maintenance Update Statistics plan

Hi, I've created a maintenance plan for many databases with these tasks (SQL 2005) 1- shrink Database 2- Update Statistics 3- Cleanup History 4- Backup Database (Full) 5- Maintenance Cleanup task The maintenance plan failed at task Update Statics.  Here the error message : Error number : -1073548784 Error message : Executing the query "UPDATE STATISTICS [dbo].[LOG_DETAILS] WITH FULLSCAN " failed with the following error: "Could not continue scan with NOLOCK due to data movement.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. My question :How do I know which database is causing the problem and how can I fix the problem ? I don't know a dbo database? thanks,   Jasmin  

How to write storeprocedure update special character in Sql server 2005


Hi All,

I am using Sql Server 2005,My table structure is below.

Create Table ComentTable(id int,coments varchar(4000))

insert into ComentTable values(1,'sanjay I don%27t Know Tamil Language')

insert into ComentTable values(1,'sanjay I don%27t Know Kanar Language')

how to write storeprocedure update coments column replace %27 to '

SQL Server 2008: Error in Creating Maintenance Plan



We are trying to create and edit a Backup Script in Maintenance plans.  It is throwing the following error. Please help.




See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'msddsp, Version=,

Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the

file specified.
File name: 'msddsp, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.DataTransformationServices.Design.DtrControlFlowDiagram.OnComponentChanged(Object

sender, ComponentChangedEventArgs chevent)
   at System.ComponentModel.Design.ComponentChangedEventHandler.Invoke(Object sender,

ComponentChangedEventArgs e)


ntChanged(Object component, MemberDescriptor member, Object oldValue, Object newValue)


ed(Object component, MemberDescriptor member, Obje

sql server maintenance plan schedule time and execution time difference


Hi All,

One of my customer db there is one maintenance plan(full backup / Transaction log backup  ) schedule time for the full backup is 11:00:00 PM daily and for transaction log backup 12.30 pm Sunday to Friday ,I checked the job created by maintenance plan there also schedule time is same but when i check the history of the job it shows it happened at 7:00:00 pm every day. why there is time difference ?

Product version is 8.00.2055(SP4)

i checked the MSDB.dbo.sysjobschedules table and the next_run_date is not updated properly,it is showing yesterday 11:00:00 pm


please help me to resolve this issue




Transfered ssis of type maintenance plan connect to wrong server

I transfered a maintenance plan using the method to transfer ssis with sql server management studio.

The sql task contained in my maintenance plan are set to use the "local server connection".  Somehow, when I run the maintenance plan on the target server, the sql task get executed on the source server from which I imported the maintenance plan.

In other words:
I transfer a maintenance plan from server A to server B.
The maintenance plan is set to use local server connection.
Running the maintenance plan on server B affects the server A instead of the server B.

Is there a way to refresh or repair the "local server connection" so that it actually connect to the current server instead of the one the ssis was imported from.

Here are some references on the method I used.



Backup Maintenance Plan Failure SQL Server 2005

Hi All,
I have three maintenance Plans Full, Differential and Transaction Log backup. Full and Transaction Log backup plans are working fine. In the all the maintenance plans I am taking backup of almost 60 databases.

The problem is with the differential backup plan. The backup plan is keep failing with the following errors:

FailedSad-1073548784) Executing the query "declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'MY_Database' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'My_Database' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''Giants_Security_4'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM  DISK = N'E:\\MSSQL.1\\MSSQL\\Backup\\MY_Database\\MY_database_backup_200808240500.DIFF.BAK' WITH  FILE =

Update statistics and cache plan invalidation



I assumed that whenever we run update statistics on the database tables it would invalidate all the plans in cache involving those tables and SQL Server would generate a new execution plan for queries involving those tables but this is not a behavior we are getting on test system.

Let me know if this assumption is not true and we need to clear cache after running update statistics to make sure SQL Server generates optimal plan with new statistics.

Following is the sample code I tried on SQL Server 2005sp3:

drop table test_stats
create table test_stats(id int not null primary key, id1 int, id2 int, id3 char(1000))
create index idx_dd1 on test_stats(id1)
--The following statement would generate execution plan with full scan on test_stats
select * from test_stats where id1 = 100
set nocount on
declare @i int
set @i = 1
while (@i < 10000)
insert into test_stats values(@i,@i,@i,@i)
set @i = @i+1
update statistics test_stats with fullscan
--The following statement still generates execution plan with full scan on test_stats even after updating statistics
select * from test_stats where id1 = 100
dbcc freeproccache
--The following statement generates execution plan with index seek after clearing cache
select * from test_st

Backup maintenance plan fails due to space in t-sql statement...



I have a maintenance plan that  is failing on one backup. I went into look at the t-sql code and it shows a space after the database name. I copied the t-sql code to a query window | removed the spaces and the backup ran fine. My question is how do I remove the spaces for this one backup. The other servers in the maintenance plan work fine.

Note: I copied this part out so you can see "N'T:\SQL Backup\PackagingForms \" I removed the space after PackagingForms and it worked!

t-sql code:

EXECUTE master.dbo.xp_create_subdir N'T:\SQL Backup\PackagingForms '
BACKUP DATABASE [PackagingForms ] TO  DISK = N'T:\SQL Backup\PackagingForms \PackagingForms _backup_201010281050.bak' WITH NOFORMAT, NOINIT,  NAME = N'PackagingForms _backup_20101028105056', SKIP, REWIND, NOUNLOAD,  STATS = 10
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'PackagingForms ' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'PackagingForms ' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''PackagingForms '' not found.', 16, 1) end
RESTORE VERIFYONLY FROM  DISK = N'T:\SQL Backup\PackagingForms \PackagingForms _backup_201010281050.bak'

SQL Server 2008 Maintenance plan will not delete bak and trn files


I have a sql 2008 maintenance plan to backup databases and to delete old bak files.  The db backup works but the delete does not.  I do not get any error messages, all steps marked successful.  So, I copied the sql statement EXECUTE master.dbo.xp_delete_file 0,N'Z:\SQL BACKUPS\',N'bak',N'2010-11-14T12:43:35',1 and tried to execute in a query window.  I have a successful completion message, BUT the files are not deleted.  I have ensured that the extension is bak and the folder is correct and the account has sysadmin on the server and is a sql sa.  I have tried many options and no success.  

We are version   Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)   Mar 29 2009 10:11:52   Copyright (c) 1988-2008 Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2) (VM).

Any help would be appreciated.  Thanks!

SQL Server 2008 R2 Missing Maintenance Plan Wizard

I do not see the "Maintenace Plan" option under the "Management" folder in SQL Server Mgt Studio

SQL Server Maintenance Plan

I have SQL Server Enterprise edition installed on windows server 2003, the problem is that the maintenace plan installed more than one time, after that I deleted all the maintenace scheduals from Management>Database Maintenance Plans

then I made one maitenance plan; the problem is that the deleted plans is still working and on of them produce a backup file with 3 GB size.
I checked the Management>Database Maintenance Plans but there was only one plan and it is working but I need to stop the other backups plans without the need to reinstall the SQL Server.

Windows Update error message 84B30001 - SQL Server 2008 SP2 update fails


I am running Windows 7 Professional on a 64 bit platform and have Windows update on and selected to notify me when updates are available.  The other day, I received an error message that an update failed to install properly.  The update that failed is to update SQL Server 2008 SP2 - KB 2285068.  I have made several attempts to retry this update with the same result.  When I Googled the error message, all of the responses deal with the SQL Server 2008 SP1 update not SP2.  Couldn't find a solution to this problem - nor could I find one in the KB article - which basically explains details of SP2 and DOES give me the option to instal SP2 from here.  Don't want to take the chance and download it from here - maybe I should though.  Can usually find a solution to a Windows update error in Google - can't find one this time.

Any suggestions?

Jim Cutrara

Jim Cutrara

update/delete not working on server only


my aspx page works in VWD, and everything works on the server EXCEPT update and delete sql functions. any ideas?


How to extract a schema from a sql server database



  I need to extract or get the schema from tables in my databse and what is the best way to do it. Is there any third party tool to do it??


Any idea will be appreciated..



ClickOnce: Deploy and Update Your Smart Client Projects Using a Central Server


ClickOnce is a new deployment technology that allows users to download and execute Windows-based client applications over the Web, a network share, or from a local disk. Users get the rich interactive and stateful experience of Windows Forms, but still have the ease of deployment and updates available to Web applications. ClickOnce applications can be run offline and support a variety of automatic and manual update scenarios.Learn all about it here.

Brian Noyes

MSDN Magazine May 2004

Metadata: Create a Database Schema Repository with Meta Data Services in SQL Server 2000


SQL Server 2000 Meta Data Services is a repository technology that stores and manages metadata for SQL Server. Instead of building database schemas over and over, Meta Data Services allows you to freeze an entire schema for use in other projects. You can also use these schemas for training, testing, or debugging. In this article, the authors will review the various components of Meta Data Services and show how it can be programmed using a Visual Basic client, XML, and XSLT. They will also show you how to manage and manipulate your metadata by generating a simple database schema using a SQL Server repository.

Alok Mehta and Ricardo Rodriguez

MSDN Magazine May 2003

SQL Server CE: New Version Lets You Store and Update Data on Handheld Devices


Handheld device users need to be able to synchronize with a main data store when it's convenient and, preferably, when the back-end database server isn't busy. SQL Server 2000 Windows CE Edition allows you to build a traveling data store that can be displayed and run on a variety of devices. SQL Server CE supports a subset of the full SQL Server package, and can be used as a standalone server or in tandem with SWL Server and IIS. The architecture of SQL Server CE, along with data manipulation, synchronization, and connectivity issues, are discussed in this article. Topics such as making your data public, choosing the right type of replication, and handling errors are also covered.

Paul Yao and David Durant

MSDN Magazine June 2001

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend