Jika anda menggunakan "Integrated Security=SSPI;" pada connection string anda maka yang perlu dicermati adalah setting security pada BUILTIN\Users , karena sqlserver akan menggunakan user ini untuk Integrated Security=SSPI. Untuk masalah tidak bisa menghapus database pastikan pada server role hak dbcreator ada pada BUILTIN\Users. Good Luck!
Few questions are always popular. They keep on coming up through email, comments or from co-workers. Finding Last Day of Any Month is similar question. I have received it many times and I enjoy answering it as well. I have answered this question twice before here: SQL SERVER – Script/Function to Find Last Day of Month SQL SERVER – Query to Find First and Last Day of Current Month Today, we will see the same solution again. Please use the method you find appropriate to your requirement. Following script demonstrates the script to find last day of previous, current and next month. ----Last Day of Previous Month SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0)) LastDay_PreviousMonth ----Last Day of Current Month SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0)) LastDay_CurrentMonth ----Last Day of Next Month SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0)) LastDay_NextMonth ResultSet: LastDay_PreviousMonth ———————– 2007-07-31 23:59:59.000 LastDay_Current