March 16, 2011 at 3:42 pm
I just created a new database and accidently leave a white space at the end of the database name.
I tried to change it in Management studio, and right click the name and rename, with the database already exists.
I realized this may be because of it ignores the white space.
But in my maintenance plan, it cannot find the folder for backup, because it cannot the file in the folder with a space in it. I tried to add the space for the file system, but I cannot.
It immediately take off the white space.
What can I do to fix this.
March 16, 2011 at 4:01 pm
Did a few tests and this seemed to work just fine:
EXEC sys.sp_renamedb @dbname = [MyDB ], -- sysname
@newname = [MyDB2] -- sysname
;
EXEC sys.sp_renamedb @dbname = [MyDB2], -- sysname
@newname = [MyDB] -- sysname
;
Renamed it to something else, then renamed it to the original name without the space. Funny how even with brackets I couldn't rename it to eliminate the space.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
March 16, 2011 at 5:11 pm
Thank you, it is a great help
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply