	--Close Connection
Use Master
Go
Declare @dbname sysname
Set @dbname = 'NVtest'
Declare @spid int
Select @spid = min(spid) from master.dbo.sysprocesses
where dbid = db_id(@dbname)
While @spid Is Not Null
Begin
        Execute ('Kill ' + @spid)
        Select @spid = min(spid) from master.dbo.sysprocesses
        where dbid = db_id(@dbname) and spid > @spid
End

USE NVtest
GO
select VersionNumber,LastVersionUpdateDateTime from sSystem.tDatabaseInfo
select * from ssetup.torgGroupMaster

DECLARE @lFileName nvarchar(100)='' 
SET @lFileName = 
N'G:\Vidyalaya\VersionUpdate\20240915_NVtest'+ REPLACE(convert(nvarchar(20),GetDate(),120),':','-') +'.bak'
--N'C:\Backup\20240801_NVtest_'+ REPLACE(convert(nvarchar(20),GetDate(),120),':','-') +'.bak'
select @lFileName
BACKUP DATABASE [NVtest] TO  DISK = @lFileName  WITH NOFORMAT, INIT,  NAME = N'NVtest-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 20
,COMPRESSION
GO


--Select * from sSetup.tClassmaster
