SQL server does not generate the traditional execution plan for the DDL (Data definition language) command. Due to that CREATE, TRUNCATE, DROP, ALTER etc. do not have execution plan.
See the example.
Creating a table.
CREATE TABLE ddl_operation_demo |
Running this and see the execution plan.
See table has been created but no execution plan is
generated.
Inserting some records
INSERT INTO ddl_operation_demo |
Record Inserted and execution plan is created.
Now altering this
table and adding one column
--Table alter |
No execution plan is generated.
Truncating the table
Run the below script to truncate the table
-- Truncate the table TRUNCATE TABLE DDL_Operation_Demo; |
See the execution plan
Dropping the table
Run below script to drop the table
DROP TABLE ddl_operation_demo; |
See the execution plan
No comments:
Post a Comment
If you have any doubt, please let me know.