Reputation: 31
Is there a way to create a new table based on an existing one (select) without populating the new table with data from the existing one?
example, this query populates the new table:
CREATE TABLE tempTable NO PARTITION AS
( SELECT
TRIM(COMPANY_ID) AS COMPANY_ID
FROM
{schema}.table2
FOR READ UNCOMMITTED ACCESS IN SHARE MODE );
Thanks.
Upvotes: 0
Views: 68
Reputation: 3257
In SQL Server, you can do
SELECT *
INTO NewTable
FROM OldTable
WHERE 1 = 0
Upvotes: 1