Generate insert statements to create data in table TableName
The database object to generate the script against
The name of the table to create
A full SQL WHERE and/or ORDER BY clause restricting or ordering the dataset used to generate the INSERT statements
Omit autonumber columns from script generation
Generate SQL compatible with MS SQL Server rather then MS Access
Restrict the columns generated to this list
CreateInsertStatement "tblKeyNames","WHERE keyname='ReconStatusStr'"
returning three rows as an INSERT statements ...
INSERT INTO tblKeyNames (KeyName,KeyVal,KeyValDesc,KeyValDescShort,Grp1,Grp2,Grp3,Int1,Int2,SortOrder)
VALUES ('ReconStatusStr','J','J','',0,0,0,0,0,0)
go
INSERT INTO tblKeyNames (KeyName,KeyVal,KeyValDesc,KeyValDescShort,Grp1,Grp2,Grp3,Int1,Int2,SortOrder)
VALUES ('ReconStatusStr','K','K','',0,0,0,0,0,0)
go
INSERT INTO tblKeyNames (KeyName,KeyVal,KeyValDesc,KeyValDescShort,Grp1,Grp2,Grp3,Int1,Int2,SortOrder)
VALUES ('ReconStatusStr','L','L','',0,0,0,0,0,0)
go
Note that the preferred format for MSSQL shown below does not work in Access (the UNION operator is not accepted)
INSERT INTO tblKeyNames (KeyName,KeyVal,KeyValDesc,KeyValDescShort,Grp1,Grp2,Grp3,Int1,Int2,SortOrder)
SELECT 'ReconStatusStr','J','J','',0,0,0,0,0,0 FROM xf_tblDummy
UNION SELECT 'ReconStatusStr','K','K','',0,0,0,0,0,0 FROM xf_tblDummy
UNION SELECT 'ReconStatusStr','L','L','',0,0,0,0,0,0 FROM xf_tblDummy