Click here to Skip to main content
15,904,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends....!
I want to know is there any way to Generate script of table with data or without data
by giving table name same as we do for Procedure.

eg. sp_helptext ProcedureName

when we execute it Then it Provide us Whole definition of that proc. is there any way to get definition of table like this.
Posted

Hi ,
You can take script with data and without check this link
Here[^]
MSDN[^]
With data[^]
Best Regards
M.Mitwalli
 
Share this answer
 
Comments
Varinder Raii 3-May-12 0:57am    
i mean to say is there any command in which i just type name of table and execute it and it gives me create new table Query. I want this because when database has lot of tables then it took lot of time to find table.
Mohamed Mitwalli 3-May-12 14:24pm    
To find specific you can do it from object explorer in management studio and use filter and will show to you the table match with you search and you can create script to the table by right click and create script
Right click on Table Name in sql server management studio --> Then click on "Script table as" option --> then select "Create to" option --> then select "New Query Editor Window".

then the script will be generated in new query window.
 
Share this answer
 
Comments
Varinder Raii 3-May-12 0:57am    
i mean to say is there any command in which i just type name of table and execute it and it gives me create new table Query. I want this because when database has lot of tables then it took lot of time to find table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900