Re: t-slq/script replication question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The GO statements have the effect of deallocating the variables you need to
declare and specify them again after each go statement or remove some of
your go statements.

--
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

"LPR-3rd" <lreames@xxxxxxxxx> wrote in message
news:1136560227.645311.113140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> When I run this script...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> declare @location as char
> declare @pubname as char
> declare @SerVerName as char
> set @location = '03'
> set @pubname = 'EDI for #03'
> set @ServerName = 'ROUSE03SERVER'
>
> -- Enabling the replication database
> use master
> GO
>
> exec sp_replicationdboption @dbname = N'EDI_On_RouseMain', @optname =
> N'merge publish', @value = N'true'
> GO
>
> use [EDI_On_RouseMain]
> GO
>
> -- Adding the merge publication
> exec sp_addmergepublication @publication = @pubname, @description =
> N'Merge publication of EDI_On_RouseMain database from Publisher
> ROUSEMAIN.', @retention = 14, @sync_mode = N'native', @allow_push =
> N'true', @allow_pull = N'true', @allow_anonymous = N'true',
> @enabled_for_internet = N'false', @centralized_conflicts = N'true',
> @dynamic_filters = N'false', @snapshot_in_defaultfolder = N'true',
> @compress_snapshot = N'false', @ftp_port = 21, @ftp_login =
> N'anonymous', @conflict_retention = 14, @keep_partition_changes =
> N'true', @allow_subscription_copy = N'false', @allow_synctoalternate =
> N'false', @add_to_active_directory = N'false', @max_concurrent_merge =
> 0, @max_concurrent_dynamic_snapshots = 0
> exec sp_addpublication_snapshot @publication = @pubname,@frequency_type
> = 8, @frequency_interval = 64, @frequency_relative_interval = 0,
> @frequency_recurrence_factor = 1, @frequency_subday = 1,
> @frequency_subday_interval = 0, @active_start_date = 0,
> @active_end_date = 0, @active_start_time_of_day = 233400,
> @active_end_time_of_day = 0, @snapshot_job_name =
> N'ROUSEMAIN-EDI_On_RouseMain-EDI for #03-41'
> GO
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
> I receive the following message
>
> Server: Msg 137, Level 15, State 2, Line 3
> Must declare the variable '@pubname'.
> Server: Msg 137, Level 15, State 1, Line 4
> Must declare the variable '@pubname'.
>
>
> What am I missing??? What am I doing wrong??
>
> Larry...
>


.



Relevant Pages

  • Re: t-slq/script replication question
    ... declare @location as char ... N'Merge publication of EDI_On_RouseMain database from Publisher ... > -- Enabling the replication database ...
    (microsoft.public.sqlserver.replication)
  • newbie, @@error does not seem to work
    ... -- Declare variables to store values originating from the Event Table (And ... Declare @ca3k_Medew_ltv_nr char ... Insert into Event_Log (EDate, Number, Status, Badge, Class, ...
    (microsoft.public.sqlserver.programming)
  • Re: C string array problems (again)
    ... on the char ** var approach. ... scope and being re-initialized with each loop. ... So why did they declare it ... Would have to take a look a the original code to see what was meant. ...
    (microsoft.public.vb.general.discussion)
  • Re: Cursor and Procedure
    ... I need to truncate those strings to the segments with 200 ... Actually problem is ntext hold> 4000 char. ... DECLARE @deptTriDes ntext ...
    (comp.databases.ms-sqlserver)
  • Re: Comments on my code?
    ... value in a char *. ... Since you didn't declare the argument type, ... void *malloc; ... There's simply no good reason not to ...
    (comp.lang.c)