| Author |
Topic |
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-09-07 : 08:37:24
|
| Hi ,Can anyone help to generate scripts for all the tables in the db using Transact SQL.Thank youNecessity is the mother of all inventions! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-07 : 08:38:31
|
| why dont you make use of Generate SQL Script feature from Enterprise ManagerMadhivananFailing to plan is Planning to fail |
 |
|
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-09-07 : 08:40:41
|
| I am using SQL2005..and will need to do one table at a time. Or I am missing something.Necessity is the mother of all inventions! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-09-07 : 08:42:08
|
use SSMS, select the required table, right click "Script Table as" KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-09-07 : 08:44:49
|
| Khtan, thank you for that,that is what I dont want to do since there are 100s of tables in it.Necessity is the mother of all inventions! |
 |
|
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-09-07 : 08:45:46
|
| Isn't there a smarter way to do it??Necessity is the mother of all inventions! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-09-07 : 08:48:24
|
quote: Originally posted by Vijaykumar_Patil Khtan, thank you for that,that is what I dont want to do since there are 100s of tables in it.Necessity is the mother of all inventions!
you can select the required table(s) you want to script KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-09-07 : 08:51:42
|
| Khtan, I still dont get what you meant by selecting the required tables. Ctrl + click doesnt allow multiply table selection. How do I achive that.Necessity is the mother of all inventions! |
 |
|
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-09-07 : 09:10:46
|
| Hey thank you Madhivanan..It works..but I have some problems . I get these two errorsMsg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online. Msg 15281, Level 16, State 1, Procedure sp_OACreate, Line 1SQL Server blocked access to procedure 'sys.sp_OACreate' of component 'Ole Automation Procedures' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ole Automation Procedures' by using sp_configure. For more information about enabling 'Ole Automation Procedures', see "Surface Area Configuration" in SQL Server Books Online. Necessity is the mother of all inventions! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-09-07 : 09:16:59
|
quote: Originally posted by Vijaykumar_Patil Khtan, I still dont get what you meant by selecting the required tables. Ctrl + click doesnt allow multiply table selection. How do I achive that.Necessity is the mother of all inventions!
Did you try CTRL-A, Ctrl-Left Click ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2007-09-07 : 09:24:54
|
| Go to View\Object Explorer Details there you can multi-select your tablesJim |
 |
|
|
Vijaykumar_Patil
Posting Yak Master
121 Posts |
Posted - 2007-09-07 : 09:38:37
|
| Thank you guys , got it, I need to select the tables in the Summary Window doesnt work in the Object Explorer.Necessity is the mother of all inventions! |
 |
|
|
|