CREATE PROCEDURE InsertAccountFromXML(
    @sXML NTEXT
)
AS
begin transaction
    DECLARE @iDoc INT
    EXEC sp_xml_preparedocument @iDoc OUTPUT, @sXML
                       
INSERT INTO dbo.Account (CREATIONDATE,OPENBALANCE,LOGOUTCOUNT,BALANCE,ACCOUNTID,LASTLOGIN,LOGINCOUNT,PROFILE_USERID)
 
 SELECT CREATIONDATE,OPENBALANCE,LOGOUTCOUNT,BALANCE,ACCOUNTID,LASTLOGIN,LOGINCOUNT, PROFILE_USERID
    FROM OPENXML(@iDoc,'/Account/dbo.Account',2)
    WITH (	CREATIONDATE DateTime 'CREATIONDATE', 
			OPENBALANCE Decimal(12,2) 'OPENBALANCE', 
			LOGOUTCOUNT int 'LOGOUTCOUNT',
			BALANCE Decimal(12,2) 'BALANCE',
			ACCOUNTID int 'ACCOUNTID',
			LASTLOGIN DateTime 'LASTLOGIN',
			LOGINCOUNT int 'LOGINCOUNT',
			PROFILE_USERID varchar(250) 'PROFILE_USERID')
    
    DBCC CHECKIDENT ( 'ACCOUNT', RESEED, 100000000 );		
    commit;
    EXEC sp_xml_removedocument @iDoc;
RETURN
