Import DAT Files into Sql Server 2008 - sql-server

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.

Related

execute ssis package for another server, didn't see any files

I have SSIS package and on VISUAL STUDIO working good, for another server pre production also, but when i use production server and try loading xls files nothing do, didn't see any files. I hv the same permission both server sql so i Somebody can help me? I will be maximum enjoye if somebody will react!
Thank you very much for the suggestions!
My package imports xls files into a database on sql server
In the package I have a foreich loop cointainer and in the directory I use the variable " input folder path" .In the expression on my menager connection i have variable "Full Path" (with file name)
On preproduction server, the package is great and loads xls files. On production server no. And i have comunicat :"For each file enumerator, no files were found that matched the file pattern or the specified directory was empty."
I set delay validation (connection manager, task) is true, When i deploy on server my project again, the message "another user uses files" Nobody use this folder. only me.
I Use the mapped path // ​​fileserv / clientspath.filename.
I do not know what else i can write about this will be help self ..

How to import .sql file into MS Access

This is an assignment. I have to import a .sql file into MS Access. The file preferably will be NorthWind Database (.sql file). I have downloaded one from:
https://northwinddatabase.codeplex.com/releases/view/71634
and it contains a .sql file.
What to do next?
(Please note that importing/connecting MS Access from/to MS SQL Server through ODBC is irrelevant to this problem. The problem is to import a generic .sql file)
That's plain impossible without a major rewrite, and I seriously doubt if that is the assignment given to you.
The SQL for download is in T-SQL for building the complete database in SQL Server.
The Nortwind database is for download in an Access version if that is what you need.
You are going to have to rewrite it, but you should be able to open it with any text editor like notepad. Then you can copy and paste it into the sql view in the query designer.

SSIS Permission Issue Flat Files

I recently had to move my files to a new SSIS server. Everything seems to be working except when I try to execute a bulk insert it tells me
(Cannot bulk load because the file "E:\FlatFiles\SSG\apmast.txt" could
not be opened. Operating system error code 21(The device is not
ready.).".
It does this for all my flat files. I found an article saying you need to give the MSSQLSERVER user full control of the files, which I did but this does not seem to fix it. Any other ideas? Do I need to give other files the same permissions? I really don't want to just throw full control around if I don't have to. Thanks
I figured it out, turns out that a bulk insert tells the server to look locally for the text file. I was trying to get SSIS to do a bulk insert of flat files from one server into another sql server on the network. As soon as I put the flatfiles on the remote server it grabbed and used them. This seems like a very odd way for it to work. I would expect it to push the files to the sql server instead of asking the sql server to look for the files locally via a hard path.

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 !

How to read a remote xml file from SQL Server 2005

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.

Resources