IF NOT EXISTS(SELECT 1 FROM dbo.Foo WHERE Foo_ID=13)
BEGIN
SET IDENTITY_INSERT dbo.Foo ON
INSERT INTO dbo.Foo (Foo_ID, Name, Description)
VALUES (13, 'Whatever', 'blah. blah. blah.')
SET IDENTITY_INSERT dbo.Foo OFF
PRINT('record thirteen was added')
END
No comments:
Post a Comment