Good day!
I have some questions:
1 - What is better - use application roles or database user defining role?
In my mind - application roles are easier in implementetion and have a higher security mechanism
2 - What is better in generation PRIMARY KEY (for example "int" datatype) - use IDENTITY property or make own counter like this:
(tran isolation mode can be serializable for this example)
declare
@id numeric ,
@msg varchar(50)
select @id=null
select @msg = "Insert error!"
begin tran
select @id=isnull(max(ID),0)+1 from <table>
insert into <table> [ID,..............]
values (@id,...................)
if @@error<>0 goto FAILURE
commit tran
return
FAILURE:
raiserror 20000 @msg
rollback tran
In my case connection with the central SQL server from the several removed users on the modem is carried out (Dial Up)
Thank you very much for help!!!!
I have some questions:
1 - What is better - use application roles or database user defining role?
In my mind - application roles are easier in implementetion and have a higher security mechanism
2 - What is better in generation PRIMARY KEY (for example "int" datatype) - use IDENTITY property or make own counter like this:
(tran isolation mode can be serializable for this example)
declare
@id numeric ,
@msg varchar(50)
select @id=null
select @msg = "Insert error!"
begin tran
select @id=isnull(max(ID),0)+1 from <table>
insert into <table> [ID,..............]
values (@id,...................)
if @@error<>0 goto FAILURE
commit tran
return
FAILURE:
raiserror 20000 @msg
rollback tran
In my case connection with the central SQL server from the several removed users on the modem is carried out (Dial Up)
Thank you very much for help!!!!