вы можете сделать это следующим образом:
Синтаксис SQL 2000
IF EXISTS (SELECT 1 FROM sysobjects WHERE xtype='u' AND name='CVG86_SPE')
BEGIN
INSERT INTO CarnetMaster.GlassLookupCapacitySpecs
(ID, CODE, NVIC, RELEASE, DISCON, DRV, TORQUE, KW, BORESTROKE, VINNUMBER, WIDTH, WHEELBASE, SEATS, COMPRATIO, TOWCAP, STEER,
TURNCIR, HEIGHT, LENGTH, VWIDTH, KERBWT, PAYLOAD, GCM, GVM)
SELECT NEWID(), CODE, NVIC, RELEASE, DISCON, DRV, TORQUE, KW, [BORE-STROKE], [VIN NUMBER], WIDTH, WHEELBASE, SEA, [TS COMPRAT], [IO TOWC],
[AP STE], [ER TURNC], [IR HEIG], [HT LENG], [TH VWID], [TH KERB], [WT PAYLO], [AD GCM], GV
FROM CVG86_SPE
END
SQL 2005 и более поздние версии:
IF EXISTS ( SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'CVG86_SPE' )
BEGIN
INSERT INTO CarnetMaster.GlassLookupCapacitySpecs
(ID, CODE, NVIC, RELEASE, DISCON, DRV, TORQUE, KW, BORESTROKE, VINNUMBER, WIDTH, WHEELBASE, SEATS, COMPRATIO, TOWCAP, STEER,
TURNCIR, HEIGHT, LENGTH, VWIDTH, KERBWT, PAYLOAD, GCM, GVM)
SELECT NEWID(), CODE, NVIC, RELEASE, DISCON, DRV, TORQUE, KW, [BORE-STROKE], [VIN NUMBER], WIDTH, WHEELBASE, SEA, [TS COMPRAT], [IO TOWC],
[AP STE], [ER TURNC], [IR HEIG], [HT LENG], [TH VWID], [TH KERB], [WT PAYLO], [AD GCM], GV
FROM CVG86_SPE
END