View Single Post
  #8 (permalink)  
Old May 2nd, 2007, 04:10 AM
happygv happygv is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

ERROR is about voiolation of Unique contraint. The destination table has the same row that you are trying to insert again. Since it is set with unique contraint, it wont let you proceed further.

Try this and see how it works
Code:
INSERT INTO dkpc166.f4aLocal.dbo.[dbTables] SELECT * FROM sql09.finance4all_alfa.dbo.[dbTables] 
WHERE Guid = '51FCA305-BCD2-407F-8B40-290B32F2D74C'
IF @@ERROR <> 0
BEGIN 
            Print 'Display error for testing'
            RaiseError (‘abc’, 15,-1)
END
_________________________
- Vijay G
Strive for Perfection