Posts

Showing posts from November, 2009

TRIGGER ALTERNATIVE FOR DELETE

CREATE TABLE #testing ([Name] VARCHAR(50)) INSERT #testing VALUES('Raemsh') INSERT #testing VALUES('Sateesh') INSERT #testing VALUES('Madhu') GO CREATE TABLE #HoldDeleteData ([Name] VARCHAR(50)) DELETE FROM #testing OUTPUT DELETED.* INTO #HoldDeleteData WHERE [Name]='Madhu' SELECT *FROM #HoldDeleteData

xp_sendmail:failedwithmailerror 0x80040005

While sending mail from sqlserver 2000 i encountered with the below error.Solution is: First stop the mail by running the below query. exec master.dbo.xp_stopmail Then send try send the mail. The below link is describing about this error. http://support.microsoft.com/default.aspx?scid=kb;en-us;555180

Find Out Orphaned Users in the Database.

To know about the orphaned users in the database we can run below query and find out. Use DatabaseName go sp_change_users_login 'Report'---This procedure used to give the details of orphaned users in the database. After you find the orphaned users take the users type two times the sameway mentioned below EXEC sp_change_users_login 'Update_One','ramesh','ramesh' EXEC sp_change_users_login 'Update_One','kiran','kiran' EXEC sp_change_users_login 'Update_One','RequestDB','RequestDB'