title: SQL Server 2008: copy table structure, and schema
body: <p>thanks for your time. i edited my script, ran it, and still got this name: srp.dbo.gstDataCutover. i used to be able to do this easily with MSSQL2005. we've recently upgraded to 2008. and i dont remember doing it any other way...</p>
  
  <p>Hi,</p>
  
  <p>I'm trying to copy a table structure (columns, datatypes, schema) into a new table to have the same schema and structure, using the sql code below.</p>
  
  <pre><code>SELECT     dbo.gstData.*
  INTO            [dbo.gstDataCutover]
  FROM         dbo.gstData
  WHERE      dbo.gstData.gstID &lt; 1
  </code></pre>
  
  <p>My problem is, when i run this script the new table <code>dbo.gstDataCutover</code> is named as "dbo.gstDataCutover" but the schema is defaulted to the system schema ("srp"), which is actually <code>srp.[dbo.gstDataCutover]</code>.</p>
  
  <p>I want to copy both the structure and the schema.</p>
  
  <p>Thanks!</p>