How to read a remote xml file from SQL Server 2005 - sql-server

Can I read a XML file from remote server such as
http://dealer.somedomain.com/data/inventory.xml
I need read and get data from this remote XML file and update some local tables.
I use SQL Server 2005.
Thanks in advance.

Your task can be split into two sub-tasks.
Downloading the file over HTTP to your local PC (to a temporary folder).
Importing the XML file into SQL Server.
You can use SSIS for both. Once you look for "SSIS downloading over HTTP" or "SSIS downloading from website" you will find many tutorials for file download.
For the second step you will need data import, there are plenty tutorials as well, here is just an interesting pick.
You can find ready solutions including data download and import all-in-one, like here.

Related

SFTP to SQL import

I have CSV files stored in SFTP Server which I am accessing using winscp.
I have to import these CSVs into SQL Server tables.
Currently I am downloading files from SFTP and saving them in O Drive and created SSIS packages to import in SQL Server(Using O Drive as source)
How can I import data directly from SFTP server to SQL Server?
I would like to use SSIS for the same but would like to know other methods as well.
Thanks,
AP
There's a free tool called WinSCP which provides a command line utility to communicate with SFTP sites. You just need to understand the scripting language for the command line and execute the executable from SSIS.
Here you can find about this method: https://www.codeproject.com/Articles/23740/SFTP-with-SSIS-Packages
Another method to load data from SFTP to SQL Server is to use ETL tools, like Skyvia, Alooma, etc.
I use a Powershell script to copy files to an accessible location & then copy contents into a SQL table, not sure if you can skip a step & read the contents directly from the secure location (seem to remember I couldn't get it to work though).
It's a modified version of the powershell example here, followed by Import-Csv combined with Out-Datatable and Write-DataTable
There's further WinSCP code examples here

How to use SQL loader when loading from remote data file?

I am trying to load data in Oracle database from BCP files.
The Oracle database server is located on remote machine. In my control file I have added path to BCP file as - load data INFILE 'C:\path\to\bcpFile.txt'. This does not work if BCP files are not on same machine as DB server. One option I found is to create network mapping on my windows machine to the linux DB server. But this has manual overhead. I learned we can use LOAD DATA LOCAL INFILE to fetch data files, I would like see an example for this.
Install the full Oracle Client which includes SQL Loader on your Windows Computer
SQL Loader is included with full Oracle Client installs.
Once installed, make sure your infile section properly references your datafile using the correct syntax.
With the path you provided, this section would look like this:
INFILE 'C:\path\to\bcpFile.txt'

Import DB2 files to SQL Server

Given the DAT file and the DDL file for each table in a DB2 database, can I import this data to SQL Server? I have no access to the original server or any copy of a DB2 server so connecting to a live instance isn't an option.
Can I do this without a live instance of DB2 or should I go back to the client and ask for CSV files? Is there a procedure or tool that makes this process smoother? I've tried to find a file-based connection string to use to connect to a set of DB2 files with no luck. I've also tried SwissSQLDB2ToSQLServer and SqlLinesData to see if they have a file-based option built in.
OK, given the comment above, you can't import DB2's container files (DAT, LRG, or anything else) directly. You need a CSV or equivalent. Yes, one way to get this is run the EXPORT utility on a live DB2 database. HTH!

How to dump SQL Server data into csv

I'm converting web application written in ASP into PHP that will be using MySQL. I have a SQL Server database with two files (.MDF and .LDF) I want to convert into CSV file but I am having trouble finding the right tool to do the job. I found that some people are suggesting SQL Server Express. I tried it but couldn't figure out how to load database from file and use it. I also tried to use opendbcopy but when trying to open a file it doesn't show it in the file pane.
If you install SQL Server Express, you can load the image file using the Attach Database functionality in the SQL Server Management Studio (the management UI).
Then you can view and work with the database directly from Management Studio, where you can export the file to CSV by right-clicking the database name and selecting Tasks->Export Data.
There's an online service called RebaseData that can do the job. You just need to upload your .MDF file and it gets converted to a .ZIP archive. The .ZIP archive will contain several .CSV files, one for each table of the database.
Link to the converter
Disclaimer: I'm working for that service.
connect database to visual studio and write query to display all data from the table you want and then right click and select all and again right click and save it .
Its done !

Import DAT Files into Sql Server 2008

I Recently received a DAT file containing a SQL database, i would like to restore the database into my server for testing purposes, i tried to add it with the Task->Restore->Database but it didn't come up as a valid file when browsing for the DAT file, then if i select it with the "all files" option it will tell me that the file format is invalid. Does anyone know how to load those kinds of files into SQL Server 2008?
Thanks
Actually this was the issue. the DAT was a normal .Bak, but the file became corrupted while uploading\downloading from an FTP server... Weird
Regards!
Just had this exact error and found a much simpler fix.
Change the extension to .txt from .dat and then import the file via the import wizard built into SQL Server or via SSIS. To my understanding the solution in your link should only be necessary for .bak files.

Resources