Thank you for sending emails.I appreciate it.Now let do some coding.
Suppose you want to insert the result set of a store procedure or a dynamic batch into
a new table,but you do not know what the schema is that you need to create.
You can use SELECT INTO statement and OPENQUERY.Here is how it works:
1-SELECT INTO format
SELECT
INTO
FROM
ex:
SELECT CustomerID,CompanyName,Country
INTO US_Customers
FROM Northwind.dbo.Customers
NB Do not create US_Customers in Northwind database before executing the query.This table
US_Customers is created automatically for you after query execution.
2-The main query of concern(see title)
EXEC sp_serveroption
SELECT *INTO
That`s all i want to share with you today.
See you!
Talley Ouro
.Net Developer(Web&Smart Client Development)
Email: johnstalley@live.com
No comments:
Post a Comment