Friday, February 24, 2012

Aspnet_Profile data extraction

Hello,

in the new aspnet 2, there is a table called Aspnet_Profile wich contains user informations.

Look at the way they are filled

c9d365eb-6981-4c12-bfb8-e9b17445b26d Name:S:0:11:phone:S:11:9: William DOE567876567 <Binary data> 05/10/2005 12:27 35207ce2-8368-4914-95d7-2e0f51414d9c Name:S:0:8:phone:S:8:9: John DOE567876567 <Binary data> 05/10/2005 12:27


The first column is the UniqueIdentifier of user
The second is PropertyNames which contains the structure of the informations. For example here for the first line :
Name is a string wich begins at 0 and is 11 long
Phone is a string wich begins at 11 and is 9 long

The third column contains the informations

then you have here :
Row 1 :
Name : William DOE
Phone: 567876567

Row 2 : John DOE
Phone: 567876567

my problem is to be able to access those informations with a stored procedure.

Can Anyone help me ? thanks a lotYou can write a write a TSQL table-valued UDF that can split the formatted property names and get the lengths. You can then use the offset/lengths with SUBSTRING to get the actual values. The final casting can be done based on the type. But why are you trying to access this information in a SP? What happens if the next service pack or hotfix for .NET changes some of these formats? Maybe if you post what you are trying to do in the .NET newsgroup they will be able to suggest other ways to get the information that you need.

No comments:

Post a Comment