Cannot Alter Table Being Published For Replication

Jun 8, 2006

Hi all,

I'm using SQL Server 2000 SP3 to store data for real time transaction
processing.

I have set up replication to another server using a push subscription to
give me immediate backup.

I need to alter the data type of one of the columns and am using the
following basic sql:


alter table Voucher
alter column SerialNumber varchar(20) NOT NULL

However I keep getting this error message:

Server: Msg 4929, Level 16, State 1, Line 1
Cannot alter the table 'Terminals' because it is being published for
replication.

Is there anything I can do to allow this update taking place, short of
deleting the subscription and recreating it. (I want to try and avoid
this as the same update needs to be applied to about 10 databases that
are also replicated in the same way).

All help is appreciated.

Brian.

*** Sent via Developersdex http://www.developersdex.com ***

View 4 Replies


ADVERTISEMENT

CAN NOT DROP TABLE Xxx BECAUSE IT IS PUBLISHED FOR REPLICATION

May 5, 2000

Good morning folks,
I'm getting the above error message when trying to drop a table. I'm not to familiar with the setup of this SQL server, so I not sure if the replication is enabled. I have never had to use replication so I don't know to much about it. Does anyone know how I guess to remove this table from the replication list so that it could be dropped?

Thanks much

Dom

View 1 Replies View Related

SQL 2012 :: Cannot Truncate Table Because It Is Published For Replication Or Enabled For Change Data Capture

Jul 8, 2015

I get the following error message when a job calls a Stored Procedure that TRUNCATES a Table:

Cannot truncate table 'CombinedSurveyData' because it is published for replication or enabled for Change Data Capture

Is my only option to change the TRUNCATE to DELETE?

[URL]

View 2 Replies View Related

2005 Replication Alter Table ?

Oct 3, 2006

Hi There

I am using transactional replication in 2005.

I am used to 2000 where if a column was added or changed to had to use sp's to do this and for altering a column you had to drop the subscription change and add back etc.

With 2005 is this fully handled by ALTER TABLE, can i safely make any meta data changes to an article with ALTER TABLE and the changes will progate to subscribers no problem.

Or are there limitations are there certain changes to articles that must still be done through sp's?

Thanx

View 1 Replies View Related

Retrieve Fields List From A Published Report Data Model Published On The Reporting Server.

Jul 17, 2007

Can someone please tell me how to retrieve/query the list of fields from an entity of a report data model that has been published on the reporting server programmatically ?

I am trying to upload a report data model to the reporting server and planning to use that model as the data source and consume it through our existing web application?

Thank you ,

Rashid A. Khan

View 1 Replies View Related

SQL Server Admin 2014 :: Transactional Replication With Filtered Published Data

Apr 15, 2015

From distribution db, which table(s) store info about filtered data?

View 0 Replies View Related

Alter Table Alter Column In MSACCESS. How Can I Do It For A Decimal Field?

Jul 23, 2005

Hi people,I?m trying to alter a integer field to a decimal(12,4) field in MSACCESS 2K.Example:table : item_nota_fiscal_forn_setor_publicofield : qtd_mercadoria integer NOT NULLALTER TABLE item_nota_fiscal_forn_setor_publicoALTER COLUMN qtd_mercadoria decimal(12,4) NOT NULLBut, It doesn't work. A sintax error rises.I need to change that field in a Visual Basic aplication, dinamically.How can I do it? How can I create a decimal(12,4) field via script in MSACCESS?Thanks,Euler Almeida--Message posted via http://www.sqlmonster.com

View 1 Replies View Related

Altering A Published Table

Feb 12, 2004

Hi! I've added a column to a published table in the Publisher using SP_REPLADDCOLUMN. After doing this the replication triggers for that table(i.e. del_%,upd_%,ins_%) are doubled both at the Publisher and at the Subscriber. If i update anyone of the column in the table at the Subscriber; i get the following error:

Server: Msg 208, Level 16, State 1, Procedure upd_3E6DE124B82D42A5AEB169557C0D757C, Line 60
Invalid object name 'ctsv_3E6DE124B82D42A5AEB169557C0D757C'.

Any ideas, what has gone wrong????

I have the following SQL setup.
Publisher: Enterprise Edition, SP3.
Subscriber: Standard-Edition, SP3.
The error is at the Subscriber.

View 5 Replies View Related

Detect Changes On Indexes In A Published Table

Jul 27, 2006

Hi,

Regarding to my previous post at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=553652&SiteID=1, just wondering if there's a way to detect any changes which is made on the existing indexes in a published table so that the device can determine whether reinitialization of subscrption is needed before every synchronization.

Cheers,
Justin

View 3 Replies View Related

Add A Column To Published Table Without Replicating To Subscriber

May 25, 2006

I would like to add a column to a published table but not have that column replicated to subscribers. I can accomplish this via the UI by adding the column and then unchecking it. This adds the column to the publisher table but does not replicate it to the subscriber.

I am looking for a programmatic method to add a column to the base table and unmark it for replication.

Thanks for your assistance.

View 4 Replies View Related

Alter Table Alter Column

Jul 20, 2005

I would like to add an Identity to an existing column in a table using astored procedure then add records to the table and then remove the identityafter the records have been added or something similar.here is a rough idea of what the stored procedure should do. (I do not knowthe syntax to accomplish this can anyone help or explain this?Thanks much,CBLCREATE proc dbo.pts_ImportJobsas/* add identity to [BarCode Part#] */alter table dbo.ItemTestalter column [BarCode Part#] [int] IDENTITY(1, 1) NOT NULL/* add records from text file here *//* remove identity from BarCode Part#] */alter table dbo.ItemTestalter column [BarCode Part#] [int] NOT NULLreturnGOSET QUOTED_IDENTIFIER OFFGOSET ANSI_NULLS ONGOhere is the original tableCREATE TABLE [ItemTest] ([BarCode Part#] [int] NOT NULL ,[File Number] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_File Number] DEFAULT (''),[Item Number] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Item Number] DEFAULT (''),[Description] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Description] DEFAULT (''),[Room Number] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Room Number] DEFAULT (''),[Quantity] [int] NULL CONSTRAINT [DF_ItemTest_Quantity] DEFAULT (0),[Label Printed Cnt] [int] NULL CONSTRAINT [DF_ItemTest_Label Printed Cnt]DEFAULT (0),[Rework] [bit] NULL CONSTRAINT [DF_ItemTest_Rework] DEFAULT (0),[Rework Cnt] [int] NULL CONSTRAINT [DF_ItemTest_Rework Cnt] DEFAULT (0),[Assembly Scan Cnt] [int] NULL CONSTRAINT [DF_ItemTest_Assembly Scan Cnt]DEFAULT (0),[BarCode Crate#] [int] NULL CONSTRAINT [DF_ItemTest_BarCode Crate#] DEFAULT(0),[Assembly Group#] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Assembly Group#] DEFAULT (''),[Assembly Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Assembly Name] DEFAULT (''),[Import Date] [datetime] NULL CONSTRAINT [DF_ItemTest_Import Date] DEFAULT(getdate()),CONSTRAINT [IX_ItemTest] UNIQUE NONCLUSTERED([BarCode Part#]) ON [PRIMARY]) ON [PRIMARY]GO

View 2 Replies View Related

Alter Table Alter Column...

Oct 8, 2007

I am using sql server ce.I am changing my tables sometimes.how to use 'alter table alter column...'.for example:I have table 'customers', I delete column 'name' and add column 'age'.Now I drop Table 'customers' and create again.but I read something about 'alter table alter column...'.I use thi command but not work.I thing syntax not true,that I use..plaese help me?



my code:
Alter table customers alter column age

View 7 Replies View Related

Alter Identity Property Of A Column To NOT FOR REPLICATION

Jul 20, 2005

i need to alter all foreign keys in my database and uncheck the"Enforce relationship for replication" check box. Using the EM, Iextracted the code snippet below. unfortunately, when i run this testfrom query analyzer, then go back into the EM, the box is stillchecked.can anyone tell me what i am missing? any advice on unsetting thisattribute globally would be appreciated!BEGIN TRANSACTIONSET QUOTED_IDENTIFIER ONSET TRANSACTION ISOLATION LEVEL SERIALIZABLESET ARITHABORT ONSET NUMERIC_ROUNDABORT OFFSET CONCAT_NULL_YIELDS_NULL ONSET ANSI_NULLS ONSET ANSI_PADDING ONSET ANSI_WARNINGS ONCOMMITBEGIN TRANSACTIONALTER TABLE dbo.CustomerCustomerDemoDROP CONSTRAINT FK_CustomerCustomerDemo_CustomersGOCOMMITBEGIN TRANSACTIONALTER TABLE dbo.CustomerCustomerDemo WITH NOCHECK ADD CONSTRAINTFK_CustomerCustomerDemo_Customers FOREIGN KEY(CustomerID) REFERENCES dbo.Customers(CustomerID) NOT FOR REPLICATIONGOCOMMITthanks!!

View 4 Replies View Related

TSQL - Using ALTER TABLE - ALTER COLUMN To Modify Column Type / Set Identity Column

Sep 7, 2007

Hi guys,
If I have a temporary table called #CTE
With the columns
[Account]
[Name]
[RowID Table Level]
[RowID Data Level]
and I need to change the column type for the columns:
[RowID Table Level]
[RowID Data Level]
to integer, and set the column [RowID Table Level] as Identity (index) starting from 1, incrementing 1 each time.
What will be the right syntax using SQL SERVER 2000?

I am trying to solve the question in the link below:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2093921&SiteID=1

Thanks in advance,
Aldo.

I have tried the code below, but getting syntax error...



ALTER TABLE #CTE
ALTER COLUMN
[RowID Table Level] INT IDENTITY(1,1),
[RowID Data Level] INT;


I have also tried:

ALTER TABLE #CTE
MODIFY
[RowID Table Level] INT IDENTITY(1,1),
[RowID Data Level] INT;







View 18 Replies View Related

Alter View Hangs - Merge Replication SQL 2005

Dec 18, 2006

Background - I have a publication that propigates schema changes. I have a view in which I want to remove a column.

Error - Going by what the BOL says, I use Alter View and delete the column from my select statement. I issue the alter view command against the Publication database and it just "churns". I do not get any locking errors or any other type of error, but the statement never completes execution. I watched it run for 10 minutes and cancelled the query. Executing the same statement against a copy of the database that is not being published executes in 1, 2 seconds.

Here is what I am doing:

Old View: Select table1.record_number, table1.record_date, table1.status_code, table2.status_desc,

table2.txt_sort_order

FROM table1 join table2 on table1.status_code = table2.status_code

The query I am executing:

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER VIEW myview

AS

Select table1.record_number, table1.record_date, table1.status_code, table2.status_desc

FROM table1 join table2 on table1.status_code = table2.status_code

View 1 Replies View Related

Transact SQL :: How To Alter Existing Table Column As Identity Without Dropping Table

Nov 20, 2013

I have created a table as below mentioned. Then I want to alter the ID column as identity(1,1) without dropping the table as well as losing the data.

create table dbo.IdentityTest
(
id int not null,
descript varchar(255) null,
T_date datetime not null
)

View 7 Replies View Related

Transact SQL :: Dynamically Alter Schema Of Stage Table When Source Table Structure Changed?

Oct 25, 2015

we have a table in our ERP database and we copy data from this table into another "stage" table on a nightly basis. is there a way to dynamically alter the schema of the stage table when the source table's structure is changed? in other words, if a new column is added to the source table, i would like to add the column to the stage table during the nightly refresh.

View 4 Replies View Related

How To Alter The Table With Delete/update Cascade Without Recreating The Table

Jul 26, 2004

I have contract table which has built in foreign key constrains. How can I alter this table for delete/ update cascade without recreating the table so whenever studentId/ contactId is modified, the change is effected to the contract table.

Thanks


************************************************** ******
Contract table DDL is

create table contract(
contractNum int identity(1,1) primary key,
contractDate smalldatetime not null,
tuition money not null,
studentId char(4) not null foreign key references student (studentId),
contactId int not null foreign key references contact (contactId)
);

View 3 Replies View Related

How To Alter Column Length Of The Master Table Along With The Slave Table?

Aug 13, 2006

In SQL Server 2005,here are two tables, created by the following SQL Statements:

CREATE TABLE student(
ID CHAR(6) PRIMARY KEY,
NAME VARCHAR(10),
AGE INT
);

CREATE TABLE score(
ID CHAR(6) PRIMARY KEY,
SCORE INT,
FOREIGN KEY(ID) REFERENCES student(ID)
);

For the length of Column ID is not enough, So I want to alter its length.The alter statement is:

ALTER TABLE student ALTER COLUMN ID CHAR(20)

For the table student is referenced by table score, the alter statement can not alter the column of the table student, and the SQL Server DBMS give the errors.

But, I can manually alter the length of the column ID in SQL SERVER Management Studio. How to alter column length of the master table(student) along with the slave table(score)?

Thanks!

View 2 Replies View Related

SQL Server 2008 :: Alter Table Triggers Recreate Table?

May 26, 2015

which ALTER TABLE/ALTER COLUMN- Statement has a Recreate Table as result ?

View 2 Replies View Related

How To Modify Colum (alter Table) Of Table That Is Replicated?

Jul 20, 2005

Hello!I have an MS SQL-server with an database, that runs replication. In thisdatabase there is an table with an columni want to extend; varchar(50)->varchar(60).But I get this error (using design window of Enterprise Manager): Cannotdrop the table 'MytableName' because it is being used for replication.Thanks for helpBjoern

View 1 Replies View Related

ALTER TABLE SWITCH PARTITION On A Replicated Table

Apr 10, 2007

A customer wants to implement table partitioning on a replicated table.



They want to hold 13 months of data in the table and roll off the earliest/oldest month to an identical archive table. The table has a date field and partitioning by month makes sense all around.



So SWITCH PARTITION is the obvious solution to this, except for the fact that the table is replicated (transactional w/no subscriber updates).



What are his architectural or practical solutions to using table partitioning and replication?











thx

View 5 Replies View Related

Alter A Table All In C#

Feb 15, 2006

Is there a way to add a column to an existing table and do it all in C#If my query string is as follows how do I execute the query?ALTER TABLE interests ADD COLUMN Swim VARCHAR(1) NOT NULL DEFAULT('n')ThanksMoonWa

View 2 Replies View Related

ALTER TABLE

Aug 13, 2002

I think I have blown a gasket..... a elementary simple sp that will not work but I am unable to find an explanation as to why..... please help.


CREATE PROCEDUREbrsp_table_alteration
@var_1 varchar(45)
,@var_2varchar(45)
,@var_3varchar(30)
AS

ALTER TABLE @var_1
ADD@var_2@var_3NULL


Thanks.

View 3 Replies View Related

Alter Table ......

Sep 30, 2003

I have a table tblABC which exists in 800 databases. I want to run a cursor to turn off the pk field ID indentity permannetly and then to "insert tblABC select * from tblXYZ".

I have tried the "set indentity_insert tblABC on" statement and failed on insert tblABC select * from tblXYZ.

Is there any alter table related t-sql could permannetly turn off the identity?

thanks
David

View 7 Replies View Related

Alter Table

Jun 7, 2001

Is there anyway to Insert a new column between two existing columns without creating a new table?

Thanks

View 3 Replies View Related

Alter Table

Oct 17, 2001

Hi,
is it possible to override the system when adjusting
columns. i.e. a system override setting.

For instance if I've got a column that is indexed and I
want to adjust it from varchar(50) to varchar(51) it lets
me. But if I then try and adjust the column to varchar
(49) I get the error below:

Server: Msg 5074, Level 16, State 8, Line 1
The index 'LastName' is dependent on column 'lastname'.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE ALTER COLUMN lastname failed because one or
more objects access this column.

I asked this question on another Forum and was told I had to drop the index first. Just thought I'd ask for a second opinion.

Thanks for the help.

Steve

View 1 Replies View Related

Alter Table

Jan 30, 2004

Hi to all!
I have a silly problem, but I'm not able to solve it!
I know how to add a field in a table via Enterprise manager and I know also via ALTER TABLE command.
...But the problem is: I want to add a field NOT in the last position, but on the middle (for istance)
So, this is possible via Enterprise Manager but with the ALTER TABLE command? How can I add a field without put it in the last position?
...Thanks a lot!
Sergio

p.s.: Sorry for my poor english..I hope you understand my question!

View 2 Replies View Related

Can I Alter A Table Specified By @name?

Jun 5, 2008

hello,
i am trying to add a column to every table in a database, if it (doesn't already exist), with the following code:

declare @name varchar(50)
declare c cursor for select name from sys.tables
open c
fetch next from c into @name
while @@FETCH_STATUS = 0
begin
if( (select count(*) from sys.columns
WHERE object_id IN (SELECT object_id FROM sys.tables WHERE name = @name )
and name='ins_id') = 0 )
begin
alter table @name add ins_id int
end

fetch next from c into @name
end
close c
deallocate c

and when i run the script i get the error message
Incorrect syntax near '@name'.
reffering to the alter table statement
So, my question is, how can i actually perform the alter table in this case?
thank you

View 3 Replies View Related

Alter Table

Mar 2, 2007

Pramod writes "I want to change the primary key field of my database to Identity seed. the table is with data. data should be secured
this is the structure
'=================================
CREATE TABLE [tblStock] (
[StockId] [numeric](18, 0) NOT NULL ,
[ItemID] [numeric](18, 0) NULL ,
[Batch] [varchar] (50) NULL ,
[Qty] [float] NULL ,
[Prate] [float] NULL ,
[SRate] [float] NULL ,
[Mrp] [float] NULL ,
[PTR] [float] NULL ,
[batchid] [numeric](18, 0) NULL ,
[BatchCode] [varchar] (50) NULL ,
CONSTRAINT [PK_tblStock] PRIMARY KEY NONCLUSTERED
(
[StockId]
) ON [PRIMARY] ,
CONSTRAINT [IX_tblStock] UNIQUE NONCLUSTERED
(
[ItemID],
[Batch],
[Prate]
) ON [PRIMARY]
) ON [PRIMARY]
===================================
How do i use alter table with identity seed
ALTER TABLE tblStock alter column StockID Numeric IDENTITY (1, 1)

how the p[rimary key affects

Please help me"

View 1 Replies View Related

Alter Table Name

Sep 13, 2007

How to alter a table name by using Query Analyser

i tried like this..

ALTER TABLE of_info_grp
RENAME TO stp_info_grp_map

It is giving an error like this
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'TO'.

Some one help on this

View 2 Replies View Related

T-sql Alter Table Udf Help!

Jul 23, 2005

Hi,I'm trying to write a function check if a column exists on a table, andcreates it if it doesn't. The line that the query analyzer is citingis noted. It seems unhappy taking variables in the ALTER TABLEcommand. I can think of a hack around this, but I'm hoping there's abetter way? Muchas gracias in advance :)-DJCode followsCREATE FUNCTION fieldCreator(@TableName varchar(20),@FieldName varchar(20))RETURNS BITASBEGINif (EXISTS (SELECT count (objname)FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table',@TableName, 'column', @FieldName)GROUP BY objname))BEGINALTER TABLE @TableName ADD @FieldName int DEFAULT 4 --ERRORS HERE!!!EXEC sp_addextendedproperty 'caption', 'Created by script foranalysis', 'user', dbo, 'table', @TableName, 'column', @FieldNamereturn 1ENDreturn 0ENDGO

View 8 Replies View Related

Alter A SQL Table

Aug 18, 2006

I used the MS Access 2000 Upsize wizard to create a Client/serverapplication. After the wizard ran, the original table names had becomethe linked tables and then there were duplicates of the the tablesnamed xxx_local.I realized later that I needed to add some fields to a table andcouldn't do that in Access (couldn't edit the linked tables). So I usedthe Query Analyzer and created a script to add the fields to my table.It looked fine in Query Analyzer, but back in Access the fields wereadded to xxx_local and not xxx, the linked table. My forms and reportsare built on xxx, not xxx_local.How do I do this correctly?Jane

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved