Collections:
Generating CREATE TABLE Script on Existing Tables in SQL Server
How To Generate CREATE TABLE Script on an Existing Table in SQL Server?
✍: FYIcenter.com
If you want to know how an existing table was created, you can use SQL Server Management Studio to automatically generate a "CREATE TABLE" script The following tutorial shows you how to do this:
1. Run SQL Server Management Studio and connect to SQL server.
2. On the Object Explorer window, follow the object tree: Databases > FyiCenterData > Tables > dbo.tip.
3. Click right mouse button on dbo.tip. The context menu shows up.
4. Select "Script Table as" > "CREATE to" > "New Query Editor Window". The following script will be displayed:
USE [FyiCenterData]
GO
/****** Object: Table [dbo].[tip]
Script Date: 05/19/2007 21:34:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tip](
[id] [int] NOT NULL,
[subject] [varchar](80)
COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[description] [varchar](256)
COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[create_date] [datetime] NULL,
PRIMARY KEY CLUSTERED (
[id] ASC
)WITH (PAD_INDEX = OFF,
IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
⇒ "SELECT ... INTO" - Creating New Tables With Queries in SQL Server
⇐ "sp_help" - Getting a List of Columns in a Table in SQL Server
2016-11-17, 4150🔥, 0💬
Popular Posts:
How To Drop an Index in Oracle? If you don't need an existing index any more, you should delete it w...
What Is Oracle in Oracle? Oracle is a company. Oracle is also a database server, which manages data ...
How To Insert New Line Characters into Strings in SQL Server Transact-SQL? If you want to break a st...
How To Select All Columns of All Rows from a Table with a SELECT statement in SQL Server? The simple...
Where to find MySQL database server tutorials? Here is a collection of tutorials, tips and FAQs for ...