In MySQL it is possible to do show create table tablename
What is the SQL Server equivalent?
A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database. You can add SQL statements and functions to a view and present the data as if the data were coming from one single table. A view is created with the CREATE VIEW statement.
Right-click the Products table in SQL Server Object Explorer, and select View Data. The Data Editor launches. Notice the rows we added to the table in previous procedures. Right-click the Fruits table in SQL Server Object Explorer, and select View Data.
Just select table and press Alt + F1 , it will show all the information about table like Column name, datatype, keys etc.
To generate the table DDL via query, you can use show create command. SHOW CREATE TABLE yourTableName; The above syntax is MySQL specific. Suppose, we have a table with the name 'DDLOfTableStudent'.
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.
One that might be close:
exec sp_columns YourTableName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With