• Register
0 votes
53 views

Problem :

I am very new to SQL.I and my colleague have recently joined SQL project now I have a table on my SQL Server and I want to export the structure of the table so that I can send it to my colleague. Which SQL command should one fire to get the required table structure? Please note that I don't have any access to the SQL Server Management Studio.

by (3.9k points)

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I also had faced a same issue in when I started working on SQL. I did lot of research on it and found the solution on my issue. I can say that it is the very common problem with the people getting started with SQL.

You can try below command

sp_help '<TableName>'

It will give you the required structure of your table

Also you can try to use a information_Schema to get the detailed information, as shown below

SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'TableName' 

You should check this out http://msdn.microsoft.com/en-us/library/ms186778.aspx

OR

Visual Studio has many tools for designing and browsing the database schema under  the Data Connections in the Server Explorer. Certain versions also have the full schema and also come up with data comparison tools like Red Gate's Sql Compare

by (38.6k points)

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
...