Skip to content

How to handle UUID in SQLModel for MSSQL ? (Conversion failed) #878

Discussion options

You must be logged in to vote

Actually the workaround solution is working for updating and creating new rows in DB-table.
@joachimhuet thanks for support!

class Customer_RoleBase(SQLModel):
    roles_id: Optional[str] = Field(primary_key=True, index=True, default=None, sa_column_kwargs={"server_default": "(CONVERT([varchar](100),newid()))"}, max_length=100)
    ...

Replies: 3 comments 16 replies

Comment options

You must be logged in to vote
9 replies
@joachimhuet
Comment options

@Ringostar1982
Comment options

@joachimhuet
Comment options

@Ringostar1982
Comment options

@joachimhuet
Comment options

Comment options

You must be logged in to vote
7 replies
@Ringostar1982
Comment options

@joachimhuet
Comment options

@Ringostar1982
Comment options

@Ringostar1982
Comment options

Answer selected by Ringostar1982
@urosjarc
Comment options

@redb0
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
5 participants