Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Snapshot replication Expand / Collapse
Author
Message
Posted Wednesday, February 26, 2014 6:00 PM


SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 2:55 PM
Points: 36, Visits: 769
To add a new column to a table and include it in an existing publication, you'll need to use ALTER TABLE <Table> ADD <Column> syntax at the publisher. By default the schema change will be propagated to subscribers, publication property @replicate_ddl must be set to true. The column must allow NULL values or include a default constraint. See Make Schema Changes on Publication Databases for more information.
Post #1545651
Posted Wednesday, February 26, 2014 7:48 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, October 16, 2014 6:18 PM
Points: 3,961, Visits: 7,170
@Lempster and @Brandon - quite right, my ID10T error. I am fully aware of the flag in the publication options to replicate schema changes, however as a quick test I used the GUI to make the change to the table (and MS's way of doing so is to create a temp copy of the table with the new change, copy everything into the temp table, drop the old table, and rename the temp to the original table). This is what generated the error I posted. My bad for not dotting my I's and crossing my T's - very lame

Thanks for pointing this out.


______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience"
Post #1545666
Posted Thursday, February 27, 2014 2:20 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 9:23 AM
Points: 2,126, Visits: 1,472
Phew! Thought I was going mad for a minute.
Post #1545766
Posted Friday, February 28, 2014 9:08 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 8:34 AM
Points: 611, Visits: 444
What is the error you are facing , you can alter the Table if there is no index exists on the column you are altering and if any index exists the only change it will allow is increasing the datatype limit .

So if you are changing Datatype varchrar(200) to nvarchar(200) it will fail and if you run varchar(100) to varchar(200) it will successfully execute .


Please post error !
Post #1546407
Posted Friday, February 28, 2014 9:09 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 8:34 AM
Points: 611, Visits: 444
What is the error you are facing , you can alter the Table if there is no index exists on the column you are altering and if any index exists the only change it will allow is increasing the datatype limit .

So if you are changing Datatype varchrar(200) to nvarchar(200) it will fail and if you run varchar(100) to varchar(200) it will successfully execute .


Please post error !
Post #1546409
Posted Friday, February 28, 2014 9:20 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 8:34 AM
Points: 611, Visits: 444
What is the error you are facing , you can alter the Table if there is no index exists on the column you are altering and if any index exists the only change it will allow is increasing the datatype limit .

So if you are changing Datatype varchar(200) to nvarchar(200) it will fail and if you run varchar(100) to varchar(200) it will successfully execute .


Please post the error !
Post #1546423
Posted Friday, February 28, 2014 9:23 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, October 21, 2014 8:34 AM
Points: 611, Visits: 444
Sorry for multiple posts , I promise this was unintentional blame to my browser's Friday mood .
Post #1546426
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse