• Register
0 votes
88 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.

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

38.6k points

Related questions

0 votes
1 answer 195 views
195 views
Problems: I am new to programming, I need help, can anyone help me? What type of loop structure repeats the code a specific number of times?
asked Feb 14, 2020 maddi86 5.4k points
0 votes
1 answer 18 views
18 views
Problem: What is structure and union in C++? What is structure and union with example? What is a union in C ++? Which is better structure or union? the total memory space allocated is equal to the member with largest size. All other members share the same memory space. What is the biggest difference between structure and union?
asked Dec 23, 2020 Mashhoodch 13k points
0 votes
1 answer 4 views
4 views
Problem: In something not a structure or union
asked 3 days ago Chi Omega 168k points
0 votes
1 answer 12 views
12 views
Problem: Difference between structure and array in c?
asked Jul 11 Nahil 128k points
0 votes
1 answer 5 views
5 views
Problem: Difference between union and structure in c.
asked Jul 11 Shima 126k points
0 votes
1 answer 15 views
15 views
Problem: Tell me how to write a C program for employee payroll using structure?
asked May 27 Junia Phoebe 83.8k points
0 votes
1 answer 34 views
34 views
Problem: Is there any difference between lifo and fifo in data structure?
asked May 22 Junia Phoebe 83.8k points
1 vote
1 answer 864 views
864 views
Problem: I wanted to know what is the difference between internal and external sorting in data structure?
asked Apr 30 Raj Tyagi 16k points
0 votes
1 answer 9 views
9 views
Problem: Is it possible for a structure to contain a pointer to its own structure category as a member?
asked Apr 14 jamuna1 30.2k points
0 votes
1 answer 25 views
25 views
Problem: Difference between a Structure and a Union.Is there any other OS level difference?
asked Apr 12 Humaira ahmed 50.7k points