Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Wednesday, March 28, 2012

Precedence "Completion" operation

I have three sequence containers setup to run in parallel. I have a final step that parses the log file and displays results, and I want to this to occur when all three containers have completed, success or failure. I therefore have a constraint from each container that feeds into my final step, and all three constraint types are set to "completion".

When I run the package and one of the tasks within a container fails (and fails its parent, but not the package) the final step is not executed.

If I take off all the constraints except one, the final step is executed as expected.

I am using checkpointing if that has any impact. Disabling it makes no difference.

Any thoughts/alternatives I might try?

thanks

not sure about this...but have looked at the MaximunErrorCount property at the package level?|||

Post parallel tasks not excuting despite completion precedence constraints(s). This sounds like you're using FailPackageOnFailure. Are you?

If a task fails and you've sett FailPackageOnFailure on it, or something in its container hierarchy, the parallel tasks that have already started will still continue post failure. But, from the point the FailPackageOnError is hit, no other task will be started, including the task to which you've linked up the Completion precedence constraints.

FailPackageOnFailure trumps any constraint.

|||

jaegd wrote:

FailPackageOnFailure trumps any constraint.

That was the problem. Removed that setting and now the constraints behave as expected.

Thanks a lot!

Monday, March 26, 2012

Pre snapshot to apply permissions

Hi.
I would like to apply the objects' permissions after to apply an snapshot.
To do it, I need a script file, with the grant commands to apply that
permissions.
Could I get that script just before applying the snapshot with any t-sql
command to generate and save the script file with these permissions?.
So if the objects' permissions have change from the last time I applied the
snapshot or i have created new objects, I can be sure that the permissions
transfered are accurate.
Thank you
Jorge,
here is a script I use which can be adapted for your needs. srvname is the
subscriber and delivery is the name of my database. I already have the
logins and users, and if you don't have them, then I'll leave you to create
that script
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
SELECT 'Grant ' +
case
when action = 193 then 'SELECT'
when action = 195 then 'INSERT'
when action = 196 then 'DELETE'
when action = 197 then 'UPDATE'
when action = 224 then 'EXECUTE'
end as Grant1,
' ON [' + delivery.dbo.sysobjects.name + '] TO ' +
delivery.dbo.sysusers.name as Grant2
--,ss.srvname
--,delivery.dbo.syspublications.name AS Publication
FROM delivery.dbo.syssubscriptions
INNER JOIN delivery.dbo.sysextendedarticlesview ON
delivery.dbo.syssubscriptions.artid =
delivery.dbo.sysextendedarticlesview.artid
INNER JOIN delivery.dbo.sysobjects ON
delivery.dbo.sysextendedarticlesview.objid =
delivery.dbo.sysobjects.id
INNER JOIN delivery.dbo.syspublications ON
delivery.dbo.sysextendedarticlesview.pubid =
delivery.dbo.syspublications.pubid
INNER JOIN master..sysservers ss on ss.srvid =
delivery.dbo.syssubscriptions.srvid
left outer JOIN delivery.dbo.sysprotects on
delivery.dbo.sysprotects.id = delivery.dbo.sysobjects.id
left outer JOIN delivery.dbo.sysusers on
delivery.dbo.sysprotects.uid = delivery.dbo.sysusers.uid
where action in (193,195,196,197,224)
--and srvname = 'xxx\PDSCOPY'
and srvname = 'yyy\PDSCOPY'
order by ss.srvname, delivery.dbo.syspublications.name,
delivery.dbo.sysobjects.name, delivery.dbo.sysusers.name
"Jorge" <Jorge@.discussions.microsoft.com> wrote in message
news:18488D2B-1F12-4D30-91C7-894EDE31D557@.microsoft.com...
> Hi.
> I would like to apply the objects' permissions after to apply an snapshot.
> To do it, I need a script file, with the grant commands to apply that
> permissions.
> Could I get that script just before applying the snapshot with any t-sql
> command to generate and save the script file with these permissions?.
> So if the objects' permissions have change from the last time I applied
the
> snapshot or i have created new objects, I can be sure that the permissions
> transfered are accurate.
> Thank you
|||Very good, Paul.
It's exactly what I was looking for
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> escribi en el mensaje
news:eXmbfaX2EHA.2192@.TK2MSFTNGP14.phx.gbl...
> Jorge,
> here is a script I use which can be adapted for your needs. srvname is the
> subscriber and delivery is the name of my database. I already have the
> logins and users, and if you don't have them, then I'll leave you to
> create
> that script
> Rgds,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
> SELECT 'Grant ' +
> case
> when action = 193 then 'SELECT'
> when action = 195 then 'INSERT'
> when action = 196 then 'DELETE'
> when action = 197 then 'UPDATE'
> when action = 224 then 'EXECUTE'
> end as Grant1,
> ' ON [' + delivery.dbo.sysobjects.name + '] TO ' +
> delivery.dbo.sysusers.name as Grant2
> --,ss.srvname
> --,delivery.dbo.syspublications.name AS Publication
> FROM delivery.dbo.syssubscriptions
> INNER JOIN delivery.dbo.sysextendedarticlesview ON
> delivery.dbo.syssubscriptions.artid =
> delivery.dbo.sysextendedarticlesview.artid
> INNER JOIN delivery.dbo.sysobjects ON
> delivery.dbo.sysextendedarticlesview.objid =
> delivery.dbo.sysobjects.id
> INNER JOIN delivery.dbo.syspublications ON
> delivery.dbo.sysextendedarticlesview.pubid =
> delivery.dbo.syspublications.pubid
> INNER JOIN master..sysservers ss on ss.srvid =
> delivery.dbo.syssubscriptions.srvid
> left outer JOIN delivery.dbo.sysprotects on
> delivery.dbo.sysprotects.id = delivery.dbo.sysobjects.id
> left outer JOIN delivery.dbo.sysusers on
> delivery.dbo.sysprotects.uid = delivery.dbo.sysusers.uid
> where action in (193,195,196,197,224)
> --and srvname = 'xxx\PDSCOPY'
> and srvname = 'yyy\PDSCOPY'
> order by ss.srvname, delivery.dbo.syspublications.name,
> delivery.dbo.sysobjects.name, delivery.dbo.sysusers.name
>
> "Jorge" <Jorge@.discussions.microsoft.com> wrote in message
> news:18488D2B-1F12-4D30-91C7-894EDE31D557@.microsoft.com...
> the
>

Pre and Post Exec Event Handler For a Package

I have a simple test package to play with Event Handler. I got 2 Exec SQL Task and one File System Task. I have set the OnPreExecute and OnPostExecute at package level along with OnPreExecute on SQL and File System Task. These event handlers were loading the package, task name along with start time, machine and user in my audit table (using Exec SQL Task).

OnPreExecute did work fine for SQL and File System Task. They only had one record in the Audit table.

OnPreExecute and OnPostExecute for the package itseld did NOT work. When I say it doesn't work, it logs it to my audit table so many times. I was expecting one record in my audit table for OnPreExecute and one record for OnPostExecute at Package Level. But I was worng. It has inserted into my audit table 14 times instead of twice.

Any ideas? Or am I doing something wrong?

I know I can fix this by workaround. I can remove OnPreExecute and OnPostExecute Event Handler at Package level and insert Exec SQL Task at the beginning and end of the package. This will fix it, but I was wondering why it doesnt work?

Thanks
SuthaI don't quite know why you're getting it 14 times but this will be something to do with the same event getting caught in multiple places.
Every time the File System Task (for example) executes it will fire the eventhandler scoped to the task AND the eventhandler scoped to the package. So your event actually gets handled twice.

-Jamie|||Yeah i concur from our observations that this seems to be what is happening but surely this is a bit of a design issue ....

I want to know from the post execute that the package is starting (or has started), i don't want the startup events from each component thrown up to the post execute event on the whole package because they don't have any relevance at this level.

What do you think ?

Mark Hill|||Jamie

I tried it on a brand new package as well. I can re-produce it. As Mark states that it looks like an design issue. Anyone from MS can shed any light on this?

Thanks
Sutha|||

You can easily debug it like that:
- place a script in package's OnPreExecute event handler
- set a breakpoint on the task (F9)
- run in debugger
- when debugger brakes on the breakpoint add SourceName variable to the Watch window.

Now, every time you hit the breakpoint you will see the name of the task/container that raised the event.

I believe that all OnPreExecute events in your package get propagated to the package level. That's why you see so many of them. If it is not what you expect - you can change it setting Propagate system variable on event handlers to False

PRC file extensions in MSSQL Management Studio 2005

Most of our files were scripted out to our VSS as PRC files. In MSSQL
Management Studio 2005 these file extensions are not recognized by the
compiler as SQL text. Now I could go into VSS and change all my
extensions to SQL, but I feel like that would be a very time consuming
task. Is there a way to have MSSQL Management Studio 2005 recognize
this as executable SQL text?
Thanks,
MikeMike,
I think you can change the File Type Association in Windows - sounds
like you have give Windows a gentle nudge in the right direction.
HTH
Barry|||I tried that and it didn't work : - (|||What do you mean by "recognized by the compiler as SQL text"? SQL Server (th
e database engine)
doesn't open any files (containing source code), so it couldn't care less wh
at extensions you have
for the files on the files systems on your machines. So your problem has to
be with the tools you
are using. Perhaps you can elaborate a bit?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Mike" <mikepmyers@.hotmail.com> wrote in message
news:1136388956.187342.158280@.g14g2000cwa.googlegroups.com...
> Most of our files were scripted out to our VSS as PRC files. In MSSQL
> Management Studio 2005 these file extensions are not recognized by the
> compiler as SQL text. Now I could go into VSS and change all my
> extensions to SQL, but I feel like that would be a very time consuming
> task. Is there a way to have MSSQL Management Studio 2005 recognize
> this as executable SQL text?
> Thanks,
> Mike
>|||I found the answer to my own question. In MSSQL Management Studio 2005
you have to associate the extension to the program by:
* Tools - Options - Text Editor - File Extnesion - Extension:
"PRC" - Editor: "SQL Query Editor"
It's a pain that MSSQL Management Studio 2005 doesn't recognize the
"PRC" file extension automatically, but as long as there is a
work-around I guess I'll live.sql

PRC file extensions in MSSQL Management Studio 2005

Most of our files were scripted out to our VSS as PRC files. In MSSQL
Management Studio 2005 these file extensions are not recognized by the
compiler as SQL text. Now I could go into VSS and change all my
extensions to SQL, but I feel like that would be a very time consuming
task. Is there a way to have MSSQL Management Studio 2005 recognize
this as executable SQL text?
Thanks,
Mike
I found the answer to my own question. In MSSQL Management Studio 2005
you have to associate the extension to the program by:
* Tools - Options - Text Editor - File Extnesion - Extension:
"PRC" - Editor: "SQL Query Editor"
It's a pain that MSSQL Management Studio 2005 doesn't recognize the
"PRC" file extension automatically, but as long as there is a
work-around I guess I'll live.

PRC file extensions in MSSQL Management Studio 2005

Most of our files were scripted out to our VSS as PRC files. In MSSQL
Management Studio 2005 these file extensions are not recognized by the
compiler as SQL text. Now I could go into VSS and change all my
extensions to SQL, but I feel like that would be a very time consuming
task. Is there a way to have MSSQL Management Studio 2005 recognize
this as executable SQL text?
Thanks,
MikeI found the answer to my own question. In MSSQL Management Studio 2005
you have to associate the extension to the program by:
* Tools - Options - Text Editor - File Extnesion - Extension:
"PRC" - Editor: "SQL Query Editor"
It's a pain that MSSQL Management Studio 2005 doesn't recognize the
"PRC" file extension automatically, but as long as there is a
work-around I guess I'll live.

PRC file extensions in MSSQL Management Studio 2005

Most of our files were scripted out to our VSS as PRC files. In MSSQL
Management Studio 2005 these file extensions are not recognized by the
compiler as SQL text. Now I could go into VSS and change all my
extensions to SQL, but I feel like that would be a very time consuming
task. Is there a way to have MSSQL Management Studio 2005 recognize
this as executable SQL text?
Thanks,
MikeI found the answer to my own question. In MSSQL Management Studio 2005
you have to associate the extension to the program by:
* Tools - Options - Text Editor - File Extnesion - Extension:
"PRC" - Editor: "SQL Query Editor"
It's a pain that MSSQL Management Studio 2005 doesn't recognize the
"PRC" file extension automatically, but as long as there is a
work-around I guess I'll live.

Powerpoint Integration

Is it planed to save data's on powerpoint file?

or better, to get data on a powerpoint template?

Thanks for answer

You can read or write directly PowerPoint file (or PowerPoint template) if this file is in XML style.

Office 2007 offer XML file as a standard, and you can save office 2003 files as XML files.

If you want to have a test, you need to write an Office 2003 Document (with Microsoft Word) and save as XML file (for example c:\TEST.XML). After you save this file you can open c:\TEST.XML file with NOTEPAD.EXE (or other text editor), and you can cange the text from that file (without affecting structure). You need to reopen c:\test.xml with Microsoft Office Word 2003 and you will see what it happend.

Friday, March 23, 2012

Potential issues with backing up to a network share

Hi
What potential issues can you think of or have run into when making
transaction log backups into a single file on a network share. The
MSSQLSERVER service is running under a domain user account, which has
apropriate permissions on the shared folder. The backup is made from a
database in an MS SQL Server 2000 SP3 on an MS Windows Server 2003 SP1 and
the file is stored on an MS Windows 2000 Server SP4.
Many thanks,
OskarIt's slow. If you have a busy OLTP and a large tran file, you can get
memory pressure during the backup. That being said we do it on many of our
servers.
"Oskar" <Oskar@.discussions.microsoft.com> wrote in message
news:ED49A03D-1FBC-42D2-84FA-C7987C0DF005@.microsoft.com...
> Hi
> What potential issues can you think of or have run into when making
> transaction log backups into a single file on a network share. The
> MSSQLSERVER service is running under a domain user account, which has
> apropriate permissions on the shared folder. The backup is made from a
> database in an MS SQL Server 2000 SP3 on an MS Windows Server 2003 SP1 and
> the file is stored on an MS Windows 2000 Server SP4.
> --
> Many thanks,
> Oskar
>sql

Potential issues with backing up to a network share

Hi
What potential issues can you think of or have run into when making
transaction log backups into a single file on a network share. The
MSSQLSERVER service is running under a domain user account, which has
apropriate permissions on the shared folder. The backup is made from a
database in an MS SQL Server 2000 SP3 on an MS Windows Server 2003 SP1 and
the file is stored on an MS Windows 2000 Server SP4.
Many thanks,
Oskar
It's slow. If you have a busy OLTP and a large tran file, you can get
memory pressure during the backup. That being said we do it on many of our
servers.
"Oskar" <Oskar@.discussions.microsoft.com> wrote in message
news:ED49A03D-1FBC-42D2-84FA-C7987C0DF005@.microsoft.com...
> Hi
> What potential issues can you think of or have run into when making
> transaction log backups into a single file on a network share. The
> MSSQLSERVER service is running under a domain user account, which has
> apropriate permissions on the shared folder. The backup is made from a
> database in an MS SQL Server 2000 SP3 on an MS Windows Server 2003 SP1 and
> the file is stored on an MS Windows 2000 Server SP4.
> --
> Many thanks,
> Oskar
>

Potential issues with backing up to a network share

Hi
What potential issues can you think of or have run into when making
transaction log backups into a single file on a network share. The
MSSQLSERVER service is running under a domain user account, which has
apropriate permissions on the shared folder. The backup is made from a
database in an MS SQL Server 2000 SP3 on an MS Windows Server 2003 SP1 and
the file is stored on an MS Windows 2000 Server SP4.
--
Many thanks,
OskarIt's slow. If you have a busy OLTP and a large tran file, you can get
memory pressure during the backup. That being said we do it on many of our
servers.
"Oskar" <Oskar@.discussions.microsoft.com> wrote in message
news:ED49A03D-1FBC-42D2-84FA-C7987C0DF005@.microsoft.com...
> Hi
> What potential issues can you think of or have run into when making
> transaction log backups into a single file on a network share. The
> MSSQLSERVER service is running under a domain user account, which has
> apropriate permissions on the shared folder. The backup is made from a
> database in an MS SQL Server 2000 SP3 on an MS Windows Server 2003 SP1 and
> the file is stored on an MS Windows 2000 Server SP4.
> --
> Many thanks,
> Oskar
>

Monday, March 12, 2012

Possible Validation Problem with Flat File Between Two Data Flows in a Package

I have a package set up basically with two consecutive data flows. The first flow takes data from an OLE DB Source and stores it into a Flat File Destination. The second flow uses this same flat file as a source, alters the data, and stores the data in the same flat file, overwriting the old file. I set DelayValidation to True on the flat file. Still, here are the error messages I am receiving:

Error: 0xC020200E at DO, Flat File Destination [7676]: Cannot open the datafile "C:\Temp.txt".

Error: 0xC004701A at DO, DTS.Pipeline: component "Flat File Destination" (7676) failed the pre-execute phase and returned error code 0xC020200E.

I am new to SSIS, so I'm sure I have a setting wrong or something. Is the problem that SSIS is trying to write to a file from which it is simultaneously reading data?

Thank you.

Allen H wrote:

I have a package set up basically with two consecutive data flows. The first flow takes data from an OLE DB Source and stores it into a Flat File Destination. The second flow uses this same flat file as a source, alters the data, and stores the data in the same flat file, overwriting the old file. I set DelayValidation to True on the flat file. Still, here are the error messages I am receiving:

Error: 0xC020200E at DO, Flat File Destination [7676]: Cannot open the datafile "C:\Temp.txt".

Error: 0xC004701A at DO, DTS.Pipeline: component "Flat File Destination" (7676) failed the pre-execute phase and returned error code 0xC020200E.

I am new to SSIS, so I'm sure I have a setting wrong or something. Is the problem that SSIS is trying to write to a file from which it is simultaneously reading data?

Thank you.

You'll have to set DelayValidation=TRUE on the second data-flow.

You should probably use raw files rather than flat files. Unless that is you want to use the files elsewhere, other than in SSIS.

-Jamie

|||I tried some things in this order:

1) I set DelayValidation = TRUE on the second data flow. This was when I still had the flat files implemented. Same error as before.

2) I took out all of the flat files and put in raw files to store the data. Now when I run I get these new errors, based in the second data flow:

Error: 0xC0202069 at DO, Raw File Source [7848]: Unexpected end-of-file encountered while reading 4 bytes from file "C:\Temp.raw". The file ended prematurely because of an invalid file format.
Error: 0xC0047038 at DO, DTS.Pipeline: The PrimeOutput method on component "Raw File Source" (7848) returned error code 0x80004005. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.
Error: 0xC0047021 at DO, DTS.Pipeline: Thread "SourceThread0" has exited with error code 0xC0047038.
Error: 0xC0047039 at DO, DTS.Pipeline: Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.
Error: 0xC0047021 at DO, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0xC0047039.

3) This is just a question. Why raw files for this instead of flat files? The raw file is about 60% larger than the flat file after the data has been populated in each.
|||

Allen H wrote:

I tried some things in this order:

1) I set DelayValidation = TRUE on the second data flow. This was when I still had the flat files implemented. Same error as before.

2) I took out all of the flat files and put in raw files to store the data. Now when I run I get these new errors, based in the second data flow:

Error: 0xC0202069 at DO, Raw File Source [7848]: Unexpected end-of-file encountered while reading 4 bytes from file "C:\Temp.raw". The file ended prematurely because of an invalid file format.
Error: 0xC0047038 at DO, DTS.Pipeline: The PrimeOutput method on component "Raw File Source" (7848) returned error code 0x80004005. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.
Error: 0xC0047021 at DO, DTS.Pipeline: Thread "SourceThread0" has exited with error code 0xC0047038.
Error: 0xC0047039 at DO, DTS.Pipeline: Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.
Error: 0xC0047021 at DO, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0xC0047039.

Strange. Its as if the second data-flow is trying to read the file before it has finished been written. This would be consistent with the behaviour you were getting with flat files.

Allen H wrote:

3) This is just a question. Why raw files for this instead of flat files? The raw file is about 60% larger than the flat file after the data has been populated in each.

They're much much quicker.

-Jamie

|||

Allen H wrote:

I have a package set up basically with two consecutive data flows. The first flow takes data from an OLE DB Source and stores it into a Flat File Destination. The second flow uses this same flat file as a source, alters the data, and stores the data in the same flat file, overwriting the old file. I set DelayValidation to True on the flat file. Still, here are the error messages I am receiving:

Error: 0xC020200E at DO, Flat File Destination [7676]: Cannot open the datafile "C:\Temp.txt".

Error: 0xC004701A at DO, DTS.Pipeline: component "Flat File Destination" (7676) failed the pre-execute phase and returned error code 0xC020200E.

I am new to SSIS, so I'm sure I have a setting wrong or something. Is the problem that SSIS is trying to write to a file from which it is simultaneously reading data?

Thank you.

I think your problem is that you are trying to use the same flat file as a source and destination in the second data flow. SSIS has to get a write lock on the file to use it as a destination, but it probably can't since you've already got it open for reading. I'd alter Jamie's suggestion a bit: write the results of your first data flow to a RAW file, then use that as the source in your second data flow. Then have the second data flow write to the text file as it's destination. That way you are not trying to modifiy the source you are reading from, and you shouldn't get locking errors.

|||

jwelch wrote:

Allen H wrote:

I have a package set up basically with two consecutive data flows. The first flow takes data from an OLE DB Source and stores it into a Flat File Destination. The second flow uses this same flat file as a source, alters the data, and stores the data in the same flat file, overwriting the old file. I set DelayValidation to True on the flat file. Still, here are the error messages I am receiving:

Error: 0xC020200E at DO, Flat File Destination [7676]: Cannot open the datafile "C:\Temp.txt".

Error: 0xC004701A at DO, DTS.Pipeline: component "Flat File Destination" (7676) failed the pre-execute phase and returned error code 0xC020200E.

I am new to SSIS, so I'm sure I have a setting wrong or something. Is the problem that SSIS is trying to write to a file from which it is simultaneously reading data?

Thank you.

I think your problem is that you are trying to use the same flat file as a source and destination in the second data flow. SSIS has to get a write lock on the file to use it as a destination, but it probably can't since you've already got it open for reading. I'd alter Jamie's suggestion a bit: write the results of your first data flow to a RAW file, then use that as the source in your second data flow. Then have the second data flow write to the text file as it's destination. That way you are not trying to modifiy the source you are reading from, and you shouldn't get locking errors.

Yeah John's spot on. I glossed over this bit initially: "...and stores the data in the same flat file..."

Sorry about that.

Thanks John.

-Jamie

Friday, March 9, 2012

Possible to make "Detail View" default in Report Mgr?

Is there a config file where this can be modified such that the views in http://SomeWebServer/Reports will be Details view by default?Still wondering about this. I reviewed the CSS one day for the site, but didn't see this in there.

Possible to make "Detail View" default in Report Mgr?

Is there a config file where this can be modified such that the views in http://SomeWebServer/Reports will be Details view by default?Still wondering about this. I reviewed the CSS one day for the site, but didn't see this in there.

Wednesday, March 7, 2012

Possible to deploy website applications using MDF database file?

Hi,

A quick question, is it possible to deploy a website on a shared hosting environment which attaches to a MDF database file stored in the App_Data folder?

Hi,

you have to ask your hosting company for that. I once tested a host that supported it but I had to attach it on the host by using a dedicated screen.

Grz, Kris.

Possible Solution to Keeping Log Size Under Control During INDEXDEFRAG

If I just backed up the log to a network drive every 15 minutes or so
during an INDEXDEFRAG wouldn't that keep the file size under control? I
have an extensive defrag that I've only been able to get partially
through because of space and I figure this will let me run it completely
in one shot.
Hi Brad,
Backing up the transaction log at regular intervals during an INDEXDEFRAG
will indeed prevent you from running out of transaction log space. DBCC
INDEXDEFRAG, in contrast to DBCC DBREINDEX, uses a large number of small
transactions to reorganise the indexes. So there are no long running
transaction that will prevent the transaction log from being emptied when it
is backed up.
Jacco Schalkwijk
SQL Server MVP
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.
|||Brad,
Since IndexDefrag uses a lot of small transactions you can certainly backup
the log during it to keep it's size reasonable. But how much gets logged
and how fast depends on the fragmentation level of the Index and the
hardware your running it on. As such it is hard to say whether 15 minutes
is appropriate or not. Only you can determine that with testing. Most
people run log backups every 15 minutes or less anyway. Since your
apparently doing log backups at fairly long intervals I assume it is not
that busy of a system. If that is the case you might consider doing a
DBREINDEX every few days or once a week to keep the fragmentation down. You
can do indexdefrags in between if necessary. You might want to check this
out:
http://www.microsoft.com/technet/pro.../ss2kidbp.mspx
Andrew J. Kelly SQL MVP
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.
|||In article <Oy7PTC9dEHA.3964@.TK2MSFTNGP10.phx.gbl>,
sqlmvpnooospam@.shadhawk.com says...

> "Brad" <brad@.seesigifthere.com> wrote in message
> news:MPG.1b76bd01ae8a965e989685@.news...
> Since IndexDefrag uses a lot of small transactions you can certainly backup
> the log during it to keep it's size reasonable. But how much gets logged
> and how fast depends on the fragmentation level of the Index and the
> hardware your running it on. As such it is hard to say whether 15 minutes
> is appropriate or not. Only you can determine that with testing. Most
> people run log backups every 15 minutes or less anyway. Since your
> apparently doing log backups at fairly long intervals I assume it is not
> that busy of a system. If that is the case you might consider doing a
> DBREINDEX every few days or once a week to keep the fragmentation down. You
> can do indexdefrags in between if necessary. You might want to check this
> out:
> http://www.microsoft.com/technet/pro.../ss2kidbp.mspx
It actually is a very busy system, but we are in the process of changing
our backup strategy. Right now I am rolling my own log shipping (since
it's standard and not enterprise), but I am still doing the backups
manually to oversee the process.
The main reason I'm doing the log shipping myself is that the standby
server only has web connectivity into the environment, so I have a
process that backs up the log on the production server, zips it up and
tells the standby server that the log is ready. The standby then pulls
down the zipped log with wget, unzips it and applies it to the local
database. It's working pretty well.
|||Tying to guess the appropriate log backup interval may require a lot of
trial and error.
There may be an easier way. You can set up an alert that fires whenever the
log file reaches a specified % (try maybe 60%). When it fires, the alert
can be configured to execute a job that backs up the log file.
Mark
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.
|||Oops, sorry about the "from" name. Just set up my newsgroups on a new
computer and did not configure that correctly.
Mark
"msnews.microsoft.com" <nosapm@.nospam.com> wrote in message
news:ujNUzGDeEHA.1048@.tk2msftngp13.phx.gbl...
> Tying to guess the appropriate log backup interval may require a lot of
> trial and error.
> There may be an easier way. You can set up an alert that fires whenever
the
> log file reaches a specified % (try maybe 60%). When it fires, the alert
> can be configured to execute a job that backs up the log file.
> Mark
> "Brad" <brad@.seesigifthere.com> wrote in message
> news:MPG.1b76bd01ae8a965e989685@.news...
>

Possible Solution to Keeping Log Size Under Control During INDEXDEFRAG

If I just backed up the log to a network drive every 15 minutes or so
during an INDEXDEFRAG wouldn't that keep the file size under control? I
have an extensive defrag that I've only been able to get partially
through because of space and I figure this will let me run it completely
in one shot.Hi Brad,
Backing up the transaction log at regular intervals during an INDEXDEFRAG
will indeed prevent you from running out of transaction log space. DBCC
INDEXDEFRAG, in contrast to DBCC DBREINDEX, uses a large number of small
transactions to reorganise the indexes. So there are no long running
transaction that will prevent the transaction log from being emptied when it
is backed up.
--
Jacco Schalkwijk
SQL Server MVP
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.|||Brad,
Since IndexDefrag uses a lot of small transactions you can certainly backup
the log during it to keep it's size reasonable. But how much gets logged
and how fast depends on the fragmentation level of the Index and the
hardware your running it on. As such it is hard to say whether 15 minutes
is appropriate or not. Only you can determine that with testing. Most
people run log backups every 15 minutes or less anyway. Since your
apparently doing log backups at fairly long intervals I assume it is not
that busy of a system. If that is the case you might consider doing a
DBREINDEX every few days or once a week to keep the fragmentation down. You
can do indexdefrags in between if necessary. You might want to check this
out:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx
Andrew J. Kelly SQL MVP
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.|||In article <Oy7PTC9dEHA.3964@.TK2MSFTNGP10.phx.gbl>,
sqlmvpnooospam@.shadhawk.com says...
> "Brad" <brad@.seesigifthere.com> wrote in message
> news:MPG.1b76bd01ae8a965e989685@.news...
> > If I just backed up the log to a network drive every 15 minutes or so
> > during an INDEXDEFRAG wouldn't that keep the file size under control? I
> > have an extensive defrag that I've only been able to get partially
> > through because of space and I figure this will let me run it completely
> > in one shot.
> Since IndexDefrag uses a lot of small transactions you can certainly backup
> the log during it to keep it's size reasonable. But how much gets logged
> and how fast depends on the fragmentation level of the Index and the
> hardware your running it on. As such it is hard to say whether 15 minutes
> is appropriate or not. Only you can determine that with testing. Most
> people run log backups every 15 minutes or less anyway. Since your
> apparently doing log backups at fairly long intervals I assume it is not
> that busy of a system. If that is the case you might consider doing a
> DBREINDEX every few days or once a week to keep the fragmentation down. You
> can do indexdefrags in between if necessary. You might want to check this
> out:
> http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx
It actually is a very busy system, but we are in the process of changing
our backup strategy. Right now I am rolling my own log shipping (since
it's standard and not enterprise), but I am still doing the backups
manually to oversee the process.
The main reason I'm doing the log shipping myself is that the standby
server only has web connectivity into the environment, so I have a
process that backs up the log on the production server, zips it up and
tells the standby server that the log is ready. The standby then pulls
down the zipped log with wget, unzips it and applies it to the local
database. It's working pretty well.|||Tying to guess the appropriate log backup interval may require a lot of
trial and error.
There may be an easier way. You can set up an alert that fires whenever the
log file reaches a specified % (try maybe 60%). When it fires, the alert
can be configured to execute a job that backs up the log file.
Mark
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.|||Oops, sorry about the "from" name. Just set up my newsgroups on a new
computer and did not configure that correctly.
Mark
"msnews.microsoft.com" <nosapm@.nospam.com> wrote in message
news:ujNUzGDeEHA.1048@.tk2msftngp13.phx.gbl...
> Tying to guess the appropriate log backup interval may require a lot of
> trial and error.
> There may be an easier way. You can set up an alert that fires whenever
the
> log file reaches a specified % (try maybe 60%). When it fires, the alert
> can be configured to execute a job that backs up the log file.
> Mark
> "Brad" <brad@.seesigifthere.com> wrote in message
> news:MPG.1b76bd01ae8a965e989685@.news...
> > If I just backed up the log to a network drive every 15 minutes or so
> > during an INDEXDEFRAG wouldn't that keep the file size under control? I
> > have an extensive defrag that I've only been able to get partially
> > through because of space and I figure this will let me run it completely
> > in one shot.
>

Possible Solution to Keeping Log Size Under Control During INDEXDEFRAG

If I just backed up the log to a network drive every 15 minutes or so
during an INDEXDEFRAG wouldn't that keep the file size under control? I
have an extensive defrag that I've only been able to get partially
through because of space and I figure this will let me run it completely
in one shot.Hi Brad,
Backing up the transaction log at regular intervals during an INDEXDEFRAG
will indeed prevent you from running out of transaction log space. DBCC
INDEXDEFRAG, in contrast to DBCC DBREINDEX, uses a large number of small
transactions to reorganise the indexes. So there are no long running
transaction that will prevent the transaction log from being emptied when it
is backed up.
Jacco Schalkwijk
SQL Server MVP
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.|||Brad,
Since IndexDefrag uses a lot of small transactions you can certainly backup
the log during it to keep it's size reasonable. But how much gets logged
and how fast depends on the fragmentation level of the Index and the
hardware your running it on. As such it is hard to say whether 15 minutes
is appropriate or not. Only you can determine that with testing. Most
people run log backups every 15 minutes or less anyway. Since your
apparently doing log backups at fairly long intervals I assume it is not
that busy of a system. If that is the case you might consider doing a
DBREINDEX every few days or once a week to keep the fragmentation down. You
can do indexdefrags in between if necessary. You might want to check this
out:
http://www.microsoft.com/technet/pr...n/ss2kidbp.mspx
Andrew J. Kelly SQL MVP
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.|||In article <Oy7PTC9dEHA.3964@.TK2MSFTNGP10.phx.gbl>,
sqlmvpnooospam@.shadhawk.com says...
[vbcol=seagreen]
> "Brad" <brad@.seesigifthere.com> wrote in message
> news:MPG.1b76bd01ae8a965e989685@.news...
> Since IndexDefrag uses a lot of small transactions you can certainly backu
p
> the log during it to keep it's size reasonable. But how much gets logged
> and how fast depends on the fragmentation level of the Index and the
> hardware your running it on. As such it is hard to say whether 15 minutes
> is appropriate or not. Only you can determine that with testing. Most
> people run log backups every 15 minutes or less anyway. Since your
> apparently doing log backups at fairly long intervals I assume it is not
> that busy of a system. If that is the case you might consider doing a
> DBREINDEX every few days or once a week to keep the fragmentation down. Y
ou
> can do indexdefrags in between if necessary. You might want to check this
> out:
> http://www.microsoft.com/technet/pr...n/ss2kidbp.mspx[/vbco
l]
It actually is a very busy system, but we are in the process of changing
our backup strategy. Right now I am rolling my own log shipping (since
it's standard and not enterprise), but I am still doing the backups
manually to oversee the process.
The main reason I'm doing the log shipping myself is that the standby
server only has web connectivity into the environment, so I have a
process that backs up the log on the production server, zips it up and
tells the standby server that the log is ready. The standby then pulls
down the zipped log with wget, unzips it and applies it to the local
database. It's working pretty well.|||Tying to guess the appropriate log backup interval may require a lot of
trial and error.
There may be an easier way. You can set up an alert that fires whenever the
log file reaches a specified % (try maybe 60%). When it fires, the alert
can be configured to execute a job that backs up the log file.
Mark
"Brad" <brad@.seesigifthere.com> wrote in message
news:MPG.1b76bd01ae8a965e989685@.news...
> If I just backed up the log to a network drive every 15 minutes or so
> during an INDEXDEFRAG wouldn't that keep the file size under control? I
> have an extensive defrag that I've only been able to get partially
> through because of space and I figure this will let me run it completely
> in one shot.|||Oops, sorry about the "from" name. Just set up my newsgroups on a new
computer and did not configure that correctly.
Mark
"msnews.microsoft.com" <nosapm@.nospam.com> wrote in message
news:ujNUzGDeEHA.1048@.tk2msftngp13.phx.gbl...
> Tying to guess the appropriate log backup interval may require a lot of
> trial and error.
> There may be an easier way. You can set up an alert that fires whenever
the
> log file reaches a specified % (try maybe 60%). When it fires, the alert
> can be configured to execute a job that backs up the log file.
> Mark
> "Brad" <brad@.seesigifthere.com> wrote in message
> news:MPG.1b76bd01ae8a965e989685@.news...
>

Saturday, February 25, 2012

Possible DTS File Import Bug

Env: SQL Server 2000 on in WIN NT 5.x
Job: import mutiple flat files into several tables daily.
Catch: one or two of the several flat files might be empty.

First thought/test:
Use [first row as fields] option for the import process.
Problem, DTS can't complete (as a package).

As an alternative, I could probably detect if a file is empty then
decide what to do with it, with VB activeX, it might be feasible,
question, VB has a command for "FileExist", how about "FileLen" or the
like for determining the length of a file?

TIA.Hi

See http://www.sqldts.com/default.aspx?292 and
http://www.sqldts.com/default.aspx?246

John

"NickName" <dadada@.rock.com> wrote in message
news:1102971903.347486.145350@.f14g2000cwb.googlegr oups.com...
> Env: SQL Server 2000 on in WIN NT 5.x
> Job: import mutiple flat files into several tables daily.
> Catch: one or two of the several flat files might be empty.
> First thought/test:
> Use [first row as fields] option for the import process.
> Problem, DTS can't complete (as a package).
> As an alternative, I could probably detect if a file is empty then
> decide what to do with it, with VB activeX, it might be feasible,
> question, VB has a command for "FileExist", how about "FileLen" or the
> like for determining the length of a file?
> TIA.|||Very helpful. Thank you.|||Very helpful. Thank you. However, activeX problem, error obj "string
C:\myDir\file1.csv" required, the code seems to be correct.

' File Size
' check file size if empty | 0 quit

Option Explicit

Function Main()

Dim oFSO
Dim oFile
Dim sSourceFile

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set sSourceFile = "C:\myDir\file1.csv"

Set sSourceFileV = sSourceFile.Value

Set oFile = oFSO.GetFile(sSourceFileV)

If oFile.Size > 0 Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If
' Clean Up
Set oFile = Nothing
Set oFSO = Nothing
End Function|||Never mind about the activeX error, the objFile.Value attribute was
unnecessary. But the "connectors" does not seem to have an option to
connect this ActiveX script with a package and making sure run the
ActiveX script first, instead of last.

TIA.|||Hi

You can use workflow to govern the order of the steps, if you had one or
more files to process then you can use the looping example
http://www.sqldts.com/default.aspx?246, although I would expect a three way
split for in the shouldILoop procedure or a second comparison step to cater
for files with size, files with no size and no files to process.

In your code sSourceFileV is not needed, use
Set oFile = oFSO.GetFile(sSourceFile)

John

"NickName" <dadada@.rock.com> wrote in message
news:1103038306.437005.86870@.f14g2000cwb.googlegro ups.com...
> Very helpful. Thank you. However, activeX problem, error obj "string
> C:\myDir\file1.csv" required, the code seems to be correct.
> ' File Size
> ' check file size if empty | 0 quit
> Option Explicit
> Function Main()
> Dim oFSO
> Dim oFile
> Dim sSourceFile
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> Set sSourceFile = "C:\myDir\file1.csv"
> Set sSourceFileV = sSourceFile.Value
> Set oFile = oFSO.GetFile(sSourceFileV)
> If oFile.Size > 0 Then
> Main = DTSTaskExecResult_Success
> Else
> Main = DTSTaskExecResult_Failure
> End If
> ' Clean Up
> Set oFile = Nothing
> Set oFSO = Nothing
> End Function|||Hi

You can use workflow to determine the order of execution.

John

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

possible bug: sp_attach_single_file_db

The scenario:
The server in question has its Default Log Directory set
to "L:\". I used sp_attach_single_file_db to attach an
mdf file. Here is the command that I used:
EXEC sp_attach_single_file_db @.dbname = 'test2',
@.physname = 'f:\test2_Data.MDF'
I received the following error:
Device activation error. The physical file
name 'L:\test2_Log.LDF' may be incorrect.
New log file 'L:\\test2_log.LDF' was created.
Notice the 2 back-slashes in the path of the log file! I
didn't notice it at first, and eventually attempted to
restore the database from a backup taken from a different
server, using a 'with move'. Here is the command that I
used for that:
RESTORE DATABASE test2
FROM DISK = 'x:\test2.bak'
with MOVE 'test2_Data' TO 'f:\SQL_Data\test2_Data.mdf',
MOVE 'test2_Log' TO 'L:\test2_Log.ldf'
and the response:
Server: Msg 3156, Level 16, State 1, Line 1
File 'test2_Log' cannot be restored to 'L:\test2_Log.ldf'.
Use WITH MOVE to identify a valid location for the file.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
When I discovered the source of the problem, I inserted
the second back-slash in the move clause, and the restore
worked.
So, there may actually be 2 issues:
1. The extra back-slash that SQL expects to be in the path.
2. The erroneous error message associated with the restore
statement.
Has anyone else seen this?
Steve Phelps
SQL Server DBA
American Fidelity GroupThe extra backslash is due to a bug in EM in that if you use the browse
button to select the default directories it appends the trailing backslash
to the folder path, SQL actually expects the value to not have a trailing
backslash (easily ammended in EM by removing it although it generally
doesn't cause problems except the filename looking funny. Not come across
the restore issue, I'll try and repro that.
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Steve Phelps" <Steve.Phelps@.af-group.com> wrote in message
news:014201c356ce$1fa90c50$a601280a@.phx.gbl...
The scenario:
The server in question has its Default Log Directory set
to "L:\". I used sp_attach_single_file_db to attach an
mdf file. Here is the command that I used:
EXEC sp_attach_single_file_db @.dbname = 'test2',
@.physname = 'f:\test2_Data.MDF'
I received the following error:
Device activation error. The physical file
name 'L:\test2_Log.LDF' may be incorrect.
New log file 'L:\\test2_log.LDF' was created.
Notice the 2 back-slashes in the path of the log file! I
didn't notice it at first, and eventually attempted to
restore the database from a backup taken from a different
server, using a 'with move'. Here is the command that I
used for that:
RESTORE DATABASE test2
FROM DISK = 'x:\test2.bak'
with MOVE 'test2_Data' TO 'f:\SQL_Data\test2_Data.mdf',
MOVE 'test2_Log' TO 'L:\test2_Log.ldf'
and the response:
Server: Msg 3156, Level 16, State 1, Line 1
File 'test2_Log' cannot be restored to 'L:\test2_Log.ldf'.
Use WITH MOVE to identify a valid location for the file.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
When I discovered the source of the problem, I inserted
the second back-slash in the move clause, and the restore
worked.
So, there may actually be 2 issues:
1. The extra back-slash that SQL expects to be in the path.
2. The erroneous error message associated with the restore
statement.
Has anyone else seen this?
Steve Phelps
SQL Server DBA
American Fidelity Group|||You are aware you have to restart the SQL Service for changes to the default
directory to take effect ? A little test I did was to create a database when
the default log directory had a trailing backslash and confirm it had a \\
in it's name. Change the default log directory to remove the trailing
backslash and restart the SQL Service. I then detached the database created
earlier, deleted the log file and attached it using
sp_attach_single_file_db. This created the log file with the correct path
(no \\) . The device activation error referred to the path with the \\ in it
because it's reading the original logfile location from the database header
in the mdf file. Hope this makes things a little clearer
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Steve Phelps" <Steve.Phelps@.af-group.com> wrote in message
news:038101c356e2$dc0aaa70$a501280a@.phx.gbl...
Jasper,
Thanks for the quick response. I had considererd that
possibility and tried both with and without the slash when
I set the default directory. In neither case did I use
the browse button for that purpose. In both cases, the
default directory *appeared* to have been set properly.
Only when I used the sp_attach_single_file_db stored
procedure did the problem arise. My original thought was
that it was a bug in the stored proc. I hadn't looked at
the source code because I assumed that it was encrypted.
It isn't. I parsed out the code that builds the "Create
database" statement and executed it, printing the
resulting command:
CREATE DATABASE [test2]
ON (FILENAME ='f:\sql_data\test2_data.mdf' )
FOR ATTACH
then pasted it into Query Analyzer and executed it. Got
the same result. The new log file's path contains 2
slashes.
Steve Phelps
SQL Server DBA
American Fidelity Group
>--Original Message--
>The extra backslash is due to a bug in EM in that if you
use the browse
>button to select the default directories it appends the
trailing backslash
>to the folder path, SQL actually expects the value to not
have a trailing
>backslash (easily ammended in EM by removing it although
it generally
>doesn't cause problems except the filename looking funny.
Not come across
>the restore issue, I'll try and repro that.
>--
>HTH
>Jasper Smith (SQL Server MVP)
>I support PASS - the definitive, global
>community for SQL Server professionals -
>http://www.sqlpass.org
>"Steve Phelps" <Steve.Phelps@.af-group.com> wrote in
message
>news:014201c356ce$1fa90c50$a601280a@.phx.gbl...
>The scenario:
>The server in question has its Default Log Directory set
>to "L:\". I used sp_attach_single_file_db to attach an
>mdf file. Here is the command that I used:
>EXEC sp_attach_single_file_db @.dbname = 'test2',
> @.physname = 'f:\test2_Data.MDF'
>I received the following error:
>Device activation error. The physical file
>name 'L:\test2_Log.LDF' may be incorrect.
>New log file 'L:\\test2_log.LDF' was created.
>Notice the 2 back-slashes in the path of the log file! I
>didn't notice it at first, and eventually attempted to
>restore the database from a backup taken from a different
>server, using a 'with move'. Here is the command that I
>used for that:
>RESTORE DATABASE test2
> FROM DISK = 'x:\test2.bak'
> with MOVE 'test2_Data' TO 'f:\SQL_Data\test2_Data.mdf',
> MOVE 'test2_Log' TO 'L:\test2_Log.ldf'
>and the response:
>Server: Msg 3156, Level 16, State 1, Line 1
>File 'test2_Log' cannot be restored to 'L:\test2_Log.ldf'.
>Use WITH MOVE to identify a valid location for the file.
>Server: Msg 3013, Level 16, State 1, Line 1
>RESTORE DATABASE is terminating abnormally.
>When I discovered the source of the problem, I inserted
>the second back-slash in the move clause, and the restore
>worked.
>So, there may actually be 2 issues:
>1. The extra back-slash that SQL expects to be in the
path.
>2. The erroneous error message associated with the restore
>statement.
>Has anyone else seen this?
>Steve Phelps
>SQL Server DBA
>American Fidelity Group
>
>.
>