views:

675

answers:

1

in asp.net membership is it possible to change the "userid" type from "uniqueidentifier" to "integer"? and how to do it?

+1  A: 

The asp.net membership userid data type is set to uniqueidentifier in the table schema. You probably do not want to try and change the datatype of the column because then all of the stored procedures and the sqlmembership provider would also need to be changed. But what you could do is create a lookup table that would match an integer with the specified user id unique identifier. The lookup table would have 2 columns, one for the UserId from the asp.net membership (datatype of uniqueidentifier) and then a second column of type int that would give you your integer that you are looking for.

But before you go ahead with this, you should ask why you need an integer in the first place or will a uniqueidentifier do? If you are trying to retrofit the asp.net membership provider on top of an existing database (where int is used to identify a user) then a lookup table should work well.

Jeff Widmer