Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

How to update table on different Data Base ?
Hi Everyone,

I have very small question.

Actually I have two Databases on same SQL Server say DATABASE1 and
DATABASE2.

Both databases have one table called TABLE1 as exact copy. I am updating
DATABASE1.TABLE1 using ASP code. I want DATABASE2.TABLE1 also to be updated
with same data but not via ASP code.

Is there any way of pulling or pushing data for TABLE1 only ?

Kind Regards,

Fayyaz




Report this thread to moderator Post Follow-up to this message
Old Post
FAYYAZ
04-28-05 12:23 PM


Re: How to update table on different Data Base ?
"Triggers are often used for enforcing business rules and data integrity.
SQL Server provides declarative referential integrity (DRI) through the
table creation statements (ALTER TABLE and CREATE TABLE); however, DRI does
not provide cross-database referential integrity."

FROM

http://msdn.microsoft.com/library/d... />
2_7eeq.asp



HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---
"FAYYAZ" <anyone@anyone.com> schrieb im Newsbeitrag
news:OVFPMX%23SFHA.1896@TK2MSFTNGP14.phx.gbl...
> Hi Everyone,
>
>    I have very small question.
>
>    Actually I have two Databases on same SQL Server say DATABASE1 and
> DATABASE2.
>
>    Both databases have one table called TABLE1 as exact copy. I am
> updating
> DATABASE1.TABLE1 using ASP code. I want DATABASE2.TABLE1 also to be
> updated
> with same data but not via ASP code.
>
> Is there any way of pulling or pushing data for TABLE1 only ?
>
> Kind Regards,
>
> Fayyaz
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Jens Süßmeyer
04-28-05 12:23 PM


RE: How to update table on different Data Base ?
Hope this will answer the problem:

CREATE TRIGGER <TRIGGER>
ON DATEBASE1.TABLE1 FOR UPDATE AS
UPDATE DATEBASE2.TABLE1
SET DATEBASE2.TABLE1.COLUMN1 = INSERTED.COLUMN1
DATEBASE2.TABLE1.COLUMN2 = INSERTED.COLUMN2
DATEBASE2.TABLE1.COLUMN3 = INSERTED.COLUMN3
DATEBASE2.TABLE1.COLUMN4 = INSERTED.COLUMN4
DATEBASE2.TABLE1.COLUMN5 = INSERTED.COLUMN5
WHERE DATABASE2.TABLE1.PRIMARY_KEY = INSERTED.PRIMARY_KEY
GO

thanks and regards
Chandra


"FAYYAZ" wrote:

> Hi Everyone,
>
>     I have very small question.
>
>     Actually I have two Databases on same SQL Server say DATABASE1 and
> DATABASE2.
>
>     Both databases have one table called TABLE1 as exact copy. I am updati
ng
> DATABASE1.TABLE1 using ASP code. I want DATABASE2.TABLE1 also to be update
d
> with same data but not via ASP code.
>
> Is there any way of pulling or pushing data for TABLE1 only ?
>
> Kind Regards,
>
> Fayyaz
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Chandra
04-28-05 12:23 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 10:25 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006