EXEC sp_attach_single_file_db @dbname = ‘pubs’,
@physname =’C:MSSQLDatapubs.mdf
–if it does not work copyrename your mdf file –
-good if you copy the file some where else (just in case) create same named DB with log file in old locationstop sql server servicecopy over new mdf file your old mdf
—-Start you sql server servicethe db will be or in suspect or emergency mode:
then:— if SUSPECT—-use your_dbgo—-
Let’s go see what the ERRORLOG says before– we decide to just repair it–use mastergoalter database suspect_db set emergency—– if your is already there start from this line gouse your_dbgo—- –check what is problemdbcc checkdb(your_db)go—- try select some data from your table–select * from yourtablego—- Go repair it–use mastergoalter database your_db set single_usergodbcc checkdb(your_db, repair_allow_data_loss)goalter database your_db set multi_usergo alter database your_db set onlinego

A handy link for people that have been slammed with SQL Injection attacks

Microsoft has released an advisory for the recent SQL Injection attacks which points to several tools that will help identify and block these type of attacks. The goal of this blog post is to help our audience identify the best tool depending on their role (i.e. Web Developers vs IT administrators). Currently, there are three tools available which serve different purposes and they complement each other.

http://blogs.msdn.com/joestagner/archive/2008/06/24/tools-to-block-and-eradicate-sql-injection.aspx