Friday, June 29, 2007

Extract columns from microsoft SqlProfileProvider

If you want to select data from the asp.net membership api database but you are having problems because the PropertyValuesString / PropertyNames / PropertyValuesBinary values are all delimited / separated by a colon but you want to but cant use a split function on it. Below is a solution. There are also UserId LastUpdatedDate columns.

Step 1. Execute the sql from HERE to create some functions to extract your data.
Step 2. Create a view like the example below
Step 3. (optional) index your view.

create my_cusomers_vw view as
SELECT
dbo.fn_GetProfileElement('Phone',PropertyNames,PropertyValuesString) AS Company,
dbo.fn_GetProfileElement('ZipCode',PropertyNames,PropertyValuesString) AS ZipCode,
dbo.fn_GetProfileElement('State',PropertyNames,PropertyValuesString) AS State
FROM dbo.aspnet_Profile
GO


select * from my_customers_vw

--------------------------------------------

fn_GetElement fn_GetProfileElement FUNCTION

3 Comments:

At 9:07 AM, Blogger senfo said...

Cool stuff. You should change the subject of the post to indicate that it's for the SqlProfileProvider, which is actually separate from the membership provider.

 
At 9:14 PM, Blogger James Taylor said...

I believe the line

create my_cusomers_vw view as

should be

create view my_cusomers_vw as

 
At 5:17 AM, Blogger hou said...

If you want to select data from the asp.net membership api database but you are having problems because the PropertyValuesString.
xiaomi mi5 review
meizu m2 note
meizu mx5

 

Post a Comment

<< Home