Script table in SQL Server

You can script a table from database using a SQL Server Management Studio.





SQL Server Management allows you to script out tables from database using a Script table as option.

This option can be used either to create the table or drop and create the table.

Lets see how you can use Script table as option to generate a script for table.

Following are the steps:

First open SQL Server Management Studio then connect to a server instance.

Next expand the database folder, then expand the Database as shown below.

Now under the database, expand the Tables folder, and right click on table then Point to Script Table as point to CREATE TO then New Query Editor Window.




Here we are scripting a table named HumanResources.Department of database AdventureWorks2017.

Once click on New Query Editor window, you will see a create table script for this table is generated in query editor window.

When you execute this script, it will create a same table with schema.

Similarly, you can script a table usingĀ  Script table as for other option such as DROP and CREATE TO and other.

Also Read..

Generate database scripts with Data

SQL Basics TutorialSQL Advance TutorialSSRSInterview Q & A
SQL Create tableSQL Server Stored ProcedureCreate a New SSRS Project List Of SQL Server basics to Advance Level Interview Q & A
SQL ALTER TABLESQL Server MergeCreate a Shared Data Source in SSRSSQL Server Question & Answer Quiz
SQL DropSQL Server PivotCreate a SSRS Tabular Report / Detail Report
..... More.... More....More
Power BI TutorialAzure TutorialPython TutorialSQL Server Tips & Tricks
Download and Install Power BI DesktopCreate an Azure storage accountLearn Python & ML Step by stepEnable Dark theme in SQL Server Management studio
Connect Power BI to SQL ServerUpload files to Azure storage containerSQL Server Template Explorer
Create Report ToolTip Pages in Power BICreate Azure SQL Database ServerDisplaying line numbers in Query Editor Window
....More....More....More




 112 total views,  2 views today

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.