Skip to main content

Posts

Showing posts from December, 2014

Force Visual Studio to always run as an Administrator in Windows 8

Dear All
It's a small issues for developer but a headache for every time during development once vs stop and ask for restart with different user credential here is a solution for it 
Please follow the below step to make your VS run with administrator
In Windows 8, you have to right-click devenv.exe and select "Troubleshoot compatibility".select "Troubleshoot program"check "The program requires additional permissions"click "Next", click "Test the program..."wait for the program to launchclick "Next"select "Yes, save these settings for this program"click "Close"
I hope it resolve your problem 
Regards
Rashid Imran Bilgrami

SQL DB Stuck during Take Offline

Dear All,
If your database Take offline process has stuck then don't worry just follow the below steps and you will make your database offline:

Steps

1) Run the following command EXEC sp_who2
2) List down the SPID # run again your database column (DBNAME)
3) kill the process...
4) Once you kill all the processes then run the following command
ALTER DATABASE [myDB] SET OFFLINE WITH ROLLBACK IMMEDIATE

After that your datbase goes offline, now  you will make a copy for it


There is another process if you have many process runing to gather you can use below query

DECLARE @DatabaseName nvarchar(50)
SET @DatabaseName = N'Write your database name'

DECLARE @SQL varchar(max)
SET @SQL = ''
SELECT @SQL = @SQL + 'Kill ' + Convert(varchar, SPId) + ';'
FROM MASTER..SysProcesses
WHERE DBId = DB_ID(@DatabaseName) AND SPId <> @@SPId

EXEC(@SQL)


ALTER DATABASE [Write your database name]
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO


Regards
Rashid Bilgrami