March 20, 2006 at 2:02 am
In my previous programming knowlegde(VFP) i would create and save a permmanent table (A2.DBF) by the following code. How do i do this in T-sql?
SELECT *;
FROM A1.DBF;
ORDER BY A1.loc;
INTO TABLE A2.DBF
thanks,
Allan.
March 20, 2006 at 2:48 am
The SELECT INTO statement creates a new table and populates it with the result set of the SELECT. The structure of the new table is defined by the attributes of the expressions in the select list, for example:
SELECT Shippers.*, Link.Address, Link.City,
Link.Region, Link.PostalCode
INTO NewShippers
FROM Shippers
JOIN LinkServer.DB.dbo.Shippers AS Link
ON (Shippers.ShipperID = Link.ShipperID)
SELECT INTO can be used to combine data from several tables or views into one table. It can also be used to create a new table containing data selected from a linked server.
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
March 20, 2006 at 3:13 am
Thanks, Ryan. it has worked very well.
Allan.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply