Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to get data from dnn_userprofile as a flat tableHow to get data from dnn_userprofile as a flat table
Previous
 
Next
New Post
11/11/2008 9:16 PM
 

All,

 

I am trying to get data from the dnn_userprofile table in a horizontal structure..that is, propertynames as columns.

The following is the query I am using, and I get the data I want..but the performance sux big time..I know my query is not good..but atleast I came this far.

I have around 90K users in mysite (yes..its still in development..but I wrote a script to generate so many users, as I wanted to check how much db size it will grow etc)

SELECT ROW_NUMBER() OVER (order by userid,username,firstname,DateOfBirth,gender,city) as rowid, userid, username,firstname,DateOfBirth,gender,city FROM
(SELECT dp.userid, username, propertyname,propertyvalue FROM dnn_userprofile dp
    INNER JOIN dnn_profilepropertydefinition as dpp on dp.propertydefinitionid = dpp.propertydefinitionid
    INNER JOIN dnn_users as du on dp.userid = du.userid WHERE IsSuperUser = 0
) src PIVOT (min(propertyvalue) FOR src.propertyname IN (firstname,DateOfBirth,gender,city) ) AS pvt WHERE (1 = 1)

 

Can anyone please let me know how can I improve the performance or even if you can suggest a different query then Its fine..I basically want the data returned in the following format

RowID   userid    username   firstname   DateOfBirth   Gender    City

1           123        myname    pete          10/10/10       M             New York

2           ai12        aname      mark         9/9/20          M              Las Vegas

 

THanks in advance

 

 
New Post
11/12/2008 2:26 AM
 

AFAIK there is no much faster option in SQL, you might do the transformation in your module using the transformation in VB like UserDefinedTable module does using a core method for it.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to get data from dnn_userprofile as a flat tableHow to get data from dnn_userprofile as a flat table


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out