locked
Scripting RRS feed

  • Question

  • I don't know what the "scripting" means in SQL Server.

    (I have experience in T-SQL but not familiar with this term)

    Does it mean general T-SQL statement?

    Can anybody give me some idea and example for me to go through?

    Sunday, August 16, 2020 9:32 AM

Answers

  • The term "scripting" is most often used to mean generating DDL scripts from existing database objects using tools like SSMS, ADS, mssql-scripter, or the SMO API.

    For example, when you right-click on an object in SSMS Object Explorer, one of the context menu options is "Script as", where you can select the option to generate the script as Create to--->New Query Editor Window. The script can then be modified and executed as desired.

    Scripting can also mean the general action of authoring T-SQL scripts so you'll need to understand the context of the term.


    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Proposed as answer by Naomi N Sunday, August 16, 2020 1:13 PM
    • Marked as answer by Jeff0803 Monday, August 17, 2020 9:25 AM
    Sunday, August 16, 2020 10:34 AM
  • Hi Jeff,

    Scripting is a process that generates a plain text script file using the Transact-SQL language (the Microsoft Server version of SQL), which you could view and edit using the SQL Server Management Studio or any text editor and import to another SQL Server instance. The generated text file can include all parts of a database, the schema (database structure) and just the data.

    You could script queries from the GUI like backup and restore, shrink transation log.

    You could also script databases,tables, stored procedures and extended events.

    Please refer more details from below links:

    Script objects in SQL Server Management Studio

    Sharing SQL Server Databases via Scripting

    Best regards

    Melissa


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Marked as answer by Jeff0803 Monday, August 17, 2020 9:25 AM
    Monday, August 17, 2020 1:36 AM
  • Hi Jeff,

    Scripting includes both DML and DDL.

    Best regards

    Melissa


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Marked as answer by Jeff0803 Friday, August 21, 2020 6:59 AM
    Monday, August 17, 2020 9:39 AM

All replies

  • The term "scripting" is most often used to mean generating DDL scripts from existing database objects using tools like SSMS, ADS, mssql-scripter, or the SMO API.

    For example, when you right-click on an object in SSMS Object Explorer, one of the context menu options is "Script as", where you can select the option to generate the script as Create to--->New Query Editor Window. The script can then be modified and executed as desired.

    Scripting can also mean the general action of authoring T-SQL scripts so you'll need to understand the context of the term.


    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Proposed as answer by Naomi N Sunday, August 16, 2020 1:13 PM
    • Marked as answer by Jeff0803 Monday, August 17, 2020 9:25 AM
    Sunday, August 16, 2020 10:34 AM
  • Hi Jeff,

    Scripting is a process that generates a plain text script file using the Transact-SQL language (the Microsoft Server version of SQL), which you could view and edit using the SQL Server Management Studio or any text editor and import to another SQL Server instance. The generated text file can include all parts of a database, the schema (database structure) and just the data.

    You could script queries from the GUI like backup and restore, shrink transation log.

    You could also script databases,tables, stored procedures and extended events.

    Please refer more details from below links:

    Script objects in SQL Server Management Studio

    Sharing SQL Server Databases via Scripting

    Best regards

    Melissa


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Marked as answer by Jeff0803 Monday, August 17, 2020 9:25 AM
    Monday, August 17, 2020 1:36 AM
  • Doesn't the "scripting" include DML but does only DDL?
    Monday, August 17, 2020 9:24 AM
  • Hi Jeff,

    Scripting includes both DML and DDL.

    Best regards

    Melissa


    ""SQL Server related"" forum will be migrated to a new home on Microsoft Q&A SQL Server!
    We invite you to post new questions in the "SQL Server related" forum’s new home on Microsoft Q&A SQL Server !
    For more information, please refer to the sticky post.

    • Marked as answer by Jeff0803 Friday, August 21, 2020 6:59 AM
    Monday, August 17, 2020 9:39 AM