Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ch.reinke
Starting Member
2 Posts |
Posted - 2003-03-12 : 09:21:36
|
| Hi,I use a Snapshot Replication. I want to update the tablestructure (add a column or delete a relation), but without update the data in the table.I use the following Properties: - Article - propertie: "Delete Data in the existing table that matches the row filter statement" - Row - Filter: "... WHERE id < 0" (no rows returns with this condition) I create an Initial Snapshot and apply it to my Subscriber, but the table - structur dont change.Has the Replication a other way to do this?Ch. Reinke |
|
|
KnooKie
Aged Yak Warrior
623 Posts |
Posted - 2003-03-12 : 12:10:37
|
| If you're talking about SQL Server 7 then remove the publication > make the table structure changes > re-replicateIf you're using SQL2K then it may be possible to drop single tables from replication > make structure changes > add single table back into replication ? ala SQL Server 6.5check some literature - BOL, book etc===========Paul |
 |
|
|
ch.reinke
Starting Member
2 Posts |
Posted - 2003-03-13 : 03:41:43
|
| @KnooKieIts not the problem to declare in the publication, that i want to add or delete a column.The problem is that the Replication creates the following Script in the Initial Snapshot:When I using the propertie: "Delete Data in the existing table that matches the row filter statement"SET QUOTED_IDENTIFIER ONGOdelete from [TestTable1] where TestTable1.id < 0GOSET ANSI_PADDING ONGOif not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TestTable1]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) BEGINCREATE TABLE [TestTable1] ( [id] [int] NOT NULL , [val1] [int] NULL , [val2] [int] NULL , [val3] [int] NULL , [newcol2] [varchar] (50) COLLATE Latin1_General_CI_AS NULL )ENDGOWhen I using the propertie: "DROP the existing table an re-create it"SET QUOTED_IDENTIFIER ONGOdrop table [TestTable1]GOSET ANSI_PADDING ONGOCREATE TABLE [TestTable1] ( [id] [int] NOT NULL , [val1] [int] NULL , [val2] [int] NULL , [val3] [int] NULL , [newcol2] [varchar] (50) COLLATE Latin1_General_CI_AS NULL )GO The first Script dont change my structure and the second sript delete my data.I need a script like script like this:ALTER TABLE [TestTable] ADD [newcol2] [varchar] (50) COLLATE Latin1_General_CI_AS NULL |
 |
|
|
|
|
|
|
|