create proc sp_restore(@doreh float,@path nvarchar(200))
as
if @doreh=1394
begin
  ALTER DATABASE [1394]
  SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  restore DATABASE [1394] from disk=@path with replace
  ALTER DATABASE [1394]
  SET MULTI_USER with ROLLBACK IMMEDIATE
end
if @doreh=1395
begin
  ALTER DATABASE [1395]
  SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  restore DATABASE [1395] from disk=@path with replace
  ALTER DATABASE [1395]
  SET MULTI_USER with ROLLBACK IMMEDIATE
end
if @doreh=1396
begin
  ALTER DATABASE [1396]
  SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  restore DATABASE [1396] from disk=@path with replace
  ALTER DATABASE [1396]
  SET MULTI_USER with ROLLBACK IMMEDIATE
end
if @doreh=1397
begin
  ALTER DATABASE [1397]
  SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  restore DATABASE [1397] from disk=@path with replace
  ALTER DATABASE [1397]
  SET MULTI_USER with ROLLBACK IMMEDIATE
end
