Showing posts with label programmaticly. Show all posts
Showing posts with label programmaticly. Show all posts

Friday, February 24, 2012

enable/disable Extende Stored Procedure in MSSQL2005

Hi,

Anybody now how to this programmaticly ? in registry or TSQL statement ?

Have you looked at the Surface Area Configuration tools - the feature configuration controls? That section allows you to disable buckets of XPs that are used by a feature you don't use, but you cannot deactivate only individual XPs in a bucket.

Thanks

Laurentiu

|||

if you refer only at running xp_cmdshell , i quote from Books Online

" Introduced in SQL Server 2005, the xp_cmdshell option is a server configuration option that enables system administrators to control whether the xp_cmdshell extended stored procedure can be executed on a system. By default, the xp_cmdshell option is disabled on new installations and can be enabled by using the Surface Area Configuration tool or by running the sp_configure "

for others xp's i didn't find anything

Friday, February 17, 2012

Empty the transaction log

Hi i would like to know how to empty the transaction log programmaticly.

Someone got a clue? :)Maybe create a stored procedure that runs a transaction log backup and then calls DBCC ShrinkDatabase (If you want to shrink it)? The user you use to connect to the database will need the proper permissions.|||I think backing up the transaction log automatically truncates the inactive portion of the log. Or is that incorrect...?

-Ian|||i sure would like to know because i have a program that uses transactions and uses it extremely frquently so the log grows in size in a geometric rate :)|||Every change to the database is written to the log first whether it's within a transaction or not. The log grows depending on the write activity against the database, not whether or not a transaction is used.|||ok, but how do i empty it programmaticly?
i wanna build a page where the user can empty it.|||When you backup the transaction log it truncates it. You can even do a BACKUP LOG <dbname> WITH TRUNCATE_ONLY which just removes the extra log entries, but its not recommended. Either option will truncate the log, so it most likely will not grow for a while, but it does not shrink the actual log, which you need to do a DBCC SHRINKDATABASE or DBCC SHRINKFILE to do. The SQL Server Books Online tells you all about it onShrinking the Transaction Log andTruncating the Transaction Log.