Blog By Hal Hayes
Monday, December 31, 2007

There have been numerous posts on this issue, but in case you are looking for a solution I have compiled it here.

 

Problem:

You are working in the SSIS (SQL Server 2005 Integration Services) Business Intelligence Development Studio (BIDS) Control Flow. You are working on a solution that requires that you loop through a list of files. Therefore you add a Foreach Loop to the design surface (below).

 

 

You select the "Collection" attribute (left side) and find that the File Enumerator entry is missing (and so is the Item Enumerator).

 

The problem is associated with an incorrectly set permission on a registry subkey. I found mine associated with a Lexmark key. This issue can be very confusing, particularly when you are operating your SSIS and BIDS as an administrator (as you might on your development computer).  The Component Categories Manager is the application that is experiencing this issue.

 

Solution:

Warning: You will need to reboot your computer after completing these steps. Because you will be modifying the registry, you are advised to back up your registry before proceeding.

 

1. You will need a program to tell you which registry subkeys are effected. Please follow the steps in the following Microsoft knowledge base article to create this program (written in C#). Compile the program. It will run as a console application.

The title is a little misleading for our particular problem.

Microsoft KB: You receive an error message when you use Business Intelligence Development Studio to build a SQL Server 2005 Integration Services package

 

2. You must run the program as a user with a "limited account", if running under XP. Do the following steps.

 

A. Select Start|Programs|Accessories|Command Prompt

B. Change directory to the bin/debug folder of your compiled program.

C. Use the "Runas" command to run the application as a user with a limited account. Here is an example:

 

 

When you run the program as this low level user, the following window will appear with a listing of the problem subkeys:

 

D. Copy the GUID for the subkey.

E. Select Start | Run and in the Open text entry type "regedt32.exe".

F. In the registry editor, locate the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID folder. From here, search for the GUID(s) you found from running the previous program.

G. When you find the subkey, right-click on it, and select "Permissions...". Add "users" to the list for each subkey that was reported in the previous program.

H. Reboot your computer.

 

When you open your SSIS project in the BIDS, you should now be able to see and select the File Enumerator.

12/31/2007 12:03:01 PM (Eastern Standard Time, UTC-05:00) |  | SQL Server 2005 | SSIS#
Monday, December 17, 2007

Sadly, one of my favorite artists passed away on Sunday. I first heard Dan Fogelberg in college, and went to see him in concert before he really hit it big. While he hit it the top 40 with songs like "Part of the Plan", his song "Illinois" was one of my favorites after I heard him perform it. You could hear him connect back to his home roots in the song.

 

Dan had a truly marvelous way with words.

Listen to the words to Run for the Roses to understand what I mean.

Dan Fogelberg - gone but not forgotten.

12/17/2007 2:03:46 PM (Eastern Standard Time, UTC-05:00) |  | #
Wednesday, December 12, 2007

Did you ever want your DotNetNuke URLs to present a more human readable (more easily remembered) URL? Well, there is a new feature in DNN 4.7 that you can set to easily set.

Instead of your URLs showing something like www.mydotnetnukesite.com/tabid/825/EntryID/479/Default.aspx for your "About Page", to something like www.mydotnetnukesite.com/about.aspx.

You have to add the following attribute to the DNNFriendlyUrl element in the Web.config: urlFormat="HumanFriendly".

See the following blog by Chris Hammond on the DNN Team for more inforamtion.

http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryID/1637/Default.aspx

12/12/2007 10:42:22 AM (Eastern Standard Time, UTC-05:00) |  | DotNetNuke#

Microsoft reaches standardization with the W3C XQuery recommendation with the addition of the LET clause in the next release of SQL Server, SQL Server 2008.

Here is an example of using the LET clause as part of the XQuery syntax.

CREATE TABLE customerData(

       ID int IDENTITY(1,1) NOT NULL,

       customerDocs xml NOT NULL,

       updated datetime NOT NULL DEFAULT (getdate()),

 CONSTRAINT [PK_customerData] PRIMARY KEY CLUSTERED

(

       [ID] ASC

) ON [PRIMARY]

) ON [PRIMARY]

GO

 

 

INSERT INTO customerData(customerDocs)

       VALUES(N'<?xml version="1.0"?>

       <customers>

              <customer FirstName="Bob" LastName="Hayes" Zipcode="91126" status="current">

                     <order ID="12221" Date="July 1, 2006">Laptop</order>

              </customer>

              <customer FirstName="Judy" LastName="Amelia" Zipcode="23235" status="current">

                     <order ID="12221" Date="April 6, 2006">Workstation</order>

              </customer>

              <customer FirstName="Howard" LastName="Golf" Zipcode="20009" status="past due">

                     <order ID="3331122" Date="December 8, 2005">Laptop</order>

              </customer>

              <customer FirstName="Mary" LastName="Smith" Zipcode="12345" status="current">

                     <order ID="555555" Date="February 22, 2007">Server</order>

              </customer>

       </customers>')

GO

 

-- FLWOR with LET operator

SELECT customerDocs.query('

       <CustomerOrders> {

       for $i in //customer

       let $name := concat($i/@FirstName, " ", $i/@LastName)

       order by $i/@LastName

       return

              <Customer Name="{$name}">

              {

              $i/order

              }

              </Customer>

       }

       </CustomerOrders>

')

FROM customerData

 

12/12/2007 9:19:17 AM (Eastern Standard Time, UTC-05:00) |  | SQL Server 2005 | XML | XQuery#

It would be great to create a library of XQuery strings maintained in the database that developers could use and DBAs could manage. Unfortunately, you are going to have to jump through some hoops to make that happen in SQL Server 2005. The problem originates from the fact that the XML datatype "query" method can only take a literal string value.

 

This also causes problems if you want to use dynamic queries. You can create a SQL statement involving a dynamic query, but what you have to do is piece together the entire query as a string that is called in the dynamic SQL stored procedure "sp_executesql". But, you cannot pass the XQuery as a variable in dynamic queries either.

 

Below are some examples of what works and what does not.

 

The first example shows a typical XQuery call, then one that will not work that uses a variable passed to the query method.

 

-- This works!

DECLARE @myResult xml;

 

SELECT @myResult = Study.query(

 '

  <Root> {

  for $f in //Form

  where $f/@Status eq "COMPLETE"

  return

       <Forms> {

              $f

              }

       </Forms>

} </Root>

 '

)

FROM JustXML

WHERE ID = 1;

 

SELECT @myResult;

GO

 

-- This does not (PASSING VARIABLE INSTEAD OF STRING LITERAL)

 

DECLARE @myResult xml;

DECLARE @myXquery nvarchar(500);

 

SET @myXquery =  '

  <Root> {

  for $f in //Form

  where $f/@Status eq "COMPLETE"

  return

       <Forms> {

              $f

              }

       </Forms>

} </Root>

 ';

 

 

SELECT @myResult = Study.query(@myXquery)

FROM JustXML

WHERE ID = 1;

 

SELECT @myResult;

GO

 

 

Here are two examples, one that works and one that does not, using dynamic SQL queries.

 

-- Using Dynamic Queries with XQuery

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

-- THIS WORKS (dynamic sql)

DECLARE @myXquery nvarchar(255);

 

SET @myXquery =  N'

  <Root> {

  for $f in //Form

  where $f/@Status eq "COMPLETE"

  return

       <Forms> {

              $f

              }

       </Forms>

} </Root>

 '

DECLARE @myDynamicSql nvarchar(500);

 

SET @myDynamicSql = N'SELECT Study.query(''' + @myXquery +

       ''')  AS MYRESULT

FROM JustXML

WHERE ID = 1'

 

EXECUTE sp_executesql  @myDynamicSql;

 

-- But this does not!!!

DECLARE @myXquery nvarchar(255);

 

SET @myXquery =  N'

  <Root> {

  for $f in //Form

  where $f/@Status eq "COMPLETE"

  return

       <Forms> {

              $f

              }

       </Forms>

} </Root>

 '

DECLARE @myDynamicSql nvarchar(500);

DECLARE @ParmDefinition NVARCHAR(500);

 

 

SET @myDynamicSql =

N'SELECT Study.query(@thisXquery)  AS MYRESULT

FROM JustXML

WHERE ID = 1'

SET @ParmDefinition = N'@thisXquery nvarchar(255)';

 

 

EXECUTE sp_executesql  @myDynamicSql, @ParmDefinition,

                       @thisXquery = @myXquery;

 

12/12/2007 9:00:05 AM (Eastern Standard Time, UTC-05:00) |  | SQL Server 2005 | XML | XQuery#
Sunday, December 09, 2007

Scott Schecter comes to my rescue. We are working on a DNN site that needed the radio buttons turned off. Here is his link discussing how to turn off the search radio buttons for DotNetNuke 4.5.2 (and above).

It is a setting in the .ascx skin file. Add the two attributes in red as shown below for the dnn:SEARCH element.

<dnn:SEARCH runat="server" id="dnnSEARCH" showWeb="False" showSite="False" />

 

12/9/2007 11:51:57 AM (Eastern Standard Time, UTC-05:00) |  | DotNetNuke#
Search
Archive
Links
Categories
Admin Login
Sign In
Blogroll
 CTO 2.0
Antonio Chagoury
Dot NET Ramblings
Brian Noyes
 New Entry
 SharePoint Resources
Lamont Harrington
 Winsmarts
Sahil Malik
Themes
Pick a theme: