Search Results

Search found 3 results on 1 pages for 'user327045'.

Page 1/1 | 1 

  • SQL Server 2005 Import from Excel

    - by user327045
    I'd like to know what my best option would be to import data from an excel file on a weekly or monthly basis. At first, I thought I would use SSIS, but after much struggle with seemingly simple tasks, I'm starting to rethink my plan. Would it be better/easier to just write the SQL by hand or use the services of an SSIS package? The basic process will be as follows: A separate process will download an .xls file to a local fileshare. The xls file will have a filename like: 'myfilename MON YY'. I will need to read the month and year from the the filename, reformat it to a sql date and then query a DimDate table to find the corresponding date key. For each row (after the first 2 header rows), insert the data with the date key, unless the row is a total row, then ignore. Here are some of the issues I've been encountering with SSIS: I can parse the date string from a flat file datasource, but can't seem to do it with an excel data source. Also, once parsed, i cannot seem to convert the string to a date in order to perform the lookup for the date key. For example, I want to do something like this: select DateKey from DimDate where ActualDate = convert(datetime, '01-' + 'JAN-10', 120) but i don't think it is possible to use the 'convert' or 'datetime' keywords in an expression builder. I have been also unable to find where I can edit the SQL to ignore the first 2 rows of data. I'm very skeptical of using SSIS because it seems like a Kludgy way of doing something that can probably be accomplished more efficiently writing the SQL yourself, but I may be forced to use SSIS. Thoughts?

    Read the article

  • sharepoint spweb and spsite disposal

    - by user327045
    I've been using the following code in a .NET 1.1 SharePoint 2003 environment and it works great: try { site = SPControl.GetContextSite(Context); web = site.OpenWeb(); ... } catch (Exception export) { output.Write("Caught Exception: <br/><br/>"); output.Write(export.Message + "<br><br>"); output.Write(export.StackTrace); } finally { if (web != null) web.Dispose(); if (site != null) site.Dispose(); } However, I'm currently porting the code to a .NET 2.0 SharePoint 2007 environment and I get the following error message: "Trying to use an SPWeb object that has been closed or disposed and is no longer valid." If I comment out the Dispose() code, it works fine. But won't this cause memory leaks? What's the best way to fix the problem?

    Read the article

  • How to parse a date from an SSIS Excel filename

    - by user327045
    I want to use the foreach container to iterate through a folder matching something like: "Filename_MMYYYY.xls". That's easy enough to do; but I can't seem to find a way to parse the MMYYYY from the filename and add it to a variable (or something) that i can use as a lookup field for my DimDate table. It seems possible with a flat file data source, but not an excel connection. I'm using Visual Studio 2005. Please help!

    Read the article

1