Thursday, 17 August 2017

Restore clean Demo data



  1. Open SQL Server Management Studio 
  2. Create new query on the top node 
  1. Run the following query 

DECLARE @DatabaseName nvarchar(50) 
SET @DatabaseName = N'AxDBRAIN' 

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) 

-- Restore snapshot 
restore database AxDBRAIN from Database_snapshot = 'AxDBRAINInitialDataState' 

  1. If you can't login after this, then run the following script: 
update USERINFO 
set SID = 'S-1-19-1389536940-3857197118-2727713988-698496524-3874995910-1598698826-400483830-1280886117-2147114868-3359996204', 
NETWORKDOMAIN = 'https://sts.windows-ppe.net/', 
NETWORKALIAS  = 'tusr1@TAEOfficial.ccsctp.net ', 
IDENTITYPROVIDER = 'https://sts.windows-ppe.net/' 
where ID = 'Admin' 
and Partition = '5637144576'

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...