How can we help you today? How can we help you today?
pamozer

Activity overview

Latest activity by pamozer

I am having some issues with the syntax. Can you point out where I am going wrong? I am getting the following error Syntax error: 'fjfelej!'' after '\\kprod-nas03\sqlbackups\FULL_DB009_superbill_2039_prod_20140321_112322_encr.sqb WITH PASSWORD=' Create Table #backupFiles(ID Int Identity(1,1),FileName Varchar(128), depth int, isfile int, databasename varchar(64)) Insert into #backupfiles(FileName, depth, isfile) EXEC master.sys.xp_dirtree '\\kprod-nas03\ServerUpdates\SQLRestore\',0,1; Update #backupfiles set databasename= substring(FileName,12,len(filename)-charindex('2014',filename)-case when len(filename)=55 then 4 else 3 end) Create TAble #Restore(ID Int Identity(1,1),FileName Varchar(128), DatabaseName varchar(64)) Insert into #Restore(FileName, DatabaseName) select FileName,Databasename from #backupfiles where filename like '%superbill%' Declare @DbCount int Declare @Counter Int DECLARE @exitcode int DECLARE @sqlerrorcode int DECLARE @sitename nvarchar(128) DECLARE @sql nvarchar(1024) Declare @DatabaseName varchar(64) Set @DBCount=(Select Max(ID) from #Restore) SET @counter=(Select Min(ID) From #Restore) While @Counter<=@DBCount Begin SET @sitename = (Select FileName from #Restore where ID =@Counter) Set @DatabaseName= (Select DatabaseName from #Restore where ID =@Counter) SET @sql = '-SQL "RESTORE DATABASE ' + @databasename + ' FROM DISK = ''\\kprod-nas03\sqlbackups\' + @sitename + ' WITH PASSWORD=''fjfelejl'' SOURCE = ''' + @DatabaseName + ''' WITH MOVE DATAFILES TO ''D:\SQLData'' , MOVE LOGFILES TO ''D:\SQLLogs'' , MAILTO = [url=''pam.ozer@kareo.com]''pam.ozer@kareo.com[/url]'', RECOVERY, CHECKDB = ''ALL_ERRORMSGS, DATA_PURITY, EXTENDED_LOGICAL_CHECKS''' EXEC master..sqlbackup @sql, @exitcode OUT, @sqlerrorcode OUT Set @Counter=@Counter+1 END ---- drop table #backupFiles, #Restore / comments
I am having some issues with the syntax. Can you point out where I am going wrong? I am getting the following error Syntax error: 'fjfelej!'' after '\\kprod-nas03\sqlbackups\FULL_DB009_superbill_...
0 votes
Need to restore Multiple Databases on the same SQL Instance
For Disaster Recovery purposes I have a directory of full backup files that need to be restored to a single sql instance. Is there any way to either script or use the gui to say restore each of th...
2 followers 9 comments 0 votes
Correct Syntax for Restoring sQBHeaderOnly with Password
I am having issues with the syntax for sqbheaderonly in SQL SERVER Managment Studio EXECUTE master..sqlbackup '-SQL "RESTORE SQBHEADERONLY FROM DISK = ''c:\backups\FULL_DB001_superbill_24305_prod_2...
2 followers 2 comments 0 votes