Ramblings of a DBA

Tara Kizer
posts - 166, comments - 835, trackbacks - 75

My Links

Advertisement

News

Subscribe
Search this Blog

Archives

Post Categories

Work

September 2006 Blog Posts

Generating SQL Scripts in SQL Server 2005

In SQL Server 2000, you could generate a SQL script easily using the Generate SQL Script wizard.  You could get to it from pretty much anywhere from within Enterprise Manager.  For instance, you can get to it by right clicking on any object in the database, then selecting All Tasks, and then selecting Generate SQL Script.  In SQL Server 2005, it is now called Generate Scripts.  The only place that I can find where you can get to it is if you right click on the database, then selecting Tasks, and then selecting Generate Scripts.  The 2005 wizard does not...

posted @ Wednesday, September 20, 2006 4:47 PM | Feedback (10) | Filed Under [ SQL Server - General ]

Enabling xp_cmdshell in SQL Server 2005

By default, xp_cmdshell is disabled in SQL Server 2005 for security reasons.  I am currently using xp_cmdshell in my backup stored procedure to delete files, so I must enable xp_cmdshell on my SQL Server 2005 instances.  There are two ways to enable this option: Surface Area Configuration tool or sp_configure.  Enabling this option via Surface Area Configuration tool is rather straight forward.  Here is the script to enable xp_cmdshell in SQL Server 2005 via sp_configure: EXEC master.dbo.sp_configure 'show advanced options', 1 RECONFIGURE EXEC master.dbo.sp_configure 'xp_cmdshell', 1 RECONFIGURE

posted @ Thursday, September 14, 2006 4:51 PM | Feedback (5) | Filed Under [ SQL Server - Database Administration ]

Commenting Blocks of Code in SQL Server 2005

In Query Analyzer, we could easily comment blocks of code using Ctrl+Shift+C and uncomment blocks of code using Ctrl+Shift+R. These keyboard shortcuts do not work in Management Studio unless you switch the keyboard scheme to SQL Server 2000. In Management Studio, you can comment blocks of code using Ctrl+K, Ctrl+C and uncomment blocks of code using Ctrl+K, Ctrl+U.  These are the same keyboard shortcuts that you would use to comment blocks of code in Visual Studio .NET, so I'm sure that's why Microsoft decided to switch the shortcuts.  To see other keyboard shortcuts for T-SQL code in Management Studio, open a query window...

posted @ Wednesday, September 13, 2006 4:57 PM | Feedback (6) | Filed Under [ SQL Server - General ]

Powered by:
Powered By Subtext Powered By ASP.NET