Changing Datatype In A Table Used For Replication ?

Feb 28, 2002

Changing datatype in a table used for merge replication ?

I'm trying to change the data type on a column in a table that is used for a merge-replication with another (identical) DB.

I get this error:
Cannot alter the table '[Tablename]' because it is being published for replication.

I've tried to remove that specific table from the publication (Publication properties -> Articles tab) so I can change the data type and then put the table back into the publication, but I can't (probably because it's a MERGE rep.)

Any ideas ?

/CN

View 1 Replies


ADVERTISEMENT

Changing Datatype: Smallint To Int In A Large Table..

Jul 13, 2004

Hi,

I need to change the datatype of a very large table from smallint to int...
What would be an ideal solution to get this done in least amount of time. May be I can try with ALTER but , I am not sure about the time it would take ...and the page splits etc..

pls help on the same!!

Thanks
Cheriyan.

View 14 Replies View Related

Adding New Table In Replication And Changing One Column Replication Database

Jan 17, 2002

Hi,

In my production box is running on SQL7.0 with Merge replication and i want add one more table and i want add one more column existing replication table. Any body guide me how to add .This is very urgent
Regards
Don

View 1 Replies View Related

Changing A Column Datatype

Dec 2, 2006

Hello I am having a table

table1
col1 (bit)

and i want to changethe col1 type for smallint

col1 (smallint)

true will be = 1
and false = 0

how can i do it ??
thank you

View 3 Replies View Related

Changing Datatype Length

Jul 20, 2005

Hi all,I need to change a varchar from 35 to 50. In the SQL Server books online it says that SQL Server actually creates a new table when youchange the length. I ran a test in a test database and it appears theonly thing that changes is the length. All the data remains in tact.The table with the column I want to modify is very critical. Is thereany chance I would loose data if I change the length to a larger size? Iam making a back up of the table just in case. Thanks,Kelly

View 2 Replies View Related

Changing The DATATYPE Of A PUBLISHED COLUMN

Oct 27, 2003

Hi guys,

Is there any way or method to CHANGE the DATATYPE of a column in a published table being used for transactional replication (MSSQL 2000), WITHOUT DROPPING THE SUBSCRIPTION ????

Im stuck in this mess and do have the option to drop the subscription, alter the table, create the subscription and rerun the snapshot or to recreate it by Manual Synchronisation either.

Can anyone help? Has anyone been across this dilemma before and have troubleshooted the problem? If yes, help is much appreciated.


MY PROBLEM:
~~~~~~~~~~~~~
'MyTable' is currently being published and has subscriptions to it. The PRIMARY KEY column 'id' has an Identity property as well. 'id' is of datatype smallint, however because of bad planning, i now need to change that datatype to an integer to support a larger range WITHOUT DROPPING SUBSCRIPTIONS.
I CANT DROP THE COLUMN EITHER AS IT IS BEING THE PRIMARY KEY COLUMN.

IS THERE ANY OTHER WAY I CAN DO TO ARCHIEVE MY GOAL? THANKYOU.

View 3 Replies View Related

Update Column Without Changing Datatype?

Oct 15, 2015

I am trying to make the following update: All the columns are fine except for the 'name' column. datatype for 'name' column in the target table is varchar(30) and the datatype for 'name' in the sourcetable is varchar(40), I cannot change the datatype of the column 'name' to varchar(40) because I am told it may affect performance. what I want to do is just update the first 'name' column of the target table by the first 30 characters of the source table column 'name'

I am using the following query, is it possible to do it or are there any other ways I can update the column without changing the datatype?

MERGE INTO [S].[dbo].[AF_Copy] AS TargetTable
USING (SELECT source_code, name, addr1, city, zip FROM
[D].[D_TEST].[dbo].[SO_Copy]) AS SourceTable
ON ([TargetTable].[Code] = [SourceTable].[source_code])

[code]...

View 3 Replies View Related

Changing Datatype From Char To Datetime

Jul 20, 2005

I am trying to run the following query:ALTER TABLE dnb_profileALTER COLUMN [family update date] datetimeand I keep getting the following error:Server: Msg 242, Level 16, State 3, Line 1The conversion of a char data type to a datetime data type resulted inan out-of-range datetime value.The statement has been terminated.Can anyone tell me how I can do this successfully??Thanks,Connie SawyerFoley & LardnerJoin Bytes!

View 2 Replies View Related

Transact SQL :: Changing Length Of Datatype?

May 20, 2015

I have a field in a table

FormID nvarchar(6)

i want to change the length of the datatype to nvarchar(8).

what is the best way to do with out dropping the table?

View 5 Replies View Related

How Can I Strip Off The Time Portion Without Changing The Datatype

Oct 16, 2007

Is there a way to strip off the time portion of a datetime datatype without changing the datatype?
I know I can convert it using CONVERT (NVARCHAR(10), dbo.tblPayments.PaymentDate, 101) but I need to keep it as a datetime datatype?

View 5 Replies View Related

Changing The DataType Of A Coluumn In An In-Memory Dataset

Apr 11, 2005

Here is the issue. I have ReadOnly Access to a database. All of the Columns are set to NVARCHAR(1000) by default. I cannot change them. I want to load the DataSet into memory and change the DataType of the columns from NVARCHAR(1000) to INT(4). The data is in integer (i.e. 4,5,123) format (but stored as a string), but is coming across as strings. The charting software I am using won't implicitly convert these Strings to Int or Double. How can I change an entire column to Int?

View 3 Replies View Related

Changing Owner Of User Datatype Objects

Jan 29, 2002

Usually all the user datatypes in our databases have the owner dbo.
One has a few that are owned by a user with dbo rights. I am trying to change them to dbo owner.
Sp_changeobjectowner gives 'object does not exist'

Any ideas

Jim

View 1 Replies View Related

Text Datatype In Replication

Jun 7, 2000

I need to replicate a table with datetime,char and text datatypes.Is it possible to replicate text datatypes?What is the alternate if not?It should be merge replication.Please reply.
Thanks.

View 1 Replies View Related

Changing Replication Topology

Apr 2, 2015

I have a replicated database on 2008 R2 being moved to a new instance with 2014. Application regression testing is complete and all tests are good.

The current transactional replication topology is Publishing subscriber: the distributor is local and pushes to a subscription on an intermediary server. This server then has an identical publication and local distributor which then pushes to a subscription on a customer's server. There's no business case for this setup, it's just how it was created at the time.

I want to change this to a Central Distributor model when we do the move to speed things up and remove any extra potential points of failure.

The customer has a requirement that during this process, their subscription database remain online, all tables are fully populated and replication pick up exactly where it was left off. This is a completely new scenario for me and I was hoping to just be able to rebuild the subscription from scratch.

Is there a way to do this move and topology change and meet the customer's requirement?

View 2 Replies View Related

Replication - Changing A Server

Oct 26, 2005

This is very important.

View 1 Replies View Related

Changing 'sa' Password Breaks Replication

Apr 17, 2008

We are currently using continuous transactional replication from an OLTP type database to a Reporting database. We recently changed the 'sa' password for the first time since replication was introduced and now the Replication Log Reader job fails to start.

This is the error from the Job Log:

Message
2008-04-14 15:18:24.894 Copyright (c) 2005 Microsoft Corporation
2008-04-14 15:18:24.894 Microsoft SQL Server Replication Agent: logread
2008-04-14 15:18:24.894
2008-04-14 15:18:24.894 The timestamps prepended to the output lines are expressed in terms of UTC time.
2008-04-14 15:18:24.894 User-specified agent parameter values:
-Publisher OASV-SQL1
-PublisherDB georgiaoas
-Distributor OASV-SQL1
-DistributorSecurityMode 1
-Continuous
-XJOBID 0xCE146F975BC43043AB1ECBF42F801C43
-XJOBNAME OASV-SQL1-georgiaoas-1
-XSTEPID 2
-XSUBSYSTEM LogReader
-XSERVER OASV-SQL1
-XCMDLINE 0
-XCancelEventHandle 00000730
-XParentProcessHandle 0000075C
2008-04-14 15:18:25.034 Status: 0, code: 20015, text: 'Login failed for user 'sa'.'.
2008-04-14 15:18:25.034 Login failed for user 'sa'.


When we change the 'sa' password back to the previous value, we can start the Log Reader without issue.

We have tried restarting the SQL Server Agent process without success. We have not restarted the SQL Server process due to the server hosting production databases.

Any ideas?

View 1 Replies View Related

Can Not Create New Replication After Changing Server Name

Dec 5, 2005

After i changed my computer's name(eg. the original computer name is 'SERVER-1',I has changed it to 'SERVER-2'),I can not create a new replication in SQL Server 2005.The error message :

View 5 Replies View Related

Replication :: Changing Password For Remote Distributor

Jul 22, 2015

We have inherited a remote distribution db where the password has been lost.  I would like to confirm that if you change the password in the distributor properties-->publishers--> administrative link password that the password will be changed on all publishers without having to resnap the publications?

View 3 Replies View Related

Merge Replication - Changing Values From Filtered Column

Nov 6, 2006

Hi

I'm working with merge replication between Sql Server 2005 and Sql Server 2005 Mobile. I'm using dynamic filtering by function HOST_NAME (... where Table.FilteredColumn = HOST_NAME())

When I'm trying to chagne values from filtered column on the client side (Table.FileteredColumn) I get error message that the column is read-only.

How can I change data in filtered column? Is this possible?

 

View 3 Replies View Related

SQL Server 2008 :: Changing Alt Snapshot Folder For Merge Replication?

Sep 22, 2015

I have a merge replication. Currently works fine. Publisher & Distributor are on the same server. I need to change the location of the alternate folder for the snapshot files.

I’ll probably just change it through the GUI, but would I use sp_changedistpublisher or sp_changemergepublication if I were scripting everything?

My real concern is the subscribers. Do I have to ‘tell’ the subscribers where the alt folder has been changed to? Do I just run sp_changemergepullsubscription on the subscribers?

View 1 Replies View Related

Snapshot Agent Fails On Table With XML Datatype : Script Failed For Table 'dbo.TableName'

Sep 11, 2007

SQL Server 2005 SP2 Error: Script failed for Table 'dbo.TableName'

I keep getting this error when trying to generate a snapshot for transact replication.
Here is the publishing table schema:

CREATE TABLE [dbo].[viMediaPlaylist](
[MemberID] [bigint] NOT NULL,
[xmlPlaylist] [xml](CONTENT [dbo].[viMediaPlaylistCollectionSchema]) NOT NULL,
PRIMARY KEY CLUSTERED
(
[MemberID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]


I tried the following:
#1)Create table schema at the subscriber manually, and change package to Keep object as is. Got the same error during snapshot.

#2Filtered replication to NOT include XML column. This worked, and no error was generated, replication was up and running.


So my question is, what is the problem with XML column being replicated?
Any ideas how i can make this work? At this point i'm not sure what the problem is with the xml column, but it seems like ti tries to run schema script, but i'm not asking it to create the schema i already did it myself. Thanks!

Here is a log dump from the distributor:

2007-09-11 16:40:14.56 SQL Command dump
2007-09-11 16:40:14.56 ================
2007-09-11 16:40:14.56 Server: SQL02
2007-09-11 16:40:14.56 Database: Video
2007-09-11 16:40:14.56 Command Text: sys.sp_releaseapplock
2007-09-11 16:40:14.56 Parameters:
2007-09-11 16:40:14.56 @Resource = SQL02-Video_viMediaPlaylis-71
2007-09-11 16:40:14.56 @LockOwner = Session
2007-09-11 16:40:14.56 @DbPrincipal = db_owner
2007-09-11 16:40:15.17 [0%] The replication agent had encountered an exception.
2007-09-11 16:40:15.17 Source: Unknown
2007-09-11 16:40:15.17 Exception Type: Microsoft.SqlServer.Management.Smo.FailedOperationException
2007-09-11 16:40:15.17 Exception Message: Script failed for Table 'dbo.viMediaPlaylist'.
2007-09-11 16:40:15.17 Message Code: Not Applicable
2007-09-11 16:40:15.17
2007-09-11 16:40:15.17 Call Stack:
2007-09-11 16:40:15.17 Microsoft.SqlServer.Management.Smo.FailedOperationException: Script failed for Table 'dbo.viMediaPlaylist'. ---> Microsoft.SqlServer.Management.Smo.UnsupportedVersionException: Either the object or one of its properties is not supported on the target server version.
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.UserDefinedDataType.GetTypeDefinitionScript(ScriptingOptions so, SqlSmoObject oObj, String sTypeNameProperty, Boolean bSquareBraketsForNative)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.UserDefinedDataType.AppendScriptTypeDefinition(StringBuilder sb, ScriptingOptions so, SqlSmoObject oObj, SqlDataType sqlDataType)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Column.ScriptDdlCreateImpl(StringBuilder sb, ScriptingOptions so)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Column.ScriptDdl(StringCollection queries, ScriptingOptions so)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Table.ScriptTableInternal(ScriptingOptions so, StringBuilder sb, ColumnCollection columns, IndexCollection indexes)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Table.GetTableCreationScript(ScriptingOptions so, StringBuilder sb)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Table.ScriptCreate(StringCollection queries, ScriptingOptions so)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithListWorker(DependencyCollection depList, SqlSmoObject[] objects)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(DependencyCollection depList, SqlSmoObject[] objects)
2007-09-11 16:40:15.17 --- End of inner exception stack trace ---
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(DependencyCollection depList, SqlSmoObject[] objects)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(SqlSmoObject[] objects)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateLogBasedArticleSchScript(Scripter scripter, BaseArticleWrapper articleWrapper, Table smoTable)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateLogBasedArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
2007-09-11 16:40:15.17 at Microsoft.SqlServer.Replication.AgentCore.Run()

View 6 Replies View Related

How To Get DataType Of Column In Table ?

Jul 3, 2004

I want get DataType of Column in Table

ex: nvarchar, varchar, etc...

Help me !!

View 2 Replies View Related

T-SQL (SS2K8) :: Varchar Datatype Field Will Ignore Leading Zeros When Compared With Numeric Datatype?

Jan 28, 2015

Need to know if the varchar datatype field will ingore leading zeros when compared with numeric datatype ?

create table #temp
(
code varchar(4) null,
id int not null
)
insert into #temp

[Code] .....

View 4 Replies View Related

Numeric Datatype To Ssis Variable Datatype Conversion Problem

Apr 24, 2008



Good afternoon,

I have an issue with an ssis variable datatype.

The scenario is as follows:

I have a stored procedure:


PROCEDURE [dbo].[sp_newTransaction]



@sourceSystem varchar(50),

@txOut NUMERIC(18,0) OUTPUT

AS

insert into scn_transaction (sourceSystemName) values(@sourceSystem);

SELECT @txOut = @@identity


Whose purpose is to perform an insert into a table and return me the identity value of the inserted record, which I'll then use throughout the rest of my package. The identity column in the inserted table is numeric(18,0).

I execute the stored proc with the following sql with an OLE DB connection manager:

exec sp_newTransaction ?, ?

The first parameter is a string variable from earlier in the package, and the second is the output parameter. I have the following parameter mappings to the execute sql task:

User:ystxId output numeric 1 -1
User:ourceSys input varchar 0 -1

The proc is correctly called, and the row insesrted, however I get a type conversion error when SSIS attempts to map the return parameter to my package variable... I've tried all sorts of combonations, and can't seem to get it to execute.

At one point I wasn't returning a numeric, but rather an int from the stored proc, and all was well until I went to use the variable in a derived column later in the package, and the type was converted quite incorrectly (a 1 was 77799789080 or some such), indicating a type conversion error likely related to the encoding of the number.

I'd like to keep the datatypes as numeric and make ssis use those - any pointers are greatly appreciated as to what type my package variable should be to allow proper assignment of a sql server numeric type to it.

Thanks much,

B

View 6 Replies View Related

How To Insert IMAGE Datatype In SQL Table

May 15, 2002

How do I add a row with a column of type IMAGE?

IMAGE column will hold a PDF file.
INSERT INTO Table (Image_Col) VALUES (....?)

View 2 Replies View Related

Find Column Name And Datatype Of A Given Table

Jul 22, 2006

Hi,

How do we find the "column name" and "data type" of all the columns in a table. Assuming that I know the Table name or Table Object ID. I am using Microsoft SQL Server 2000.

Thanks
-Sudhakar

View 3 Replies View Related

Using DTS To Move Data To A New Table With Some Datatype Changes

Jul 23, 2005

I have a production application that I am building some upgrades usinga second (empty) copy the database. A few of the upgrades includedchanging the datatypes of a few fields from varchar to int(all thevalues in this column are already numbers)I am not trying to move the data from the production database into theblank database using DTS and the fields that had their datatypeschanged are getting dropped by dts.Is there anyway to move this data easily through dts or through anothermethod and not have the fields with the datatype changes get dropped?I have about 60 tables so it is not as simple as just copying andpasting the data..

View 2 Replies View Related

Storing XML In Datatype Field In A Table

Apr 23, 2015

I am storing xml in an xml datatype field in a table. But when I am generating physical file from the xml field, '&' in the xml field is getting converted into '&' in the physical file. But I want '&' to be intact.

View 5 Replies View Related

Is There An Auto Date Datatype For A Field In The Table

Sep 29, 2004

Is there an AutoType Datatype for Date field. just like the Identity property for an ID field.

It increments by 1 for each new record.

The same way if i add a record to the table can it automatically put todays date or date and time for the field date created in my table.

The reason is i am uploading the record from xml file(Using SQLXMLBULKLOAD) so i dont have a chance to mention on the front end code or in the XSD file.

Any help would be greatly appreciated.

View 1 Replies View Related

How To Change The Datatype Of A Column Without Dropping The Table?

Jan 11, 1999

Can anyone tell me how to change the datatype of a column.
Without dropping and recreating the table...
The table is empty...




THNK YOU VERY MUCH...

View 1 Replies View Related

Create A Table With A Field With Only Time Datatype

Jul 13, 2006

Hello experts,
I want to create a table to store only time in a fileld. There is "DateTime" for my purpose but i dont want to save the Date part only the time part as "12:30:44 AM". I know i can select only time part from Datetime field but i want to save only time.Can anybody help me how can i create that kinda table ?

View 2 Replies View Related

Alter Table Datatype With Null Values

May 7, 2015

I am trying to change a column from a decimal(18,2) to a decimal(18,3). What is the SQL command to alter this table?

SQL Command:

alter table TableName
alter column ColumnName decimal(18,3) [null]

the above command is right ?

View 6 Replies View Related

Changing SP With The Changes In The Table

Jun 1, 2007

Hi All,

If the column names are changed , is there are a easy way to change the referred columns in the SP's. What I am doing is going into each SP and replace the old name with the new name.

Thank you for any help on this.




Necessity is the mother of all inventions!

View 18 Replies View Related







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