There are several ways to produce the schema of a SQL 2008/2012 table but the on I use is:

  1. export-sql-table-schemaOpen SQL SERVER MANAGEMENT STUDIO
  2. Expand DATABASES
  3. Expand the database in question
  4. Expand TABLES
  5. Right Click on the table in question
  6. Select SCRIPT TABLE AS
  7. Select CREATE TO
  8. Select FILE
  9. Enter an name save the file
  10. You can then open the resulting SQL file with either Notepad or SQL QUERY

Bingo… there is your schema!

[ContactName] [nvarchar](100) NOT NULL,
[ContactPrefix] [nvarchar](25) NULL,
[ContactFirstName] [nvarchar](50) NULL,
[ContactMiddleName] [nvarchar](50) NULL,
[ContactLastName] [nvarchar](50) NULL,
[ContactSuffix] [nvarchar](25) NULL,
[ContactNickname] [nvarchar](50) NULL,
[ContactBusinessPhone] [nvarchar](25) NULL,
[ContactBusinessFax] [nvarchar](25) NULL,
[ContactMobilePhone] [nvarchar](25) NULL,
[ContactHomePhone] [nvarchar](25) NULL,
[ContactOtherPhone] [nvarchar](25) NULL,
[ContactPager] [nvarchar](25) NULL,
[ContactEmail1] [nvarchar](50) NULL,
[ContactEmail2] [nvarchar](50) NULL,

 

 


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *