How To Insert Unique Composite ID For Hierarchical Table (SQL Server) -
I have this table structured as follows:
PK ParentPK ID1 tap For the above table, I already have a function that can produce the following result: > PK FullID3 ABC5ADE
This function takes the rows of children who do not have children and for every line their parents are completely full-moon Generate.
Enter a string of full-width users to my application, such as "BEF", "ABD", and press Save button and its application fee for a suitable hierarchy structure (which consists of several rows) Parsed internally and put them in the table.
The question is, how can the application guarantee the fullness of Purni? I need to be able to reject the duplicate fullsigned by users.
I understand that I can check the fullness before using my function, if it is not present, then I can get involved. But if these steps are done in non-nuclear operations, then I can be used to access a heavy traffic in the duplicate full ID.
Should I wrap it in a stored procedure? Using Start / Commit Transaction Block? Or is there a better way to do this? Thanks a lot.
So you're looking for something like this
BEGIN TRAN If not present (choose one .pk from GetPullID (a.PK)) - Start operation - End TRAN
Comments
Post a Comment