Advanced Select into statement in Access

  • Thread starter Thread starter khushal999p
  • Start date Start date
K

khushal999p

How to do this in MS Access 2000

Select Companyname,Counter = IDENTITY(int, 1, 1) into Custmoers2 from
customers
 
How to do this in MS Access 2000

Select Companyname,Counter = IDENTITY(int, 1, 1) into Custmoers2 from
customers

There is no one-statement equivalent. You could first create the table
then populate it e.g.

CREATE TABLE Custmoers2 (
Companyname NVARCHAR(255) NOT NULL,
Counter INTEGER IDENTITY(1, 1)
)
;
INSERT INTO Custmoers2 (Companyname)
SELECT Companyname
FROM customers
;

Jamie.

--
 
CREATE TABLE Custmoers2 (
Companyname NVARCHAR(255) NOT NULL,
Counter INTEGER IDENTITY(1, 1)
)
;
INSERT INTO Custmoers2 (Companyname)
SELECT Companyname
FROM customers
;

Oops! Perhaps a better syntax for Access/Jet is:

CREATE TABLE Customers2 (
Companyname NVARCHAR(35) NOT NULL,
[Counter] COUNTER
)
;
INSERT INTO Custmoers2 (Companyname)
SELECT Companyname
FROM customers
;

Jamie.

--
 
Back
Top