<p>In SQL Server given a Table/View how can you generate a definition of the Table/View in the form:</p>

<blockquote>
  <p>C1 int,<br>
  C2 varchar(20),<br>
  C3 double</p>
</blockquote>

<p>The information required to do it is contained in the meta-tables of SQL Server but is there a standard script / IDE faciltity to output the data contained there in the form described above ?. </p>

<p>For the curious I want this as I have to maintain a number of SP's which contain Table objects (that is a form of temporary table used by SQL Server). The Table objects need to match the definition of Tables or Views already in the database - it would make life a lot easier if these definitions could be generated automatically.</p>

If you want to duplpicate a table definition you could use:
```
```
select top 0
  *
into
  newtable
from
  mytable
```
```
Edit: Sorry, just re-read your question, and realised this might not answer it. Could you be clear on what you are after, do you want an exact duplicate of the table definition, or a table that contains information about the tables definition?