Is there a way to drop replication on a restore. Or, is there a way to
backup without saving the replication information? I tried setting
KEEP_REPLICATION for false but if its is the original server the
replication still shows up. I also tried running
sp_restoredbreplication on the database after I restored it. However
the query analyzer said it completed successfully but I still show a
publication. I want to restore an not have the publication show up so
we can rebuild the replication and in 2 cases not replicate anymore.
If you have it in SQLDMO would be grand but right now anything would
help.
Thanks for your help.
gslim
Its a little tricky. Some of the replication metadata remains. I find it
necessary to go in there and delete it manually.
BTW Are we talking merge or transactional?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Shane Lim" <gslim@.blizzardice.com> wrote in message
news:iq1v71d1un7ujjnr0d76n9gr501ar680uh@.4ax.com...
> Is there a way to drop replication on a restore. Or, is there a way to
> backup without saving the replication information? I tried setting
> KEEP_REPLICATION for false but if its is the original server the
> replication still shows up. I also tried running
> sp_restoredbreplication on the database after I restored it. However
> the query analyzer said it completed successfully but I still show a
> publication. I want to restore an not have the publication show up so
> we can rebuild the replication and in 2 cases not replicate anymore.
> If you have it in SQLDMO would be grand but right now anything would
> help.
> Thanks for your help.
> gslim
>
|||We are talking about merge replication.
I was running sp_restoredbreplication but I am going to try also
running sp_removedbreplication (suggested by Paul Ibison in another
thread I found.) after that and try again.
gslim
On Mon, 9 May 2005 12:37:06 -0400, "Hilary Cotter"
<hilary.cotter@.gmail.com> wrote:
>Its a little tricky. Some of the replication metadata remains. I find it
>necessary to go in there and delete it manually.
>BTW Are we talking merge or transactional?
|||Ok so currently I run both of the stored procedure
sp_removedbreplication
then
sp_restoredbreplication
and I can create the publication fine.
However when I create the subscription I still get the error on the
subscription of
Invalid object name 'dbo.sysmergearticles'
Any ideas?
On Tue, 10 May 2005 08:47:45 -0600, Shane Lim <gslim@.blizzardice.com>
wrote:
[vbcol=seagreen]
>We are talking about merge replication.
>I was running sp_restoredbreplication but I am going to try also
>running sp_removedbreplication (suggested by Paul Ibison in another
>thread I found.) after that and try again.
>gslim
>On Mon, 9 May 2005 12:37:06 -0400, "Hilary Cotter"
><hilary.cotter@.gmail.com> wrote:
Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts
Friday, March 30, 2012
Wednesday, March 28, 2012
Restore TSQL Scripts
Hi
I would like to creat a job in MS SQL Server 2000 to do the following:
1. Drop Test_DB
2. Restore Current_DB (latest backup in my_dir) as Test_DB
Can anyone help me on this? I think it is a simple as
--start code
DROP DATABASE Test_DB
GO
RESTORE DATABASE Test_DB
FROM Current_DB ?
GO
--end code
It is the second line that bothers me. I want to restore the most
recent backup of Current_DB. How can I get and specify this info?
Also, when I use EM to restore it gives me the option to rename the
files, can I specify this too?
thanks
dabenTry something like:
RESTORE DATABASE Test_DB
FROM DISK='C:\My_Dir\Current_DB.bak'
WITH
MOVE 'Current_DB' TO 'E:\DataFiles\Test_DB.mdf',
MOVE 'Current_DB_Log' TO 'C:\LogFiles\Test_DB_Log.ldf',
REPLACE
GO
You find the names log the logical files for the above command with
RESTORE FILELISTONLY:
RESTORE FILELISTONLY
FROM DISK='C:\MyDir\Current_DB.bak'
GO
See RESTORE in the Books Online for more information.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"daben" <dabenpb@.yahoo.com> wrote in message
news:1adbeff3.0309111224.1fe1b9ac@.posting.google.com...
> Hi
> I would like to creat a job in MS SQL Server 2000 to do the following:
> 1. Drop Test_DB
> 2. Restore Current_DB (latest backup in my_dir) as Test_DB
> Can anyone help me on this? I think it is a simple as
> --start code
> DROP DATABASE Test_DB
> GO
> RESTORE DATABASE Test_DB
> FROM Current_DB ?
> GO
> --end code
> It is the second line that bothers me. I want to restore the most
> recent backup of Current_DB. How can I get and specify this info?
> Also, when I use EM to restore it gives me the option to rename the
> files, can I specify this too?
> thanks
> daben
I would like to creat a job in MS SQL Server 2000 to do the following:
1. Drop Test_DB
2. Restore Current_DB (latest backup in my_dir) as Test_DB
Can anyone help me on this? I think it is a simple as
--start code
DROP DATABASE Test_DB
GO
RESTORE DATABASE Test_DB
FROM Current_DB ?
GO
--end code
It is the second line that bothers me. I want to restore the most
recent backup of Current_DB. How can I get and specify this info?
Also, when I use EM to restore it gives me the option to rename the
files, can I specify this too?
thanks
dabenTry something like:
RESTORE DATABASE Test_DB
FROM DISK='C:\My_Dir\Current_DB.bak'
WITH
MOVE 'Current_DB' TO 'E:\DataFiles\Test_DB.mdf',
MOVE 'Current_DB_Log' TO 'C:\LogFiles\Test_DB_Log.ldf',
REPLACE
GO
You find the names log the logical files for the above command with
RESTORE FILELISTONLY:
RESTORE FILELISTONLY
FROM DISK='C:\MyDir\Current_DB.bak'
GO
See RESTORE in the Books Online for more information.
--
Hope this helps.
Dan Guzman
SQL Server MVP
--
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--
"daben" <dabenpb@.yahoo.com> wrote in message
news:1adbeff3.0309111224.1fe1b9ac@.posting.google.com...
> Hi
> I would like to creat a job in MS SQL Server 2000 to do the following:
> 1. Drop Test_DB
> 2. Restore Current_DB (latest backup in my_dir) as Test_DB
> Can anyone help me on this? I think it is a simple as
> --start code
> DROP DATABASE Test_DB
> GO
> RESTORE DATABASE Test_DB
> FROM Current_DB ?
> GO
> --end code
> It is the second line that bothers me. I want to restore the most
> recent backup of Current_DB. How can I get and specify this info?
> Also, when I use EM to restore it gives me the option to rename the
> files, can I specify this too?
> thanks
> daben
Subscribe to:
Posts (Atom)