Update Table Across Servers

Sep 13, 2001

Hi when I run this sql script: I get an error message
update server.dbname.DBO.ap_payment
set pay_flag = -2 -- means were not updated in vi approved table
where ISNUMERIC(venid)<>1
and pay_flag =0

I am not sure what this means, can anyone help me. thanks


Server: Msg 7306, Level 16, State 2, Line 1
Could not open table '"CESI"."DBO"."ap_payment"' from OLE DB provider 'SQLOLEDB'. The provider could not support a row lookup position. The provider indicates that conflicts occurred with other properties or requirements.
[OLE/DB provider returned message: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.]

thanks,
Ali

View 1 Replies


ADVERTISEMENT

Development Servers, Auto-update Live Servers

Aug 21, 2001

can anyone tell me if they know of a way to automate the update process from development servers to live server, with little interference from an administrator

I have a development team that are constantly updating their databases along with their ASP code, and want to publish changes an a weekly basis. They have asked me for a way to take their new structures, tables, procedures etc, and copy them to the live servers, but NOT to interfere with existing customer data.

Funny I know – and I hate the idea btw :(

Any references, contacts, 3rd party tool recommendations welcome,

Thanx,

Darren

View 1 Replies View Related

Update Across Servers

Jul 8, 2002

Does anyone have the general syntax for updating one database on one server with info from another database on a different server? Both are SQL Server 7.0.

Thanks. john

View 4 Replies View Related

Update Query Across Servers

Jul 10, 2007

Hi,
 I'm trying to write an update query across two servers but getting getting two errors.
The first server is called:  blatweb2 
The second server is called:  blbr-teamserv
This is the query I'm trying to use:1 update blatweb2.dbo.knousefoods.products a
2 Set LuckyLeafPieFillingSort =
3 (Select LuckyLeafPieFillingSort from blbr-teamserv.dbo.knouse.products b where a.productname = b.productname) I'm getting the following errors. Do you know what could be wrong? ThanksMsg 102, Level 15, State 1, Line 1Incorrect syntax near 'a'.Msg 102, Level 15, State 1, Line 3Incorrect syntax near '-'.
 
 

View 2 Replies View Related

Trigger Update Between Servers

May 1, 2008

Hello All,

This is my first time posting here so thanks for you assistance in advance.

I have a project I am working on where I need to use database triggers to upon update update a table on another SQL server. Below is how it would work.

Server A (SQL 2000)
Table A is updated (execute trigger to update Server B, Table B)

Server B (SQL 2005)
Table B (Tabled updated by SQL 2000, server).

I don't know if this can be done using the SQL server technology itself or how I would do it. Is a .NET or other program service have to be used in this scenario?

Your help is appreciated.

Thanks,

Davy

View 2 Replies View Related

Different UPDATE Behaviors Across Servers

Apr 24, 2007

Hi!I have a stored procedure that takes 22 minutes to run in oneenvironment, that only takes 1 sec or so to run in anotherenvironment. Here is the exact situation:Database 1 on Server 1 vs. Database 2 on Server 2 - the data isexactly the same, and the tables and index structures are exactly thesame. Implicit transactions are turned off on both databases.Stored procedure:BEGIN TRANSACTION--step 1TRUNCATE myTable--step 2INSERT INTO myTable VALUES ('myValues')--step 3UPDATE aSET rating=AVG(someValues)FROM myTable aJOIN otherTable bON a.column1=b.column1GROUP BY someColumnsCOMMIT TRANSACTIONThe update statement on the problem server is the only step that takesforever. While it is running, I don't see anything that could beblocking the statement. I used the following queries to determine ifthere was another process blocking it:select spid AS Blocked, blocked AS Blocking, waittime, cmd, substring(nt_username, 1, 15), dbid, physical_io,substring(hostname, 1, 15), program_name, lastwaittype, waitresource,memusagefrom master.dbo.sysprocesses where blocked <0order by waittime descselect dbid, name from sysdatabases where dbid in (select dbid frommaster.dbo.sysprocesses where blocked <0)select spid AS BlockingFromAbove, blocked AS TrueBlockingQuery,waittime, cmd, substring (nt_username, 1, 15), dbid, physical_io,substring(hostname, 1, 15), program_name, lastwaittype, waitresource,memusagefrom master.dbo.sysprocesses where spid in (select blocked frommaster.dbo.sysprocesses where blocked <0)order by waittime descWhen I change the UPDATE statement to a SELECT, it still takes longerthan it does on the test server (1 min 35 sec vs. severalmilliseconds).What could be causing the UPDATE to take forever on one server/database, and run without a problem on another?I am at a loss! Any help would be greatly appreciated.

View 1 Replies View Related

Update Data On SQL2005 Linked Servers To DB2

Oct 25, 2007

Hi all.

I need your help.

I create a linked server on SQL 2005 server using IBMDA400 as provider.

I create a VBscript to update some data on DB2, and issue begin trans and commit trans. Kindly refer to below code.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Set oKCDat = CreateObject("KCDAT.kcdatapi")
Set objConnection = oKCDat.OpenConnection_SQL(strDataSource,strDB, strUserID, strPassword)

Set rs = CreateObject("ADODB.Recordset")

strName = "TEST1"

strTemp1 = "2"
strTemp2 = "3"
intTemp1 = 199

strSQLStatement = "SELECT * FROM QS36F.TEST WHERE PRACNM = ''" & strName & "''"
strUpdSQL = "TEST1 = '" & strTemp1 & "', TEST2 = '" & strTemp2 & "', TEST3 = " & intTemp1

strSQL = "UPDATE OPENQUERY(TESTDB2," & "'" & strSQLStatement & "')" & " SET " & strUpdSQL & ";"


objConnection.BeginTrans

objConnection.Execute(strSQL)

objConnection.CommitTrans


objConnection.Close


Set rs = Nothing
Set oKCDat = Nothing
Set objConnection = Nothing

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------


When i run above script, it prompt me an error message;
"Microsoft OLE DB Provider for SQL Server
The requested operation could not be performed because OLE DB provider "IBMDA400" for linked server "TESTDB2" does not support the required transaction interface."

If i run it without "begintrans" and "committrans", it update the data successfully.

Does anyone know about it?

Highly appreciated for above matters.


Regards

View 3 Replies View Related

Combine Tables From 2 SQL Servers With Different Schemas And Update As New Data Is Entered

Mar 28, 2008

I have 2 SQL server 2000 machines, I need to take a table from each one and combine them together based on a date time stamp. The first machine has a database that records information based on an event it is given a timestamp the value of variable is stored and a few other fields are stored in Table A. The second machine Table B has test data entered in a lab scenario. This is a manufacturing facility so the Table A data is recorded by means of a third party software. Whenever a sample is taken in the plant the event for Table A is triggered and recorded in the table. The test data may be entered on that sample in Table B several hours later the lab technician records the time that the sample was taken in Table B but it is not exact to match with the timestamp in Table A. I need to combine each of these tables into a new SQL server 2005 database on a new machine. After combining the tables which I am assuming I can based on a query that looks at the timestamp on both Tables A & B and match the rows up based on the closest timestamp. I need to continuously update these tables with the new data as it comes in. I havent worked with SQL for a couple of years and have looked at several ways to complete this task but havent had much luck. I have researched linked servers, SSIS, etc Any help would be greatly appreciated.

View 10 Replies View Related

Update One Colum With Other Column Value In Same Table Using Update Table Statement

Jun 14, 2007

Hi,I have table with three columns as belowtable name:expNo(int) name(char) refno(int)I have data as belowNo name refno1 a2 b3 cI need to update the refno with no values I write a query as belowupdate exp set refno=(select no from exp)when i run the query i got error asSubquery returned more than 1 value. This is not permitted when thesubquery follows =, !=, <, <= , >, >= or when the subquery is used asan expression.I need to update one colum with other column value.What is the correct query for this ?Thanks,Mani

View 3 Replies View Related

How To Correctly Update A Table Which Values Can Be Either Inserted/updated/deleted On Update?

Feb 16, 2006

Hi SQL fans,I realized that I often encounter the same situation in a relationdatabase context, where I really don't know what to do. Here is anexample, where I have 2 tables as follow:__________________________________________ | PortfolioTitle|| Portfolio |+----------------------------------------++-----------------------------+ | tfolio_id (int)|| folio_id (int) |<<-PK----FK--| tfolio_idfolio (int)|| folio_name (varchar) | | tfolio_idtitle (int)|--FK----PK->>[ Titles]+-----------------------------+ | tfolio_weight(decimal(6,5)) |+-----------------------------------------+Note that I also have a "Titles" tables (hence the tfolio_idtitlelink).My problem is : When I update a portfolio, I must update all theassociated titles in it. That means that titles can be either removedfrom the portfolio (a folio does not support the title anymore), addedto it (a new title is supported by the folio) or simply updated (atitle stays in the portfolio, but has its weight changed)For example, if the portfolio #2 would contain :[ PortfolioTitle ]id | idFolio | idTitre | poids1 2 1 102 2 2 203 2 3 30and I must update the PortfolioTitle based on these values :idFolio | idTitre | poids2 2 202 3 352 4 40then I should1 ) remove the title #1 from the folio by deleting its entry in thePortfolioTitle table2 ) update the title #2 (weight from 30 to 35)3 ) add the title #4 to the folioFor now, the only way I've found to do this is delete all the entriesof the related folio (e.g.: DELETE TitrePortefeuille WHERE idFolio =2), and then insert new values for each entry based on the new givenvalues.Is there a way to better manage this by detecting which value has to beinserted/updated/deleted?And this applies to many situation :(If you need other examples, I can give you.thanks a lot!ibiza

View 8 Replies View Related

Copy Table Different SQL Servers

Sep 9, 2005

Hi, How can you copy a table from one server to another server using SELECT statement?

View 1 Replies View Related

Plz Help...update Value In Multiple Db Table Using Single 'update Command'

Mar 18, 2005

hi,friends

we show record from multiple table using single 'selectcommand'.
like....
---------
select *
from cust_detail,vend_detail
---------

i want to insert value in multiple database table(more than one) using single 'insert command'.
is it possible?
give any idea or solution.

i want to update value in multiple database table(more than one) using single 'update command'

i want to delete value in multiple database table(more than one) using singl 'delete command'
it is possible?
give any idea or solution.

it's urgent.

thanks in advance.

View 2 Replies View Related

Transact SQL :: Firing After Update Trigger - On Table Row Update

Jul 8, 2015

I have a table where table row gets updated multiple times(each column will be filled) based on telephone call in data.
 
Initially, I have implemented after insert trigger on ROW level thinking that the whole row is inserted into table will all column values at a time. But the issue is all columns are values are not filled at once, but observed that while telephone call in data, there are multiple updates to the row (i.e multiple updates in the sense - column data in row is updated step by step),

I thought to implement after update trigger , but when it comes to the performance will be decreased for each and every hit while row update.

I need to implement after update trigger that should be fired on column level instead of Row level to improve the performance?

View 7 Replies View Related

How To Copy One Table From One Database To Another On Different Servers?

Jul 31, 2007

 Hello. I need to copy all of the rows in a table from a database on one server, to another existing table of the same name in a different database on a different server.  I'm trying to use a SELECT INTO statement.  Any idea how to do this?I've tried SELECT          *   INTO                  DestinationServer.dbo.DestinationDB.DestinationTableFROM               SourceTable AS SourceTable_1 But this doesn't work, saying there are too many prefixes. Any idea how to do this? 

View 5 Replies View Related

Validating Table Row Counts Across Servers

Feb 9, 1999

I periodically transfer large databases across servers and have had problems with tables on the target being empty (to rule out errant deletes by other developers). I'd like a way to do a table by table row count comparison between the two servers, similar to the way sp_compare_db (found here at Swynk) does on a single server. Even a method of referencing tables by including the server name would help.

View 1 Replies View Related

Notify Table Updates Across Servers

Nov 6, 2007



Simple question:

I have two servers S1 and S2. Inmediately after new data on S1 is available I want to perform some actions on S2.

I can use a trigger on S1, but if S2 is down the transaction on S1 will be lost. I could use database replication but I only need one single table in S1 to report changes to S2

Is there any other approach I could use?

Thanks.



View 1 Replies View Related

How To Improve Performance With A Join Between 2 Table From 2 SQL Servers

Aug 18, 2006

I am making a ASP.NET web application that involves 2 SQL Server(A & B).
I created a view in SQL server A pointing to the table in SQL Server B. I found out my application will run REALLY slow when accessing such a view. so I try to avoid using them. But in the case of 2 table joining from 2 different SQL Servers, I have no choice.
Can anyone help me with this?
Thanks!

View 4 Replies View Related

Cannot Drop A Table On Two Servers After Merge Replication

Oct 3, 2001

Hi,

I tried with success to replicate a table_test_repl from my local server to an other server.

I used only one table for testing.

After that, i can't drop the 2 tables a_test_repl (on my local server and the other : I've got a message 'cannot drop the table because it is published for replication'

What can I do? I need absolutely to drop these tables to keep a clean model
and I can't drop the database and try again.

Thanks to your answers
Axel

View 1 Replies View Related

Verifying A Table's Column Count Across Servers?

Jan 31, 2005

Hi folks!

The boss has decided that the data from a table we have on one database (containing daily data) needs to be copied to a "history" table on a different database, on a different server.

The transfer will probably be done with a scheduled stored procedure, and all columns will be transferred EXCEPT for two columns in the source table, which are not present in the destination table. This means instead of an "INSERT Dest SELECT * FROM Source" I have to do an "INSERT Dest SELECT yada,yada,yada... FROM Source" in order to disregard the columns we don't care about. NO problem.

I was thinking (you should smell trouble - and sawdust burning at this point) that this leaves us open to a punch below the belt later when a new column is added to the Source table, since we are using a definitive list of columns to move rather than a *, and the new column could be added without the otherwise system-generated, *-sponsored "gentle reminder" that it also needs to be added to the Dest table. I'm not as convinced as The Boss that "Oh, I'm sure we'll remember to add it to the history table when that happens" :lol:

So, long story shorter (nah...too late for that) - I figure I can write a check at each day's historical transfer on the count of columns in one table verses the other, and send an email or fail the job if the count doesn't make sense.

For example, if the Source table has 34 columns, since we don't care about two of them, the Dest table should have 32 columns, if things are still in synch. OK, I think (insert burning sawdust smell here), I can use a SysObjects thang to count rows. BOL points out INFORMATION_SCHEMA.COLUMNS as a possibility.

Here is the code I think (sawdust) can be used:select ((select count(*) from SourceDb.INFORMATION_SCHEMA.columns
where table_name = 'Source') - (select count(*) from HISTSERVER.DestDb.INFORMATION_SCHEMA.columns
where table_name = 'Dest')) as ColumnDiff

Trouble is...this fails because apparently the INFORMATION_SCHEMA thang doesn't do well with remote servers.

Can anyone figure a way around this, or suggest an alternative? I'm still looking, but thought I'd also toss it out onto the board for your generous consideration.

Thanks - and can you BELIEVE the year is already 1/12th of the way OVER?!?!?!
Paul

View 4 Replies View Related

Fastest Way To Move Huge Table Across Servers

Mar 23, 2008

Hi Guys,

What is the fast way to move huge table (77 million) records with 25 columns across servers? The servers are not linked though.

Thanks for the help.

View 3 Replies View Related

Table Snapshots Accross Multiple Servers

Apr 20, 2007

Hi,


Is there a way to take a snapshot of a table at precisely the same time on multiple servers and write the table snapshot to another 'work' database? I'm asking in this forum hoping that perhaps SSIS has a built in tool to help with this. I'm wanting to audit table(s) accross seven different servers. In order to do this I want to make sure that I have the table at the same moment in time on all the servers. I plan on using the tablediff utility to then compare each table on each server against one another. If somebody knows a better method to do this please let me know.





Thanks,

Phil

View 1 Replies View Related

Sql Report Works Fine On Internal Servers - Hosed On External Servers - Need Some Help

Nov 21, 2007

I have a report that was designed using SQL Reporting Services that sits on a SQL reporting server. It's nothing too exciting, it is essentially a three page application with legal jumbo on pages 2 and 3 and applicant data in fields on page 1.

We use rectangles to force page breaks to page 2 and to page 3.

When running the report on the report server, it shows and prints fine.

When running the report from the QA website internally, it shows and prints just fine.

When running the report from the production website from a machine internally, it shows and prints just fine.

When running the report from outside of the company network, the report is jacked. It obliterates large chunks of text, crams text together, and creates blank pages.

I need help in determining where I even begin with trouble shooting this!

View 1 Replies View Related

Trigger To Update A Table On Insert Or Update

Feb 15, 2008



Hello

I've to write an trigger for the following action

When a entry is done in the table Adoscat79 having in the index field Statut_tiers the valeur 1 and a date in data_cloture for a customer xyz

all the entries in the same table where the no_tiers is the same as the one entered (many entriers) should have those both field updated

statut_tiers to 1
and date_cloture to the same date as entered

the same action has to be done when an update is done and the valeur is set to 1 for the statut_tiers and a date entered in the field date_clture

thank you for your help
I've never done a trigger before

View 14 Replies View Related

Two Databases/servers - Can I Connect To Both To Create New Table On One Server?

Nov 20, 2007



Good morning all,

I need to create a new table on a SQL Server 2005 Database, but the data needed for the table is kept in different databases on different servers.

Half the data is on the SQL 2005 database, so that shouldn't be too much of a problem, but the other half is on a SQL Express database on a different server, is it possible to write a T-SQL query to retrieve this data on the other server?

Normally I use a create table + insert into kind of query to create custom tables but I don't know how to connect to the SQL Express server/database using T-SQL (if it's possible at all?) to do this.

Any tips, hints, ideas very welcome. Please use small words and short sentences.

Thanks,

Paul

View 3 Replies View Related

Linking SQL 2005 Servers To SQL 2000 Servers Problems

Sep 27, 2007

I am in the middle of a major migraton project, moving from x86 SQL 2000 to IA64 SQL 2005. I have a business need to link to several legacy servers. I have a number of problems I am trying to solve.

1) Linking a Kerberos server to a non-Kerberos server.
2) Linking x64 or IA64 servers to x86 servers.
3) Linking SQL 2005 to SQL 2000.

Two of the errors I am encountering are:
------------------------------
TCP Provider: An existing connection was forcibly closed by the remote host.
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
OLE DB provider "SQLNCLI" for linked server "SCDC250DB" returned message "Communication link failure".
(Microsoft SQL Server, Error: 10054)
------------------------------
And
------------------------------
The OLE DB provider "SQLNCLI" for the linked server "SCDC250DB" reported an error. Authentication failed.
Cannot initialize the data source object of OLE DB provider "SQLNCLI" for linked server "SCDC250DB".
OLE DB provider "SQLCLI" for linked server "SCDC250DB" returned message "Invalid authorization specification".
(Microsoft SQL Server, Error: 7399)

If someone has worked through these problems before, I would appreciate it if you could direct me to the relevant documentation to resolve these issues.

Thanks!


Brandon Forest

Database Administrator

Data & Web Services Team

Sutter Connect Information Technologyforesb@sutterhealth.org

View 2 Replies View Related

UPDATE Query To Update One Table From Another

Sep 15, 2001

I'm looking for a query that can "batch" update one table from another. For example, say there are fields on both tables like this:
KeyField
Value1
Value2
Value3
The two tables will match on "KeyField". I would like to write one SQL query that will update the "Value" fields in Table1 with the data from Table2 when there is a match.

View 1 Replies View Related

Update Syntax For Same Table Update

Aug 7, 2003

How do I write an update query to update a column in TabA with the information from other records in TabA?

View 2 Replies View Related

Update Trigger To Update Another Table

Dec 17, 2001

I have an update trigger which fires from a transactiion table to update a parent record in another table. I am getting no errors, but also no update. Any help appreciated (see script below)

create trigger tr_cmsUpdt_meds on dbo.medisp for UPDATE as

if update(pstat)
begin
update med
set REC_FLAG = 2
from deleted dt
where med.uniq_id = dt.uniq_id
and dt.pstat = 2
and dt.spec_flag = 'kop'
end

View 1 Replies View Related

Update Table And Need Update View

Sep 26, 2007

Please help.
give you example
I have table = Product
and column = Product_name varchar(20)

Then I have view call v_product this view select * from product.

Each time I modify product type become varchar(25). My view v_product didn't get change. I have to alter the view

The question I have. I have a lot of tables more then 80 need to change the data type. Any one have best way refesh the view??? Thank you

View 11 Replies View Related

I Imported A SQL Table Into SQL DataBase, But I Can Not Update This Table Even With SQL Server Management Studio

Jan 8, 2008

I imported a SQL Table into SQL DataBase, But I can not update this table even with SQL Server management Studio
When I change any data on mentioned table above, Red exclamation sign appears left of the record .
How can I correct this problem?
 Thanks.

View 1 Replies View Related

Transact SQL :: Update Table With Its Value And Data From Row In Temp Table For Matching Record?

Oct 25, 2015

I have a temp table like this

CREATE TABLE #Temp
 (
  ID int,
  Source varchar(50),
  Date datetime,
  CID varchar(50),
  Segments int,
  Air_Date datetime,

[code]....

Getting Error

Msg 102, Level 15, State 1, Procedure PublishToDestination, Line 34 Incorrect syntax near 'd'.

View 4 Replies View Related

Trying To Save Editted Textbox Value In Table But Original Value Saves Instead - Trouble With Table Update Query

Jan 9, 2008

This program gets the values of A and B passed in. They are for table columns DXID and CODE. The textbox GET1 is initialized to B when the page is loaded. When I type another value in GET1 and try to save it, the original initialized value gets saved and not the new value I just typed in. A literal value, like "222" saves but the new GET1.TEXT doesn't.

View 1 Replies View Related

Stored Procedure That Fetch Each Row Of A Table And Update Rows In Another Table

Jan 31, 2006

I am working with the following two tables:

Category(NewID,OldID)
Link(CategoryID,BusinessID)

All fields are of Integer Type.

I need to write a stored procedure in sql 2000 which works as follows:

Select all the NewID and OldID from the Category Table
(SELECT NewID,OldID FROM Category)

Then for each rows fetched from last query, execute a update query in the Link table.

For Example,

Let @NID be the NewID for each rows and @OID be the OldID for each rows.
Then the query for each row should be..

UPDATE Link SET CategoryID=@CID WHERE CategoryID=@OID

Please help me with the code.

Thanks,
anisysnet

View 1 Replies View Related







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