Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: Trigger help Date: Tue, 3 Apr 2012 07:33:52 +0000 (UTC) Organization: Erland Sommarskog Lines: 32 Message-ID: References: <11931752.1474.1333025246004.JavaMail.geo-discussion-forums@pbjv6> <19161780.71.1333404285072.JavaMail.geo-discussion-forums@pbcql6> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Tue, 3 Apr 2012 07:33:52 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="G7+Jz22XqYCG8C6rb1H3YA"; logging-data="13764"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AenrPVEveMeH77weF6vsI" User-Agent: Xnews/2005.10.03 Mime-proxy/1.4.c.4 (Win32) Cancel-Lock: sha1:cgTbont1a3bAJw25DVAJ0Seh6kM= Xref: csiph.com comp.databases.ms-sqlserver:951 Johnnyb (john.lutheran@gmail.com) writes: > OK, I am a total novice, it is the 'Do Something Here' part I am stuck > on. I want to copy just the row into s different database on a different > server. INSERT SERVER.dataase.dbo.tbl(....) SELECT .... FROM inserted Where you previously have defined the linked server with sp_addlinkedserver. However, there are two different complications here. One is what you exactly mean with "copy". Does that other table have the same schema? What if there already is a row with the same key value? Or is this not an issue? The other is the fact you the table is on a different server. It may all go smoothly. Or it may give you one hell of a headache to get working. It may work for one user, it may fail for another. If you give the full plot of why you want to copy this row and in what sort of environment you are working in, we might be able to give your more exact advice. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx