Search..

Tuesday, December 15, 2009

How to delete all the stored procedures in a database??

All of a sudden i faced an issue where in i was forced to delete all the stored procedures in a database and recreate them.. if you are facing the same problem do check this out..

Just Run this script and once its executed successfully u'll see no sp in you database..
USE databasename
GO

declare @procName sysname

declare someCursor cursor FOR
SELECT name
FROM
sysobjects
WHERE type='P'AND objectproperty(id,'IsMSShipped')=0

open someCursor
fetch next FROM someCursor INTO @procName
while @@FETCH_STATUS = 0
begin
exec('drop proc ' + @procName)
fetch next FROM someCursor INTO @procName
end

close someCursor
deallocate someCursor
go
but be careful before running this script, always take a backup of the db before deleting all the sp's.

Happy coding...

Thursday, December 10, 2009

Validating user name and password stored in a xml file from asp.net application

here is a sample xml file where different user names and passwords are stored, when a user logs into the web applications, the developer need to validate the credentials with the one present in the xml file.

Here goes the aspx.cs file code




This is all about validating the user credentials against the values stored in xml file

Cheers...
Happy coding..