Copy data from Hypersonic to Sql server 2008 - sql-server-2008

I created a website using liferay with some sample pages. Later we wanted to import some 23000 users into liferay. The data is in csv format.
I dont know java. tried to insert data using C#.net and liferay webservices. No luck. So i changed the settings to point to Sql Server.
Now all the data I created for the sample site is residing in the Hypersonic DB.
Is there any way to copy the data to sql server?

The simplest way would be to gather all your table data from HSQLDB into .CSV format.
If you can use your original .csv file, that's great. If needed, you'll need to find a way to get your data from HSQLDB into a text file. You may have a tool already that you know of. Perhaps you could use RazorSQL's Export Tool. (screenshot).
Then you can import .csv to SQL Server using the SQL Server Management Studio Import Wizard. The screenshots are a bit out of date, but you'll have no trouble figuring it out.

Related

What is the best practice for retrieving and downloading mass data from SQL Server using Flex/Actionscript

I have a Flex web-based application that retrieves data from SQL Server and displays it in a data grid. I'm using FileReference to export the data from data grid into a CSV file, which is fine for small amount of data. I need another method for retrieving and downloading massive data directly without displaying it in the data grid. I was thinking it must be a way to export data on the server using SQL server (like using OPENROWSET method) and then download the exported file. But I couldn't implement it so far. Also I'm not sure if it is the best approach to do such task. I was wondering if anybody could help me out to find a solution for it. I really appreciate it.
I'm using IIS 7 as web server and Adobe Flex Connector for MS SQL Server as web service to connect to SQL Server
You can use FileReference.download(URLRequest) to download the file directly from the remote server. The file itself should be created on the server side. For example, if you use ASP.NET, you can create a service (WCF, Fluorine etc) that fetches data from the DB, puts it into generated file and returns the url of the file to Flex client which can then use FileReference.download.

Import tables structure and no data from one database to another

I have database with multiple tables in Microsoft SQL Server with schema in tables as "xyz".
i am able to copy this database tables along with data from one sql server to another using export and import wizard of SQL server.
I want to do find a way to-
1. Copy only tables with no data.
2. is it possible to covert current database design to a script and then run the same on another server which will create all these tables with empty data ?
Thanks in advances.
Best Regards
Yes, you could do that with Management Studio. Right click your database and then select Tasks -> Generate Scripts.
There are some settings there you should tweak, like if it should generate scripts for indexes and statistics. They are all in plain sight.
An alternative is SQL Server Data Tools. It's relatively new (ex-Data Dude). It's not as straightforward, but better on a long term, for database versioning and for creating migration scripts.

Options to insert data into mysql table

Hi I failed to find how to insert data into mysql database table using phpmyadmin on mamp. Neither found YouTube video or google tutorial as such. Is there any free tool/add-on to insert data into table? or my onlly choice is to use php script within the html code? Any suggestion on this? TYSM!
You should take a look at HeidiSQL which is a handy free MySQL front end:
http://www.heidisql.com/
You can create, browse and edit data. It also has bulk import tools to allow you to import data from CSV files or pre-generated SQL statements.
I find this a pretty invaluable tool for my daily MySQL management tasks.

how to import MySQL tables and records to MS-SQL?

how to import MySQL tables and records to MS-SQL?
i've been trying to copy the MySQL scripts and then pasting it to MS-SQL query board but it always threw an error.
Have you tried the Import & Export tool DTSWizard.exe which is installed on your machine by MS Sql Server? See here:
http://msdn.microsoft.com/en-en/library/ms141209.aspx
I think you will have to export your MySQL data into a CSV file, then import that CSV file into MS-SQL. I'm not familiar with MS-SQL, but the two RDBM's might have different data types for example, so you might be hard pressed to find a tool to convert a mysqldump file to MS-SQL format.
You can use Import&Export Wizard or MS SQL Integration Services.
You can use DTS to do this.

How to convert an ESRI Shape-file into SQL Server 2008?

I have a shapefile that I would like to upload to a spatial SQL Server 2008. I have tried using this tool: SQL Server 2008 Spatial Tools. But without luck.
Does anyone know any other (free) tools for doing this?
You can use ogr2ogr to convert from shapefile to GML (or many other formats) and then use SQL Server's GeomFromGML to import. You will need to call GeomFromGML for each feature in your shapefile, but that's a relatively easy program to write.
I have written code in arcbjects for do this task. If you have license arcview or engine you can create a console application in c# and use this code: see https://gis.stackexchange.com/questions/33917/how-to-import-shapefiles-into-ms-sql-2008-and-then-view-that-data-using-qgis?lq=1
UPDATE: I decided I would just point people to the official Github repo instead: https://github.com/zer0infinity/OGR2GUI
This [ogr2ogr fork] tool will attempt to parse the content of the input file (in my case, it was a shapefile) and output it as a bunch of different formats (in my case, I needed it as a CSV, but you can even export your file as a SQLite file). Unfortunately it doens't do straight up SQL, but you can do a dump from a SQLite viewer such as SQLite Browser and import it onto MS SQL. I did notice some inefficiencies when converting to SQLite (I lost some attributes/tables). I also tried MobileMapper Office (MMO) (with better luck) to export to CSV and it did preserve a lot of the data, but you'd then need to write a script to import the data to SQL. If you are going that route, let me know, I'm currently writing a VBA script to deal with the exported data from MMO.
If you're hoping to build this into your application (a script of some sort), you may have some luck trying with ogr2ogr, but you never know what the data is going to look like. documentation is found here http://www.gdal.org/ogr2ogr.html
Original answer: Save yourself sometime and just use this amazing tool: http://ogr2gui.ca/
It's based off ogr2ogr, but with a nice GUI.
I've made an app for importing shapefiles into SQL Server. It's made primarily to suit my needs but i had some spare time so i made an installer for you.
Some nice things you can do with it:
choose encoding of input shapefile
rename/remap destination table column names
choose the destination table name
set the primary key for the destination table
It has a user interface and you can download it for free.
More details can be found on my blog, here's the link: Import shapefiles into SQL Server