Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Monday, March 12, 2012

How to import files via HTTP in SSIS

Hello,

How can I import data into SQL server via http server ?

ThanksHi,
Is this any use to you: http://www.sqljunkies.com/WebLog/ashvinis/archive/2005/05/25/15653.aspx

|||Yes i saw it, but i'm novice, i don't know how tu use it ...

If someone can help me|||The code is VB.Net which can be used within a Script Task in your package.
To start, add two variables. Hope fully the names are self-explanatory-

RemoteUri
LocalFileName

Ensure they are type String, and set some suitable values. Add a Script Task, and replace Sub main with Ash's code.

|||thanks a lot, i'll try it !|||

How can i do to specifiy the path of local file with something like

PhysicalApplicationPath in a DTS script task ?

|||

The script references a variable to get the file - Dts.Variables("LocalFileName").Value

Or

Is PhysicalApplicationPath a special path that you expect to be derived? If so what exactly would you expect it to be?

|||I need to specify where my file will be downloaded. My problem is i execute this on shared sql server...

Thanks|||So use the variable and supply the folder you need to that variable. You cannot get th path of the package, as the package may not even have a path, and is being hosted at execution time, so the package path is meaningless. You seem to have started another thread so followup there.

How to import data from Text file which contains header?

Hi there,

How to import data from such text files into a specified table?

http://www.geocities.com/salan_alani/outputlog.txt

The data I want to import is only the last 5 lines (for instance) shown in the above text file. So, I want first to ignore the header in the beginning of the file, and the other thing that in my row lines (last 5 lines shown in the text file) there is no specific delimeter but each field has a fixed size and position in the line (for example: "RNC ID" field correspond to the first 8 charactes in the line)

I tried to use BULK INSERT statement but I could not figure out how to ignore the header.

I am using SQL Server 2005 Express Edition

Thanks in advanced,

Salan

You need to specify the FIRSTROW parameter with the number of teh first row to import.|||

All the options can be found in BOL

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/be3984e1-5ab3-4226-a539-a9f58e1e01e2.htm

|||

Thanks SimonSa,

But please could you show me how the FORMATFILE could be in my case, I just need an example to start over.

Thanks in advanced,

Salan

|||The FIRSTROW parameter is specified as an option to the BULK INSERT statement. You don't have to do anything to the format file itself. You can also pass this parameter to the BCP command-line utility using -F option.