Thanks for the help!
Took care of two issues,
1. auto increment in SQL2005
2. Updating from a view with two tables.
Took care of both with a trigger on the view.
CREATE TRIGGER [iolContactsTrigger] ON [dbo].[OutLookContacts]
INSTEAD OF INSERT
AS
BEGIN
SET IDENTITY_INSERT Company ON
INSERT INTO Company (CompanyID, CompanyName)
SELECT CompanyID, CompanyName
FROM inserted
SET IDENTITY_INSERT Company OFF
DECLARE @newCompanyID int
SELECT @newCompanyID = IDENT_CURRENT('Company')
SET IDENTITY_INSERT Contacts ON
INSERT INTO Contacts (ContactID, CompanyID, NameFirst, NameLast)
SELECT ContactID, CoID, NameFirst, NameLast
FROM inserted
SET IDENTITY_INSERT Contacts OFF
DECLARE @newContactID int
SELECT @newContactID= IDENT_CURRENT('Contacts')
UPDATE Contacts
SET CompanyID = @newCompanyID
WHERE ContactID = @newContactID;
END
- Mike G