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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Extracting email addressesExtracting email addresses
Previous
 
Next
New Post
3/18/2008 3:26 AM
 

Hi,

I know I am a bit late in replying but I really want to try and get this working.

I have used your revised script and the portal is 0 so I used it as is. When I select run as script I get the following error:

System.Data.SqlClient.SqlException: Incorrect syntax near '.'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) SELECT Email, DisplayNameFROM dbo.[Users] U INNER JOIN dbo.[UserRoles] UR ON U.UserID = UR.UserID INNER JOIN dbo.[Roles] R ON UR.RoleID = R.RoleIDWHERE (RoleName = N'Newsletter') AND (R.PortalID = 0)

Thanks

Liz

 
New Post
3/18/2008 5:39 AM
 

Hi Liz just had alook at the script leopold gave you there were a couple of spaces missing 
look carefully at the erro above notice the DisplayNameFROM that should have a space. Also R.RoleIDFROM

I've pasted here the script with the spaces included and this works on my portal.

SELECT Email, DisplayName
FROM {databaseOwner}[{objectQualifier}Users] U 
INNER JOIN {databaseOwner}[{objectQualifier}UserRoles] UR ON U.UserID = UR.UserID 
INNER JOIN {databaseOwner}[{objectQualifier}Roles] R ON UR.RoleID = R.RoleID 
WHERE (RoleName = N'Newsletter') AND (R.PortalID = 0)

 

Okay while the script works I do am missing somthing where do the values get displayed?

John


John Nicholson
 
New Post
3/18/2008 5:54 AM
 

sorry, this is a copy and past issue assumably caused by different encoding of the forums. please make sure to add a space after each line, thank you John for providing the corrected script.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/18/2008 7:42 AM
 

That is fantastic thank you. It works without errors.

However, how do I see the results? I just get the message The Query completed successfully! when I select Run as Script and nothing when I exceute without.

(DNN 4.3.7)

Thanks

Liz

 
New Post
3/19/2008 9:00 AM
 

Hi,

Any ideas on what happens to the results?

Thanks

Liz

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Extracting email addressesExtracting email addresses


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