Created
July 20, 2012 17:42
-
-
Save anonymous/3152160 to your computer and use it in GitHub Desktop.
Create Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------ WORKING | |
use [thedb] | |
exec sp_addpublication @publication = N'thedb_THETABLE', @description = N'Transactional publication of database ''thedb'' from Publisher ''SOURCE''.', @sync_method = N'concurrent', @retention = 0, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'false', @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21, @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false', @repl_freq = N'continuous', @status = N'active', @independent_agent = N'true', @immediate_sync = N'false', @allow_sync_tran = N'false', @autogen_sync_procs = N'false', @allow_queued_tran = N'false', @allow_dts = N'false', @logreader_job_name = N'SOURCE-thedb-7', @qreader_job_name = N'[DESTINATION].8' | |
GO | |
exec sp_addpublication_snapshot @publication = N'thedb_THETABLE', @frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 0, @frequency_subday = 8, @frequency_subday_interval = 1, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 0, @active_end_date = 0, @snapshot_job_name = N'SOURCE-thedb-thedb_THETABLE-60' | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'sa' | |
GO | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'BUILTIN\Administrators' | |
GO | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'DOMAIN\SvcSQL' | |
GO | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'DOMAIN\SQL Server Administrators' | |
GO | |
use [thedb] | |
exec sp_addarticle @publication = N'thedb_THETABLE', @article = N'tTHETABLE100', @source_owner = N'dbo', @source_object = N'tTHETABLE100', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x00000000000080A3, @auto_identity_range = N'false', @destination_table = N'tTHETABLE100', @destination_owner = N'dbo', @status = 16, @vertical_partition = N'false', @ins_cmd = N'CALL sp_MSins_dbotTHETABLE100', @del_cmd = N'CALL sp_MSdel_dbotTHETABLE100', @upd_cmd = N'MCALL sp_MSupd_dbotTHETABLE100' | |
GO | |
use [thedb] | |
exec sp_addarticle @publication = N'thedb_THETABLE', @article = N'tTHETABLE192', @source_owner = N'dbo', @source_object = N'tTHETABLE192', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x00000000000080A3, @auto_identity_range = N'false', @destination_table = N'tTHETABLE192', @destination_owner = N'dbo', @status = 16, @vertical_partition = N'false', @ins_cmd = N'CALL sp_MSins_dbotTHETABLE192', @del_cmd = N'CALL sp_MSdel_dbotTHETABLE192', @upd_cmd = N'MCALL sp_MSupd_dbotTHETABLE192' | |
GO | |
use [thedb] | |
exec sp_addarticle @publication = N'thedb_THETABLE', @article = N'tTHETABLE199', @source_owner = N'dbo', @source_object = N'tTHETABLE199', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x00000000000080A3, @auto_identity_range = N'false', @destination_table = N'tTHETABLE199', @destination_owner = N'dbo', @status = 16, @vertical_partition = N'false', @ins_cmd = N'CALL sp_MSins_dbotTHETABLE199', @del_cmd = N'CALL sp_MSdel_dbotTHETABLE199', @upd_cmd = N'MCALL sp_MSupd_dbotTHETABLE199' | |
GO | |
use [thedb] | |
exec sp_addsubscription @publication = N'thedb_THETABLE', @subscriber = N'DESTINATION', @destination_db = N'SOURCE_thedb', @subscription_type = N'Push', @sync_type = N'automatic', @article = N'all', @update_mode = N'read only', @frequency_type = 64, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 0, @frequency_subday = 4, @frequency_subday_interval = 5, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 0, @active_end_date = 0, @offloadagent = 0, @dts_package_location = N'Distributor' | |
GO | |
--- NOT WORKING | |
use master | |
exec sp_replicationdboption @dbname = N'thedb', @optname = N'publish', @value = N'true' | |
GO | |
use [thedb] | |
exec sp_addpublication @publication = N'thedb_THETABLE', @description = N'Transactional publication of database ''thedb'' from Publisher ''SOURCE''.', @sync_method = N'concurrent', @retention = 0, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'false', @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21, @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false', @repl_freq = N'continuous', @status = N'active', @independent_agent = N'true', @immediate_sync = N'false', @allow_sync_tran = N'false', @autogen_sync_procs = N'false', @allow_queued_tran = N'false', @allow_dts = N'false', @logreader_job_name = N'SOURCE-thedb-28', @qreader_job_name = N'[DESTINATION].8' | |
GO | |
exec sp_addpublication_snapshot @publication = N'thedb_THETABLE', @frequency_type = 4, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 0, @frequency_subday = 8, @frequency_subday_interval = 1, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 0, @active_end_date = 0, @snapshot_job_name = N'SOURCE-thedb-thedb_THETABLE-180' | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'sa' | |
GO | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'BUILTIN\Administrators' | |
GO | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'DOMAIN\SvcSQL' | |
GO | |
exec sp_grant_publication_access @publication = N'thedb_THETABLE', @login = N'DOMAIN\SQL Server Administrators' | |
GO | |
use [thedb] | |
exec sp_addarticle @publication = N'thedb_THETABLE', @article = N'THETABLE100', @source_owner = N'dbo', @source_object = N'THETABLE100', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x00000000000080A3, @auto_identity_range = N'false', @destination_table = N'THETABLE100', @destination_owner = N'dbo', @status = 16, @vertical_partition = N'false', @ins_cmd = N'CALL sp_MSins_dboTHETABLE100', @del_cmd = N'CALL sp_MSdel_dboTHETABLE100', @upd_cmd = N'MCALL sp_MSupd_dboTHETABLE100' | |
GO | |
use [thedb] | |
exec sp_addarticle @publication = N'thedb_THETABLE', @article = N'THETABLE192', @source_owner = N'dbo', @source_object = N'THETABLE192', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x00000000000080A3, @auto_identity_range = N'false', @destination_table = N'THETABLE192', @destination_owner = N'dbo', @status = 16, @vertical_partition = N'false', @ins_cmd = N'CALL sp_MSins_dboTHETABLE192', @del_cmd = N'CALL sp_MSdel_dboTHETABLE192', @upd_cmd = N'MCALL sp_MSupd_dboTHETABLE192' | |
GO | |
use [thedb] | |
exec sp_addarticle @publication = N'thedb_THETABLE', @article = N'THETABLE199', @source_owner = N'dbo', @source_object = N'THETABLE199', @type = N'logbased', @description = N'', @creation_script = N'', @pre_creation_cmd = N'drop', @schema_option = 0x00000000000080A3, @auto_identity_range = N'false', @destination_table = N'THETABLE199', @destination_owner = N'dbo', @status = 16, @vertical_partition = N'false', @ins_cmd = N'CALL sp_MSins_dboTHETABLE199', @del_cmd = N'CALL sp_MSdel_dboTHETABLE199', @upd_cmd = N'MCALL sp_MSupd_dboTHETABLE199' | |
GO | |
use [thedb] | |
exec sp_addsubscription @publication = N'thedb_THETABLE', @subscriber = N'DESTINATION', @destination_db = N'SOURCE_thedb', @subscription_type = N'Push', @sync_type = N'automatic', @article = N'all', @update_mode = N'read only', @frequency_type = 64, @frequency_interval = 1, @frequency_relative_interval = 1, @frequency_recurrence_factor = 0, @frequency_subday = 4, @frequency_subday_interval = 5, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 0, @active_end_date = 0, @offloadagent = 0, @dts_package_location = N'Distributor' | |
GO | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment