C#: Could not load file or assembly
Written by: Mr.ML
As you may know, I’ve recently tweaked someone’s C# code to make it work the way I want. That post can be found here. I am pleased to say that it work perfectly on my laptop but when I loaded it on the server to be executed, I got the error:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. The system ca...
SSIS: Data import lesson learnt
Written by: Mr.ML
Yesterday, I was trying to import a flat file into a sql table. The table has varchars and ints. I had to use a data conversion tool to convert to string and 4byte unassigned so it the data type would convert correctly. Except, SSIS was being a big douche and didn’t want to be nice. I kept getting errors about the data type coversion for client_id is invalid and blah blah blah.
I asked a coworker who has more experience than I do when it comes to SSIS pkgs and he suggested that I ...
SSIS: Export more than 255 columns from SQL table to Excel
Written by: Mr.ML
A few weeks ago, I was looking to export more than 255 columns from a table in SQL to Excel using SSIS. I thought this task was going to a piece of cake because in SSIS, within the dataflow task, you get an Excel Destination task and this will take care of all my woes! But alas, it didn’t and I have spent the past 2.5 weeks, not all 8hrs a day, looking for a solution.
The setup: A table has over 255 columns and I’m using office 2010.
I went all over the place looking for a so...
SSIS: Export more than 255 columns from SQL table to Excel
Written by: Mr.ML
A few weeks ago, I was looking to export more than 255 columns from a table in SQL to Excel using SSIS. I thought this task was going to a piece of cake because in SSIS, within the dataflow task, you get an Excel Destination task and this will take care of all my woes! But alas, it didn’t and I have spent the past 2.5 weeks, not all 8hrs a day, looking for a solution.
The setup: A table has over 255 columns and I’m using office 2010.
I went all over the place looking for a so...
SQL: Working with daylight savings
Written by: Mr.ML
There are a lot of scripts out there that deals with daylight savings. I never really had to deal with it because I’ve always just use UTC/GMT and now that I’m in Arizona, daylight savings … ha … what’s that all about?! Unforunately, I have to deal with it recently in a project I’m working on. The hours we get from the source is in PST and the client, they want it converted to eastern time. As I said, there are many scripts out there that does the trick an...
adding timestamp to a filename base on some criteria
Written by: Mr.ML
This morning, I focused on coming up with something for a client. For the files that we generate, they wanted the timestamp to be either rounded up or down. If it is less than 15 minutes, round down to the nearest hour; else round up to the nearest hour.
So the logic I can up with is as followed:
declare @a datetime select @a = dateadd(ms, dbo.fn_GetOffSet(4, getutcdate()), getutcdate()) select filestamp = case when DATEPART(hh, @a) between 01 and 09 and DATEPART(mi, @a) < 15 then conve...
adding timestamp to a filename base on some criteria
Written by: Mr.ML
This morning, I focused on coming up with something for a client. For the files that we generate, they wanted the timestamp to be either rounded up or down. If it is less than 15 minutes, round down to the nearest hour; else round up to the nearest hour.
So the logic I can up with is as followed:
declare @a datetime select @a = dateadd(ms, dbo.fn_GetOffSet(4, getutcdate()), getutcdate()) select filestamp = case when DATEPART(hh, @a) between 01 and 09 and DATEPART(mi, @a) < 15 then conver...
SSIS: adding a dynamic date to filename
Written by: Mr.ML
This past week, I worked a lot with SSIS, more often that I’m used too and I foresee working on it a lot more in the future. It is actually a pretty cool application. I don’t know why I shyed away from it before.
So this past week, I had a bunch of files that were being created via SSIS and one of the requirements were that the file names had to have a specific timestamp as its suffix followed by a .xml extension.
In SSIS, I created a variable and gave it the file name. In the f...
Networking equipment
Written by: Mr.ML
Yesterday, I was talking to co-workers about network cables and such. I wanted to know if there was a place where I can get some cat5e or cat6 cables for cheap. I also wanted to know the difference between the 5e and 6 because I have fiber optic running straight into my house and right now, the switch between my router and the fiber is only a 10/100.
I was told that the best place to get inexpensive but good quality cables and 1gb switches was at monoprice.com. I have never heard of them u...
Networking equipment
Written by: Mr.ML
Yesterday, I was talking to co-workers about network cables and such. I wanted to know if there was a place where I can get some cat5e or cat6 cables for cheap. I also wanted to know the difference between the 5e and 6 because I have fiber optic running straight into my house and right now, the switch between my router and the fiber is only a 10/100.
I was told that the best place to get inexpensive but good quality cables and 1gb switches was at monoprice.com. I have never heard of them u...