Month: March 2011

Search within Store Procedure Text !

Recently Needs to findĀ  ‘/’ character in Sql store procedure body and replace with ‘\’ Now Having about 100 Procs and its really boring job to open each proc and have check for it ! .. so find out small handy sql query so that it will give me list of procs contains specific string .. Once list of proc is known .. one can simply edit them ! DECLARE @StringToSearch varchar(100) SET @StringToSearch = ‘%’ + <STRING TO SEARCH> + ‘%’ SELECT Distinct sysobjects.Name FROM sysobjects (NOLOCK) INNER JOIN syscomments (NOLOCK) on sysobjects.Id = syscomments.ID AND sysobjects.Type =...

Read More

Eliminate SQL logfile completely !

Recently I was asked to find out way to reduce the log file of SQL , after few search over google (Thanks to google !), finally we got the way to completely delete the log file , here is the step we did carry out to delete log file completely. Step 1 : Detach the database Step 2 : Goto log file and rename the log file (say xyz_log.ldf to xyz_log1.ldf ) Step 3 : Attach the database back ! Step 4 : verify the database and If everything is good , you are good to delete log file...

Read More