Friday, March 30, 2012

replication Timestamp Field

Hi,
I like to know if i change the datatype from timestamp data type to binary(8) will it cause any interruption in application to run. And is there a way to replicate timestamp field to reporting databse without changing its datatype and data in timestamp field remains same
thx
DaveWell, since we don't know your application, and have no idea what kind of
events might cause "any interruption in application," your best bet is to
TRY IT in an isolated environment.
"dave" <anonymous@.discussions.microsoft.com> wrote in message
news:BD2EC7D2-4981-4455-B6FD-FC76B8780EFA@.microsoft.com...
> Hi,
> I like to know if i change the datatype from timestamp data type to
binary(8) will it cause any interruption in application to run. And is
there a way to replicate timestamp field to reporting databse without
changing its datatype and data in timestamp field remains same
> thx
> Dave|||Are you talking about changing it in the source (production) or the destination (report) server?
If source, then be very careful. Changing it will make it a "passive" binary(8). I.e., SQL Server
will not change the value for the row each time it is updated. And all your applications concurrency
mechanism will break down. This is assuming that the app actually uses the timestamp column for
concurrency.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"dave" <anonymous@.discussions.microsoft.com> wrote in message
news:BD2EC7D2-4981-4455-B6FD-FC76B8780EFA@.microsoft.com...
> Hi,
> I like to know if i change the datatype from timestamp data type to binary(8) will it cause any
interruption in application to run. And is there a way to replicate timestamp field to reporting
databse without changing its datatype and data in timestamp field remains same
> thx
> Dave|||Yes Application does use it in aid to updating that table and that is on production server only.
i am talking about to change timestamp to binary on destination (Report ) server for transactional replication to work,
But temporarily just in case if production server fails then i need to change that binary(8) column to Timestamp and restore it on production server.
i did some test on pubs db. creating a Timaestamp and Binary column. so in the first screen shot
Name Test_Column_1_in_TS Test_Column_2_in_BIN
1) A 0x00000000000010E1 NULL
2) B 0x00000000000010E2 NULL
3) C 0x00000000000010E3 NULL
4) D 0x00000000000010E4 NULL
5) E 0x00000000000010E5 NULL
6) F 0x00000000000010E6 NULL
7) G 0x00000000000010E7 NULL
8) H 0x00000000000010E8 NULL
After Swapping the type of test columns 1 and 2 (similar scenario after setting up replication)
Name Test_Column_1_in_BIN Test_Column_2_in_TS
1) A 0x00000000000010E1 0x00000000000010E9
2) B 0x00000000000010E2 0x00000000000010EA
3) C 0x00000000000010E3 0x00000000000010EB
4) D 0x00000000000010E4 0x00000000000010EC
5) E 0x00000000000010E5 0x00000000000010ED
6) F 0x00000000000010E6 0x00000000000010EE
7) G 0x00000000000010E7 0x00000000000010EF
8) H 0x00000000000010E8 0x00000000000010F0
now considering the scenario of production server fails/unrecoverable so restoring from report server
after changing the data type
Name Test_Column_1_in_BIN Test_Column_2_in_TS
1) A 0x00000000000010F1 0x00000000000010E9
2) B 0x00000000000010F2 0x00000000000010EA
3) C 0x00000000000010F3 0x00000000000010EB
4) D 0x00000000000010F4 0x00000000000010EC
5) E 0x00000000000010F5 0x00000000000010ED
6) F 0x00000000000010F6 0x00000000000010EE
7) G 0x00000000000010F7 0x00000000000010EF
8) H 0x00000000000010F8 0x00000000000010F0
this is how values are changing. and it also reflects the transactional changes made in the rows. so i think value will change but it will maintain the order in which rows r being changed... do u guys agree'
thx
Dave

No comments:

Post a Comment