Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Questions MS SQL (7/2000)

Status
Not open for further replies.

GoodDay

Programmer
Nov 17, 2002
15
RU
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!!!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top