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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListSQL QuerySQL Query
Previous
 
Next
New Post
3/28/2006 10:41 PM
 

Is it possible someone could post an example of a SQL query to pull data from a UDT?   TIA

 
New Post
3/29/2006 2:36 AM
 

Do you mean one SQL Query to catch the data like you are used to work with common tables? In our module we catch a long field list and build the rows inside the code.

But if you know your table it will be possible. Let's define us a UserDefinedTable having field like "Column1"  and "Column2" 

SELECT    
dbo.UserDefinedRows.UserDefinedRowId, Data1.FieldValue AS Column1, Data2.FieldValue AS Column2
FROM        
dbo.UserDefinedData AS Data1
INNER JOIN
dbo.UserDefinedFields AS Fields1 ON Data1.UserDefinedFieldId = Fields1.UserDefinedFieldId
INNER JOIN
dbo.UserDefinedRows ON Data1.UserDefinedRowId = dbo.UserDefinedRows.UserDefinedRowId
INNER JOIN
dbo.UserDefinedData AS Data2 ON dbo.UserDefinedRows.UserDefinedRowId = Data2.UserDefinedRowId
INNER JOIN
dbo.UserDefinedFields AS Fields ON Data2.UserDefinedFieldId = Fields.UserDefinedFieldId
WHERE
    (Fields1.FieldTitle = 'Column1')
AND (Fields.FieldTitle = 'Column2')
AND (dbo.UserDefinedRows.ModuleId = MODULEID)

 
New Post
3/29/2006 2:46 AM
 

This query works only against fields <>NULL. If one field in a row is null, the whole row will disappear in the query.

 
New Post
3/29/2006 3:50 AM
 
SQL Server 2005 has a PIVOT option, that simplifies retrieving UDT data significantly.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
8/29/2006 6:21 PM
 
Could you (or some other clever person) post an example with the PIVOT option. I want to graph some of the UDT data and need the SQL to specify the datasource for it. Any help would be much appreciated!
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListSQL QuerySQL Query


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