How to connect to SQL Server? - sql-server

I use SQL Server 2008 R2 and SQL Server 2012 with C#, but I wonder how can I connect to them using D...
I did a google search and found this: http://www.prowiki.org/wiki4d/wiki.cgi?DatabaseBindings
But I found nothing about connecting to SQL Server...

One option is to use the OpenDBX bindings available here: https://github.com/rikkimax/Derelict_Extras---OpenDBX. OpenDBX provides access to multiple db servers , using a unified interface, including MS SQL Server, PostgreSQL, SQLite and others.
It has a C api so it is not very pretty, but it should work.
Another option is to use ODBC. Bindings are available at https://github.com/AndrejMitrovic/DWinProgramming.

I suggest you write a binding/wrapper for FreeTDS: http://www.freetds.org/ . That is the best, open-source library you can use to connect to the SQL server. An alternative would perhaps be unixODBC and iODBC, but as far as I know they both use FreeTDS for Microsoft SQL Server.

Related

which embedded db supports TSQL?

I have a spring batch application which reads data from SQL server. I would like to write an integration test against an embedded db which supports TSQL.
Exp: My main application has some queries which uses "for json path"
I am looking for an embedded db where I can test in memory.
PS: I tried H2 and looks like it does not support TSQL.
Please download this
https://www.microsoft.com/en-us/download/details.aspx?id=30709
Microsoft SQL Server Compact 4.0 is a free, embedded database that software developers can use for building ASP.NET websites and Windows desktop applications. SQL Server Compact 4.0 has a small footprint and supports private deployment of its binaries within the application folder, easy application development in Visual Studio and WebMatrix, and seamless migration of schema and data to SQL Server.
FYI -
Looks like Microsoft SQL Server JDBC Driver does not support connecting to SQL
Server Compact.
How to use SQL Server Compact Edition (CE) from Java?
https://social.msdn.microsoft.com/Forums/en-US/4d25a17f-6dda-4bec-8a92-f068594553ef/java-and-sql-server-compact-edition?forum=sqlce
Perhaps you can use SQL Server Express LocalDB.
I do not know about its technical details, however. I have personally not (yet) used it in a development project. Perhaps it cannot be considered to be an embedded database like SQL Server Compact Edition is. But a quick search on Internet does indicate that it could be accessed from/with Java.
Regarding managing LocalDB databases with SQL Server Management Studio... Contrary to what is stated in the official documentation, I did succeed to connect to LocalDB using SSMS (version 18.9.1). I only needed to enter (LocalDb)\MSSQLLocalDB as the server name in the connection dialog and use Windows Authentication.

Connecting to SQL server using SQL Client and DSN

Would it be possible to connect to SQL server using DSN however using SqlClient rather than ODBC.
As a matter of fact we have to upgrade a legacy VB6 component however we have to keep the user suitability same ie the users are connecting to database using a DSN.
I would like to avoid ODBC if it would be possible to connect using SqlClient.
Any comments, examples would be appreciated.
ta
Basically the answer is no. Either use ODBC or OLEDB.

Microsoft SQL server hosting that supports DTS

Could someone suggest a shared SQL Server solution that supports DTS packages?
Update:
I was hoping to use the PostgreSQL ODBC driver and a DTS package to keep data synchronized between MSSQL server and Postgres. After getting my hands on SQL Server 2005 and attempting to do this I realized SSIS doesn't seem to play nicely with the PostgreSQL ODBC driver.
I gave up on the SSIS/DTS solution and have written a program using JDBC which runs happily on my Linux server.
I am not aware of any hosting services that provide DTS or SSIS as a feature. However, if what you are trying to achieve by using DTS/SSIS is a way to do your own backups/data transfers then I would suggest you look into the Microsoft SQL Server Database Publishing Services. Go Daddy supports it.
I have used Edgewebhosting before and used DTS packages for pushing data to sites. I have no affiliation with them, it worked well for the job.

SQL data comparison tool for SQL Server Compact

Does anyone know of a tool similiar to RedGate's SQL Data Compare that works with Microsoft SQL Server Compact 3.5?
For me the following process worked:
Install SQL Server Compact Toolbox extension.
Run the "Script database schema and data" command on both databases
Use a diff tool on generated files to see the changes.
In the end I solved this problem by Exporting my 2 SQL Server Compact Databases to SQL Server Express 2005 (although 2008 would work) using Data Port Console.
I then compared them using Red Gate SQL Data Compare.
This solution works just fine for me.
Not sure, but you could also have a look at the Apex SQL tools - Apex SQL Diff and Apex SQL DataDiff. There website is here. They don't specifically mention SQL Server Compact - but I'm sure you could inquire with them.
Red-Gate and Apex are my #1 choices for any kind of SQL tools :-)
Marc
Have you tried SQL Compare from starinix? They say it supports SQL Server (All Editions) so that may include compact edition.
This software does work as I have used it (for Yukon). It's also freeware which saves worrying about licensing.

Is there a Perl DBI driver for SQL Server Compact 3.5?

Maybe I'm not looking in the right places but I'd like to use SQL Server Compact 3.5 as a back-end for an existing Perl app that uses DBI (on Windows).
I'm looking specifically at SQL Server Compact 3.5 because I'd like to use the existing support for it in MS Sync Framework to get started instead of the SQLite db I'm currently using.
I haven't seen any and since there isn't an ODBC driver for SQL Server Compact your only option is to use DBD::ADO.

Resources