Reputation: 60731
In MySQL it is possible to do show create table tablename
What is the SQL Server equivalent?
Upvotes: 33
Views: 60028
Reputation: 6581
In addition to mentions that SSMS has a contextual menu option, I see that Azure Data Studio also has a "Script as Create" in the right-click context for the table:
Upvotes: 0
Reputation: 41
if multiple database and schema exists in SQL_Dataserver, Then you need to provide the exact table location with sp_help within single quotes.
exec sp_help 'database_name.schema_name.table_name'
Upvotes: 1
Reputation: 24988
In SSMS, right-click on the table node and "Script Table As" / "Create".
There is no built in 'script this table' T-SQL.
sp_help 'tablename' gives useful table information if that'd do.
Upvotes: 40