Jane's Technical Stuff

Tuesday, August 29, 2006

SSIS and DTExec Red Herring


When initially deploying my SSIS package to my pre-production environment I got a bit hooked up on the following warning message which was appearing despite calling my package via DTExec with /conf = C:\Configuration.dtsConfig


Warning: 2006-08-21 10:58:19.96
  Code: 0x80012014
  Source: export process
  Description: The configuration file "D:\Configuration.dtsConfig" cannot be found. Check the directory and file name.
End Warning
Warning: 2006-08-21 10:58:19.96
  Code: 0x80012059
  Source: export process
  Description: Failed to load at least one of the configuration entries for the package. Check configurations entries and previous warnings to see descriptions of which configuration failed.
End Warning


I managed to reproduce this on my development machine by renaming D:\Configuration.dtsConfig to .dtsConfigx and running the package. It seems that SSIS checks for the configuration in the location it was originally created before processing the /conf override. Once I'd sorted this out I could concentrate on the real errors :-)

Labels: ,

// posted by Jane @ 2:22 PM   save to del.icio.us

Comments:

Tuesday, August 22, 2006

Online spreadsheets


Via larkware, a good comparison article on 5 of the online spreadsheet offerings (warning: this article doesn't seem to work in Safari). Of the 5, I have to confess that I've only had chance to play with Google spreadsheets so far, but as a consequence of the article I've just signed up to iRows as well. I'll have to take a look and see which works best on Safari or Firefox.

Labels:

// posted by Jane @ 9:37 PM   save to del.icio.us

Comments:
Thanks for posting this Jane, it's very useful. We're trying out iRows and Google at the moment.

Best,

Nick W
 
Hi Jane,

Nice to know that my comparison sheet was useful to you.

BTW you have mentioned that my article was not displaying properly in Safari. Can you give me more details about it since I don’t have access to a MAC here in India.

Cheers,
Sudar
 
Hi Sudar

The article now loads properly under safari. Hurrah!

Thanks
Jane
 
This post has been removed by a blog administrator.
 

SSIS, SP1 and Testing


Having installed my package onto the pre-production environment, and ironed out a heap of database permissions problems, I found myself contemplating the following error...

Error: 2006-08-22 13:56:32.93
  Code: 0xC002F210
  Source: Get Data
  Description: Executing the query "EXEC PRC_DATA_SEL ?" failed with the following error: "End tag 'Description' does not match the start tag 'ROOT'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
End Error


When I connect to the pre-production database via my dev package having changed the configuration file, it functions as expected without a problem. So it isn't a database problem. When I change the pre-production configuration to point at my dev database, I get problems - so it looks like a machine related problem.

I then put Integration Services on to another test machine, and tried from there, and had success. So there was obviously something different about our pre-production box to both my dev environment and my newly borrowed test kit. The OS's were different, so I then spent a frantic 5 minutes checking that Integration Services should run on Windows 2000 Server SP4 - which it should.

Finally, I decided to install SP1 on my test (previously working) machine, and that too stopped working - not with exactly the same error but at this stage that was good enough. So, I've rolled back the pre-production environment to be pre-SP1 and now the package runs.

Not a great solution, but it'll do for the moment. Next step - upgrade my dev environment to be SP1 and re-work as necessary. And the moral of this story is always ensure your dev environment matches your pre-production and live. I'm glad I found out before the live stage though :-)

Labels: ,

// posted by Jane @ 6:04 PM   save to del.icio.us

Comments:

Monday, August 21, 2006

Google Maps - Travel


We've had a travel page over at JaneandRichard for many years now, and I've been trying to come up with a more visual, map based display for some time. Enter Google Maps and the incredibly easy API, something I've been meaning to take a look into for a while.

Armed with little more than the Google Maps API Reference I set about using their sample code to make a travel map. I wrote a few functions in javascript, which Richard later got some of the travel reports based on our photo album software to call, and we were were off. All we needed now was the Longitude and Latitude of all the places we've been to. *sigh*. After lots of google searches for obscure and less obscure places (Playa del Cura, Gran Canaria being one) I discovered that the BBC Weather page displays the longitude and latitude for a lot of places. Perfect.

So, I've got clickable markers (I'm in the market for a pin image), which when clicked open information bubbles displaying the name of the place and the date at the very least. For those places were travel reports exist there are links, and there are pictures where possible. We've started the map off as zoomed out as we can get. This does mean, however, that if you click on one of the top markers - like Iceland - the map scrolls down and we're left with a grey border. I've checked the main Google Maps and theirs does it too - so I guess its by design. Were we moved around on our trips, if there are separate reports for different places then they're marked multiple times, otherwise we've picked the most "typical" place, or the place we stayed the longest.

Labels:

// posted by Jane @ 9:57 PM   save to del.icio.us

Comments:

Friday, August 18, 2006

SSIS Course and Book


I'm going to be attending Wise Ltd's Advanced SQL Server Integration Services training course in September. Now admittedly by that point the current project will be live (fingers crossed), but hopefully I'll have a lot more knowledge for the design of the next one, rather than the trial and error approach that I've used this time.

Also our copy of Microsoft SQL Server 2005 Integration Services arrived today. I've only had a quick flick through so far but it looks far better than the other one. Nice work Kirk.

Labels: ,

// posted by Jane @ 8:05 PM   save to del.icio.us

Comments:

Altova MapForce 2005


I've recently had the opportunity to use MapForce to transform one XML document into another. The drag-and-drop nature of it has worked well, and it saved me brushing up on my extremely rusty XSLT too much. However, I needed to put some output into CDATA tags. This had me scratching my head somewhat, and I've ended up resorting to updating the output XSLT to have a cdata-section-elements section in the xsl:output tag. I haven't found a solution within MapForce as yet, and I've found the support on the internet to be a bit sparse, but I'm hoping to get a solution when a colleague who has used this a bit more returns from holiday next week.

Any MapForce experts happen to be passing by?

Labels:

// posted by Jane @ 4:22 PM   save to del.icio.us

Comments:
I sure could use an answer to this problem right now. Anybody (including Jane) come up with anything? ..brian@eswc.com
 
Hi Brian

Sorry, still no solution :-(

Jane
 
any answers to this jane?
 
Hi Cornerstone

Nope, afraid not. But if you find out, do let me know

Thanks
Jane
 

Wednesday, August 16, 2006

d.Construct 2006 podcast


d.Construct 2006 is a mere few weeks away now, and although I'm not going to be attending, I have subscribed to the podcast.  I'm finding it really good - reasonably short programmes with web related content, focussed a lot on Brighton people and businesses.  It's proving to be a great way to find out about what is going on in local web companies, and Jeremy is a natural presenter.

Labels:

// posted by Jane @ 7:43 PM   save to del.icio.us

Comments:

MSDE won't be supported on Vista


Microsoft says In an effort to provide customers with more secure products, Microsoft Windows Server "Longhorn" and Microsoft Windows Vista will only support the follow on release to SQL Server 2005 Service Pack 1 (SP1) or later. Earlier versions of SQL Server, including SQL Server 2000 (all editions including Desktop Engine edition, a.k.a MSDE), SQL Server 7.0, and SQL Server 6.5, will not be supported on Windows Server "Longhorn" or Windows Vista.

via SSWUG's newsletter

Labels:

// posted by Jane @ 3:01 PM   save to del.icio.us

Comments:
I'm not sure, but it sounds like they're saying that SQL 2000 isn't secure...
 

Monday, August 14, 2006

SSIS Foreach Nodelist enumerators Part 2


My euphoria at getting my SSIS Foreach Nodelist enumerators working was short lived. I had some really strange behaviour going on with my foreach nodelist. It appeared that the XML being interpreted by the node wasn't the XML being passed in. I am using the method described in the DrivenBySQL example, using a node and putting the node contents into an object variable objNode. This objNode is then broken into its composite elements in some script (as described the other day). Those composite elements are then processed. What was happening was that the processing was doing the data for this iteration, but also every other iteration. I wanted to prove that this was really happening, and I wasn't just having a funny five minutes. So I started a new project and created some standard Direct Input XML, one for images and one for some random data.

Images XML - outer loop

<images>
  <image>
    <source>8162_5260.JPG</source>
    <destination>87775588_01.JPG</destination>
  </image>
  <image>
    <source>8162_5260_01.JPG</source>
    <destination>87775588_02.JPG</destination>
  </image>
</images>


Data XML - Inner loop

<ROOT>
  <Item>
    <Data>Entry</Data>
  </Item>
</ROOT>


I've used a string variable to put comments of what is going on in. So, it puts a started tag and a date time stamp in.
I loop through the image nodes in the outer loop - which should result in two iterations.
Within the outer loop
  I add a log entry to the string with the Source entity data in.
  I then loop through the Item nodes in the inner loop - which should result in one iteration.
  Within the inner loop
    I add a log entry with the datetime stamp and the Data entity.
  Inner loop ends
Outer loop ends

Expected Output

Started at 11/08/2006 12:05:11
Image 8162_5260.JPG
For each logged at 11/08/2006 12:05:11 with data of Entry
Image 8162_5260_01.JPG
For each logged at 11/08/2006 12:05:12 with data of Entry
Completed at 11/08/2006 12:05:12

so with 1 For each line per iteration, but what I actually get is:

Output

Started at 11/08/2006 12:05:11
Image 8162_5260.JPG
For each logged at 11/08/2006 12:05:11 with data of Entry
Image 8162_5260_01.JPG
For each logged at 11/08/2006 12:05:11 with data of Entry
For each logged at 11/08/2006 12:05:12 with data of Entry
Completed at 11/08/2006 12:05:12

which implies that the data being returned in the inner foreach contains data from both the 1st and 2nd iterations, which is what I was seeing in my problematic project.

I then changed the images XML to add a third image, and ran the test and got the following output:

Output

Started at 11/08/2006 12:36:21
Image 8162_5260.JPG
For each logged at 11/08/2006 12:36:21 with data of Entry
Image 8162_5260_01.JPG
For each logged at 11/08/2006 12:36:21 with data of Entry
For each logged at 11/08/2006 12:36:21 with data of Entry
Image 100_1000.JPG
For each logged at 11/08/2006 12:36:22 with data of Entry
For each logged at 11/08/2006 12:36:22 with data of Entry
For each logged at 11/08/2006 12:36:22 with data of Entry
Completed at 11/08/2006 12:36:22

again implying that the data in the inner foreach contains both the current iteration, and any previous iterations.

I took a search on the MSDN SQL Server Integration Services and found Nested Loops in the Control Flow to be the closest to my issue. Having to create a child package sounds like a workaround rather than a solution to me but I figured it was worth a try and created a child package which just has the inner for each loop in it, and got the following output:

Output

Started at 14/08/2006 15:38:47
Image 8162_5260.JPG
For each logged at 14/08/2006 15:38:48 with data of Entry
Image 8162_5260_01.JPG
For each logged at 14/08/2006 15:38:49 with data of Entry
Completed at 14/08/2006 15:38:49

So, finally it works as expected. Now to go and integrate it into the main project rather than just this test one.

Labels: ,

// posted by Jane @ 3:47 PM   save to del.icio.us

Comments:

SQL Server Integration Services


I've been doing some work with Integration Services in the past few weeks. Some resources have proved to be a bit too much like hard work, others have been more useful.

MSDN has a series of tutorials

Blogs:
There are some good blogs kicking around - these are the ones that I've had a few hints and tips from and that have been added to my RSS aggregator:
Forums:
Webcasts:

Books:

Update: After signing up for one of the webcasts the other day, a useful email came through pointing me at MSDN Integration Services which has an impressive set of links.
Futher Update: Thanks to Linda for pointing out via Daniel Read's index that there is an index to the SSIS articles on Database Journal.

Labels: ,

// posted by Jane @ 11:09 AM   SQL Server Integration Services'), 'delicious','toolbar=no,width=700,height=400'); return false;">save to del.icio.us

Comments:
Another useful looking site SQLIS.com - SQL Server Integration Services
 

Thursday, August 10, 2006

TSQL - Getting the value from a stored procedure into a variable


Simon popped over earlier to ask if I knew a way to capture the data within a SELECT returned as part of a stored procedure within TSQL. So, the item he was after wasn't an output variable, neither was it the return value. I remembered roughly how to do it, and then hunted through some of our TSQLUnit tests to find an example to send to him. I'd used temporary tables to do it. I wondered why I'd use that instead of a table variable, so I thought I'd write a bit of code to find out. The reason was that we got the error "EXECUTE cannot be used as a source when inserting into a table variable."

CREATE TABLE MyTest
(Test1 VARCHAR(20))

INSERT INTO MyTest
 (Test1)
VALUES
 ('Hello')

CREATE PROCEDURE GetTest
AS
BEGIN
  SELECT Test1
  FROM MyTest
END

DECLARE @tabCaptureTheResults TABLE (Data VARCHAR(20))

INSERT @tabCaptureTheResults
EXEC GetTest


This results in:
Server: Msg 197, Level 15, State 1, Line 4
EXECUTE cannot be used as a source when inserting into a table variable.


CREATE TABLE #CaptureTheResults (Data VARCHAR(20))

INSERT #CaptureTheResults
EXEC GetTest

SELECT * FROM #CaptureTheResults


This results in 'Hello' being returned, exactly as required.
Whilst this works, it isn't exactly going to be efficient. Anyone know of any better ways of doing this within TSQL?

UPDATE:
As of SQL 2005 both cases seem to work - Hurrah!

Labels: ,

// posted by Jane @ 12:36 PM   save to del.icio.us

Comments:

Wednesday, August 09, 2006

SSIS Foreach Nodelist enumerators


I have some simple XML to parse within my SSIS package


<images>
  <image>
    <source>8162_5260.JPG</source>
    <destination>87775588_01.JPG</destination>
  </image>
  <image>
    <source>8162_5260_01.JPG</source>
    <destination>87775588_02.JPG</destination>
  </image>
</images>



and I want to take an image and copy the physical image referred to by source to destination. I knew I needed to use the foreach Nodelist enumerator, but I didn't really know where to start as the book I have on my desk doesn't seem to cover it at all.

Attempt One

I found a useful article SSIS Debugging foreach NodeList enumerators which was a start, but didn't seem to get me where I wanted to be as with XPath settings of

Enumeration type: NodeText
OuterXPathString: /

mapping to a string variable named variable (original heh, but this was a proof on cencept) with index 0 I got data in the variable of 8162_5260.JPG87775588_01.JPG8162_5260_01.JPG87775588_02.JPG. Right data, but not in a useable format.

With the XPath settings of

Enumeration type: ElementCollection
OuterXPathString: /images
InnerElementType: NodeText
InnerXPathString: *

my variable has the data 8162_5260.JPG87775588_01.JPG in it on the first, and worryingly only, iteration.

Attempt Two

Obviously doing something wrong, so I hit google again, and this time found a DrivenBySQL example, which has pictures and everything (and it contains a link to Visual XPath, which was a useful tool for validating my XPath statement).

So, I changed the XPath settings to be

OuterXPathString: /images/image
InnerElementType: Node
InnerXPathString: .

capturing the output in a variable of type Object

I then wrote some script to get the data from my XmlNode into 2 string variables, this script was heavily based upon the sample code from the DrivenBySQL example but with the follwing definitions for string and destination based on the appropriate entites, rather than the attributes in the example


strSource = objNode.SelectSingleNode("source").InnerText.ToString
strDest = objNode.SelectSingleNode("destination").InnerText.ToString


All now seems to be working. Hurrah!

Labels: ,

// posted by Jane @ 12:40 PM   save to del.icio.us

Comments:
I've been using an online one for a while, but Visual XPath looks rather nifty.
 

Tuesday, August 08, 2006

Google Maps


One of my team is investigating Google Maps and how we can integrate it into some of our applications. Whilst investigating, she stumbled across Goggles a flight simulator built on the Google Maps API.

Labels:

// posted by Jane @ 1:19 PM   save to del.icio.us

Comments:

Monday, August 07, 2006

SSIS and Microsoft Connect


Jamie Thomson has an article about Improving the debugging in Katmai (the new SQL Server version) by making requests via Microsoft Connect.

I hadn't heard of Microsoft Connect before, but it seems like a great idea:
By submitting feedback, you can actively work with members of the Microsoft product team to identify and evaluate the importance of issues, recommend workarounds, and help ensure that the product is reliable and meets customer needs. Your feedback can take the form of a suggestion for improving product design or behavior, or a description of a problem that interferes with your work or causes the product to behave unexpectedly.

You can submit feedback, or vote and add comments to existing requests. I've voted on a couple of SSIS issues (as mentioned in Jamie's blog), Use breakpoints in script components and Use breakpoints in script tasks that are in an eventhandler as these both caused me problems last week.

Labels: ,

// posted by Jane @ 2:45 PM   save to del.icio.us

Comments:

Saturday, August 05, 2006

Mac software purchases I


Over the past month or so since getting a MacBook, I've bought a couple of pieces of software.

The first was MoneyDance, a money management tool. I've been a user of Quicken for over 10 years and so moving on was quite a wrench, but Moneydance so far has proved to be excellent, and despite there being a Quicken Mac version, Quicken no longer support the UK. Very easy to use, similar enough to Quicken to make the transition relatively straightforward. My history remains in Quicken due to a perculiarity in the way that QIF files work - when you attempt to input transactions, they seem to get double counted when they are transfers between accounts. MoneyDance comes with a really decent trial (restricting to 100 or so transactions) meaning that you can get a good feel for the tool before having to buy it.

The second was Transmit a FTP transfer tool. I tried Cyberduck briefly but it kept crashng on me when I tried to copy multiple files over. My main use for an FTP transfer tool is to upload photos, and so being able to handle lots of files is really important to me. As with Moneydance the trial period is long enough to get a feel for the reliability of the product.

Labels:

// posted by Jane @ 4:00 PM   save to del.icio.us

Comments:

Thursday, August 03, 2006

SSIS and .NET Assemblies


The internet is a great place, there I was scratching my head trying to work out how to get my .NET assembly to appear in the references section of an Integration Services Script Task when I stumbled across Daniel Read's helpful Fun With SSIS, Script Tasks, and the GAC (Global Assembly Cache). In a nutshell, and I'm sure Daniel puts it much better than I can, to get an assembly to appear in the Add references dialog you have to both register your dll into the GAC AND copy the file into the appropriate framework directory - yeuch!

From the Professional SQL Server 2005 Integration Services book SSIS can only use assemblies located in the .NET framework installation folder for version 2.0

So far this is the only yeuch moment I've had with SSIS

Labels: ,

// posted by Jane @ 12:58 PM   save to del.icio.us

Comments:

Wednesday, August 02, 2006

TSQL: LEN vs DATALENGTH


I encountered a TSQL issue this morning that I knew looked familiar. When doing SELECT LEN(@strName) it was returning less characters than I expected. So, when doing SELECT LEN(' ') I got a result of 0 instead of 1, when I did SELECT LEN('Jane ') I got 4 rather than 5. I'd forgotten about the fact that it trims off white space before returning data. Thanks to Adam Machanic I refound DATALENGTH which does what I'd expect.

LEN defined in SQL Server Books online as Returns the number of characters, rather than the number of bytes, of the given string expression, excluding trailing blanks.

DATALENGTH defined as Returns the number of bytes used to represent any expression. DATALENGTH is especially useful with varchar, varbinary, text, image, nvarchar, and ntext data types because these data types can store variable-length data. The DATALENGTH of NULL is NULL.

Labels: , ,

// posted by Jane @ 3:04 PM   save to del.icio.us

Comments:

Brighton Bloggers   This page is powered by Blogger. Isn't yours?   rss Sussex Digital - focusing on the Sussex digital community