Posts

Showing posts from October, 2011

Get excel sheet names in a script taks

Image
Hi, I had seen a question asking about getting all the excel sheet names in a work book, so I've created the attached example package. Basically I'll loop over a specific folder, get all the excel file names into a variable, pass it to a script task to get me the worksheet names.   In the SCRIPT TASK, add a reference to  MICROSOFT.OFFICE.INTEROP.EXCEL Then add this code block.. Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Imports Microsoft.Office.Interop <System.AddIn.AddIn("ScriptMain", Version:="1.0", Publisher:="", Description:="")> _ <System.CLSCompliantAttribute(False)> _ Partial Public Class ScriptMain     Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase     Enum ScriptResults         Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success         Fail...

Strip Time out of date SSRS

I've a column type "datetime" that reads 09/23/2011 12:00:00 AM, need to show only the month and day portion seprated by "/" or "-". There're 2 ways to do it in SSRS: 1-the easiest way :) and the right one too... =Month(Fields!Tuesday.Value) & "/" & Day(Fields!Tuesday.Value) 2-the long fiasco way ! I was just fooling around !! =StrReverse(Replace(StrReverse(left(Fields!Sunday.Value).ToShortDateString,5)),"/","",1,1)) It's your call...