Tag: SQL

Truncate Logfile in SQL Server

Using the code Step 1. Copy/type the below given SQL. Step 2. Change @DBName to < Database Name>, @DBName_log to <Log File Name> Step 3. Execute the SQL. ALTER DATABASE @DBName SET RECOVERY SIMPLE WITH NO_WAIT DBCC SHRINKFILE(@DBName_log, 1) ALTER DATABASE @DBName SET RECOVERY FULL WITH NO_WAIT GO In SQL Server data is stored using…

SQL SERVER – Enable xp_cmdshell using sp_configure

They good old backdoor called xp_cmdshell is – and that’s absolutely ok – disabled by default starting Microsoft SQL Server 2000+. To re-enable that feature, there’s a stored procedure available called sp_configure….