If you get an error at the running of the Flat File Source SSIS dataflow item
"Task Load {your flat_file} failed" while running a SSIS package (that loads data from a flat file) it might be that you have the flat file opened in Excel. Just for curiosity I tried opening the file in CSVed and it looks like CSVed doesn't keep it locked, the task runs succesfully.
Hope this is saving you some hair pulling.
Friday, April 4, 2014
SSIS fails
Posted by
Radu
at
10:40 AM
0
comments
Thursday, March 27, 2014
Maps in SSRS 2008
Yesterday I was getting an error while trying to run a report that contains a map, saying something like this: [...]maps binding or grouping for layer is not valid[...]. I don't remember exactly the entire error message, but I can reproduce it if one is interested.
This was a little tricky because I started to look at the map layer properties, trying to understand what I did wrong in the RDL. Just to find out that the DataSource was returning more than one row per country, so the poor RS didn't know which row to map.
Posted by
Radu
at
3:18 AM
0
comments
Tuesday, February 11, 2014
Think Like a Programmer by V. Anton Spraul, O'Reilly Media
I got this book as part of O'Reilly blogger progam. As a software developer with 14 years of experience myself, I was curious to see what Anton Spraul's book can teach.
You'll not find there the usual pages with code and algorithms that you'll find in many computer programming books. The code you'll find in C++ and is used mostly for exemplification. Is not a book about code, but one about problem solving. Ideas learned can be applied in many other areas of our life.
The book starts with basic logic problems (classic puzzles), the solution to them and the way of thinking that can lead to a solution. Here we learn about being aware of ALL possible actions you could take, creating strategies and simplifying the problem, looking for the most constrained part of the problem, recognizing patterns and analogies. Just as a side note, I'm member of a chess site, where paying members get to try a huge number of tactical problems and this helps a lot in recognizing patterns in the real game. Programming is similar: recognizing patterns and reducing complex problems to known ones.
Then the book goes through specific type of problems in programming, like problems with arrays, pointers and dynamic memory, classes, recursion.
On very interesting chapter is the one about code reusing. It is teaching when is good and when is bad to reuse code, it helps identifying the components and building a "component toolkit" or component knowledge. It makes use of the knowledge acquired in the previous chapters and interestingly teaches which components to use for a specific problem, based on the amount of work, flexibility and maintainability. It not only presents the way to get to a solution, but also comparing two possible solutions to the same problem and choosing the best one.
In all the chapters I didn't type in and compile the code, since I was not interested in coding but in finding patterns of thinking and ways to improve.
The last chapter puts it all together, teaches how to create a development plan by eliminating weaknesses (both coding and design ones) and using the strengths. Also learning a new programming skill is approached systematically and this is approach interesting also for seasoned programmers.
I'll conclude with a quote from the book: "Once you are thinking like a programmer, be proud of your skills. If someone calls you a coder rather than a programmer, say that a well-trained bird could be taught to peck out code—you don’t just write code, you use code to solve problems."
You can find more details about the book and the table of contents on O'Reilly catalog page.
Posted by
Radu
at
6:28 AM
0
comments
Labels: book
Friday, April 19, 2013
Sargable
I didn't know this world. It comes from Search ARGument ABLE (according to wikipedia) and it means (in databases world) a condition that enables the use of indexes
Posted by
Radu
at
1:48 AM
0
comments
Labels: SQL Server
Wednesday, October 31, 2012
null is not nothing
Let's assume we have a table @a Do you think
where a = a
is the same as writing
?
Well, think at it for a second before reading furher. Now run this code
declare @A as table (a varchar(5))
insert into @A values ('a1')
insert into @A values ('a2')
insert into @A values ('a3')
insert into @A values (null)
select * from @a where a = ISNULL(@p, a)
Why ? hmm, there is a nice discussion about DB NULL values here. And in many many other places on the web
Posted by
Radu
at
8:53 AM
0
comments
Labels: SQL Server
Monday, August 13, 2012
Buying the Right Photo Equipment, by Elin Rantakrans, O'Reilly Media
In this 128 pages book, Elin Rantakrans aims to help newbies photographers find the right gadgets to fit their shooting style.
The photo equipment is divided into few major chapters: lenses, filters, tripods, flash, protecting gear, other accessories and computer software.
Browsing through the wide variety of photo equipment, each gear type is presented with the purpose and the photography style that it is better suited for. I like the concise presentation, the pictures to exemplify each usage of the gear and the tips for each photography. However, I'd have definitively preferred to see the settings of each pictures and maybe a short story of why the photographer decided for that lens/gear.
If you are a beginner, the book is a definite must read. Is a very easy lecture that would surely get your photos to a next level. I consider myself an intermediate photographer and I think I had quite a lot to read from. I'm sure the part about flash and the ones about software can give many photographers new ideas.
The book doesn't go into details of specific equipment brands and models, but that would make the book become obsolete very soon after being published. After all, there are plenty of review websites for photography gear, so after one decides what type of equipment he/she needs the search for the right model is a matter of time spent into deciding what's best for your camera + budget + style. Of course, be warned that if you are serious about photography your camera&accessories bag will soon become pretty heavy.
The book is a very useful and very easy reading. I'll definitely recommended it to my friends having photography as their hobby.
Posted by
Radu
at
9:34 AM
0
comments
Thursday, February 2, 2012
Fast Query but Slow Stored Procedure
Few days ago we had a problem that I encountered years ago while working in Italy.
Basically a Stored Procedure is very slow. So slow that we didn't wait for it to finish, it probably more than 30 minutes. Let's not forget to mention that I'm running it on SQLServer 2008.
That query taken outside the stored procedure an run with the same parameters in SQLServer Management Studio runs in only few seconds. Since back in Milan I saw the same behaviour (on SQLServer 2005 that time) I thought I have the answer and can impress the colleagues with a fast solution: using WITH RECOMPILE clause.
However, the result was the same...very slow stored procedure.
After searching the Internet we found the answer here. Parameters sniffing. Explained here as "the process of using the parameter value to estimate selectivity and cardinality".
Indeed, our query is pretty complex and it looks like SQLServer did not know to re-create the execution plan. After changing the parameters' names, everything was OK.
Posted by
Radu
at
2:18 AM
0
comments
Labels: recompile, SQL Server
Wednesday, November 16, 2011
Maps in SSRS 2008 R2
"Map1 was detected in the report. SQL Server 2008 Reporting Services does not support map report items"
Posted by
Radu
at
6:30 AM
0
comments
Monday, October 24, 2011
Nature and Landscape Photography, by Martin Borg, O'Reilly Media
This post is not at all about a problem in SQLServer or compiling issues but a book review. Why ? Because is all about enjoyment.
In “Nature and Landscape Photography” Martin Borg is presenting a very nice collection of tips for better photography in the outdoors.
Out of many photography books, I was attracted by this one because is written by a Swedish photographer. As nature photography is one of my hobbies, and considering I leave in Stockholm, I was expecting subjects, magical hours and type of landscape to be similar to what I encounter here around Stockholm, and I was not disappointed. This is an easy lecture of 71 short tips from Martin Borg, illustrated with his own pictures. A nice feature is the editor’s insertion of details about each photography. A beginner to intermediate amateur can really benefit from this tips. Many of them are indeed not new, but some are very interesting.
I would’ve probably preferred to have more technical details and more of compositional hints, as well as a little bit of the way the photographer reached to that composition or developed the idea that led to the image. But this is not a manual of photography, is just a collection of tips.
With this book Martin Borg manages to make you wish to go out in the nature and practice the tips (which I did, taking advantage of the nice autumn weather that we had during the first week-end after reading the book). Don’t be scared if you don’t own a Hasselblad camera like the author does, with a decent SLR and a stable tripod you can still reach good results.
For me, the book was useful for a couple of ideas that I probably read before but I was neglecting, some new hints (like breathing on lens, playing with fantasy vs. reality, revealing nature’s strength), as well as for triggering my interest for using neutral density filters.
All in one, the book is a useful and enjoyable reading. I already recommended it to a friend who’s starting with photography.
Posted by
Radu
at
4:52 PM
0
comments
Labels: book, photography
Friday, August 19, 2011
Canot debug clickonce app
Microsoft Visual Studio
---------------------------
The following module was built either with optimizations enabled or without debug information:
C:\[....].DLL
To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option.
---------------------------
OK
---------------------------
Posted by
Radu
at
6:06 AM
0
comments
Labels: .NET, VisualStudio