On Thursday, December 19, 2019 at 2:37:29 PM UTC-8, Davidiam wrote:
>
> As part of our release process, we need to insert records in the auth 
> tables using specific id's.  On sqlite this is no problem, but in mssql we 
> get an error saying insert_identity is off.
> The solution is to set insert_identity ON, but I am not sure how to do 
> this using the web2py DAL.  Can any give me an code example for this?
> We are basically inserting user and group records using ids from a master 
> table.
>
> This is the command that I would need to run before doing the inserts :
>
> SET IDENTITY_INSERT dbo.auth_user ON;   
>
> Thanks, 
> David 
>



I can't, because I'm using a different DB, but I remember thinking at the 
time of your earlier post about IDs that ... this is wrong.  I think your 
process should be using *roles*, not *ID*s, and this is what the auth_group 
table is for.  Perhaps if I understood your process, I would agree that 
relying on specific IDs is the right answer, but it is going to take some 
effort to convince me.

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/709105be-e47f-487f-a486-5865fe0e37b2%40googlegroups.com.

Reply via email to