Reputation
875
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
1 13 24
Impact
~76k people reached

  • 0 posts edited
  • 0 helpful flags
  • 32 votes cast
May
29
comment SQL Server FILELISTONLY command providing incorrect logical database name
@AaronBertrand - since the front of the house can use that stored procedure to create databases from "template databases" ie just another db. and then use those new databases to create other databases I can't tell. I suspect that database 423 is in database 4295's ancestry at some point. Did that make sense?
May
29
revised SQL Server FILELISTONLY command providing incorrect logical database name
edited body
May
29
comment SQL Server FILELISTONLY command providing incorrect logical database name
@AaronBertrand - So just to make sure I'm answering fully. I get 423 both from the procedure which is referenced in the old ticket and also if I run the command listed in my previous comment. while if I use the SSMS GUI I have a different value listed.
May
29
comment SQL Server FILELISTONLY command providing incorrect logical database name
@AaronBertrand - Now I get you. When I run the following RESTORE FILELISTONLY FROM DISK = 'S:\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\TemplateCopy\4295.BAK' I receive the 423 value. I made a type above. Its 423 not 349. I'll fix that.
May
29
comment SQL Server FILELISTONLY command providing incorrect logical database name
@AaronBertrand - I'm sorry Aaron. Yes I'm referring to the code referenced in the linked ticket when I say using code. and the without using code refers to using the SSMS GUI to do the backup and restore. Please see my comment to Bob Pusateri.
May
29
comment SQL Server FILELISTONLY command providing incorrect logical database name
@BobPusateri - by manual I'm referring to using the SSMS GUI. Under Options the Original File Name is listed as 3497. I've found in the past that if I hardcode my procedure to use that same value that the procedure works fine.
May
29
comment SQL Server FILELISTONLY command providing incorrect logical database name
@AaronBertrand - You caught me. Yes sir that is what I mean.
May
29
asked SQL Server FILELISTONLY command providing incorrect logical database name
May
23
comment Backup Restore Procedure error SQL Server 2008 R2
@AaronBertrand - is this something I should ask as a separate question?
May
23
comment Backup Restore Procedure error SQL Server 2008 R2
@AaronBertrand - Is it possible for filelistonly to return the wrong logical name? When I do a manual restore of the DB I get a different logical name than the one I see from the filelistonly.
May
23
comment Backup Restore Procedure error SQL Server 2008 R2
@AaronBertrand - I wish that was an option. Unfortunately reengineering the process the organization uses to spin up these sites is a multidepartment undertaking that is not likely to get off the ground at the moment.
May
22
comment Backup Restore Procedure error SQL Server 2008 R2
@AaronBertrand - I used SET SQL = N' RESTORE DATABASE ' + CONVERT(NVARCHAR(500), DestinationDB) + ' FROM DISK = ' + CONVERT(NVARCHAR(500), BackupPath) + ' WITH FILE = ' + CONVERT(NVARCHAR(500), Position) + ', MOVE ' + CONVERT(NVARCHAR(500), DataFile) + ' TO ' + CONVERT(NVARCHAR(500), NewDBFileName) + ', MOVE ' + CONVERT(NVARCHAR(500), LogFile) + ' TO ' + CONVERT(NVARCHAR(500), NewLFFileName) + ', NOUNLOAD, REPLACE, Stats = 10;' SELECT SQL.
May
22
revised Backup Restore Procedure error SQL Server 2008 R2
added 836 characters in body
May
22
comment Backup Restore Procedure error SQL Server 2008 R2
@AaronBertrand - well in the original the file paths are passed in as NVarchar variables so.... No. No quotes. However, I suspect I should have put them in for my example. sorry about that.
May
22
comment Backup Restore Procedure error SQL Server 2008 R2
@RLF - We are running SP2. Version number 10.50.4000.0 (x64)
May
22
comment Backup Restore Procedure error SQL Server 2008 R2
@AaronBertrand - I've added a print of the sql that is created as reqyested.
May
22
revised Backup Restore Procedure error SQL Server 2008 R2
added 408 characters in body
May
22
comment Backup Restore Procedure error SQL Server 2008 R2
Nope. Only one mdf and only one ldf file.
May
22
asked Backup Restore Procedure error SQL Server 2008 R2
Apr
25
comment Hidden user rights
That query returns nothing as well.