Dear friends,
I have some small questions related to the replication please see if you can
help me.
1. I want to add a article in the merge replicaiton which i can do with
sp_addmergearticle procedure but i want that the snapshot should
automatically run after the same. Please also suggest can user keep on
working while adding and rerunning the snapshot.
2. How can i drop the Article while the replication is on.
3. Which procedure will allow me to Chnage teh Defination of the fields
while the replication is on.
4. How can i drop the Column while replication is on.
Thanks and best regards
Sharad
Sharad,
to add the article, use sp_addmergearticle. This way, you can use
sp_start_job to initiate the snapshot agent.
to drop the article using transactional, use :
exec sp_dropsubscription @.publication = 'tTestFNames'
, @.article = 'tEmployees'
, @.subscriber = 'RSCOMPUTER'
, @.destination_db = 'testrep'
exec sp_droparticle @.publication = 'tTestFNames'
, @.article = 'tEmployees'
(for transactional).
For merge, this is not possible and you'd have to drop the publication to be
able to do it.
To change the field definition in SQL Server 2000 look at this:
http://www.replicationanswers.com/AddColumn.asp
In SQL Server 2005, this should help:
http://www.replicationanswers.com/AlterSchema2005.asp
To drop a column, look at sp_repldropcolumn
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts
Tuesday, March 27, 2012
Monday, March 26, 2012
Fetch limited rows sequentially
Hello Friends,
I want to fetch limited rows from single query (example:-1000 rows present in emp table , I want to fetch first 10 rows at a time and store in a file. Next iteration it has to fetch next 10 rows and store in another file like this it has to create 10 different files with 10 rows)
Thanks in advance
Waiting early reply
Regds
NitinHi Nitin,
SELECT *
FROM (SELECT TOP 10 *
FROM (SELECT TOP 20 *
FROM emp
ORDER BY LName ASC) AS t1
ORDER BY LName DESC) as t2
ORDER BY LName
This select will return the 10 after the first ten from emps table. Just loop through increasing the TOP 20 to TOP 30 and so on to get each interval of ten employers.
Hope this helps! :)
Robert
I want to fetch limited rows from single query (example:-1000 rows present in emp table , I want to fetch first 10 rows at a time and store in a file. Next iteration it has to fetch next 10 rows and store in another file like this it has to create 10 different files with 10 rows)
Thanks in advance
Waiting early reply
Regds
NitinHi Nitin,
SELECT *
FROM (SELECT TOP 10 *
FROM (SELECT TOP 20 *
FROM emp
ORDER BY LName ASC) AS t1
ORDER BY LName DESC) as t2
ORDER BY LName
This select will return the 10 after the first ten from emps table. Just loop through increasing the TOP 20 to TOP 30 and so on to get each interval of ten employers.
Hope this helps! :)
Robert
Subscribe to:
Posts (Atom)