Tuesday, July 8, 2008

To SHRINK the log file in SQL

Your sql log file size are huge and you are sort of harddisk memory...

Just execute this command in sql browser, with replacing your DB name to "DBName" in below query:

DBCC SHRINKFILE(DBName_log, 5)
BACKUP LOG DBName WITH TRUNCATE_ONLY DBCC SHRINKFILE(DBName_log, 5)

Here 5 is the reduced memory size, your log file will reduced to 5MB.

How to find out w3wp process for the web application

Very general issue when two developers are working on same server, on different sites; they don't know which w3wp process is belong to their application for debugging. And for the solution they just add all the w3wp process whild debugging. with effect of this, other developer site also goes in debug mode. So whats solution... Here it is:
1. go to command promt
2. go to cd windows\system32
3. Type cscript.exe iisapp.vbs
All the w3wp process list will come with the web site... now you can see which PID is for your application....

Now you can debug your application without disturbing other users on same server.

Happy debugging :)