How to access ms sql server 2008 in c? - sql-server

I know little about sql server access, and all googled out for sql server accessing are using
C# or php like language.
Is there a good step by step about how to set up sdk and write an start program in c
to access sql server database?

You have a couple of options:
ODBC
SQLServer's DB-Library
If your application has a fairly simple DB interface (mostly common insert, update, delete, select commands), I would go for ODBC because of portability issues.
Do keep in mind that in order to use DB-Library you might need to get DLL's from older versions of SQLServer, since it's been deprecated in 2008.

Related

Can't find Microsoft SQL Server even if it is installed?

Regarding the following images, I have obviously installed the Microsoft SQL Server, but I can't find the exe-file or anything named Microsoft SQL Server in the start menu.
Anyone who knows what to do to solve this, or do I need to install something more?
SQL Server runs as a service. You can start and stop it from windows services. SSMS is a gui tool for managing ddl (creating and altering tables and index's for example) and dml (writing queries to inquire, update or add data to databases).SSMS comes free with every edition of SQL server - perhaps you didn't tick a box when installing? You can also do this stuff the old fashioned way using sqlcmd from command line(DBAs love this for some reason) but for us mortals SSMS is much less of a struggle. As an aside there are other guis such as Toad (expensive) and Heidisql (free) amongst others which will do the job.
Looks like you have the engine. What you've got to do now is install SQL Server Management Studio: https://msdn.microsoft.com/hr-hr/library/mt238290.aspx
Looks like you have the various SQL Server components that are installed by Visual Studio (recent version) or SQL Server Data Tools (as used by VS).

Using Microsoft Sync Framework to synchronize two identical SQL Server 2012 databases using Change Tracking

I'm currently evaluating options for synchronizing two identical databases that will be deployed on two different SQL Server (1) instances. I've started with the Microsoft Sync Framework and if it does not fit my requirements I'll check SQL Replication.
Anyway, long story short, I'm trying to get a basic scenario to work using the Sync Framework but unfortunately all of the examples and tutorials I've seen online use the SQL Provisioning Provider which adds certain tables, stored procedures and triggers to the database - I want to avoid this, obviously.
I read somewhere that the Sync Framework can use SQL Server's built-in Change Tracking features, but this only works when the client is SQL CE (example). But all what I have read so far seems to be out-dated. I couldn't find anything that is relatively recent about the topic. So I was wondering whether the above is still valid or the Sync Framework added support for the built-in Change Tracking with SQL Server 2012 (or 2014).
In case this scenario is still not supported until this day, could someone refer me to an example (or at least some hints) of how I could develop a custom provider to use Change Tracking on both the client and the server?
(1) SQL Edition is not a constraint. Even SQL Server Enterprise Edition is an option.
support for SQL Change Tracking only works for the older SqlCeClientSyncProvider/DBSyncProvider/SyncAgent, in short you can only use to sync SQL Ce with a SQL Server configured for SQL CT.
the newer sync providers do not support SQL CT.
there used to be a sample SQLExpressClientSyncProvider from MS that has been pulled out from the download site due as it has some issues.
Writing a custom sync provider is not easy, if you can go for SQL Replication, that will be an easier route.

Redistributable local database for windows desktop app

I am getting a little bit confused about the difference of the followings:
SQL Server Express
SQL Server Compact
localDB
My requirement is to develop a desktop application that will use basic RDBMS features. I need to package the application and allow the user to install a single distributed package. I don't want the user to install even SQL server express.
In this case, which DB I should use? SQLite is not considered as too much re-coding has to be done.
Thank you.
SQL Server Express is full featured DBMS, with some limitations in terms of database size and resources it is allowed to use. You can see it's limitations (relative to SQL Server) on microsofts site (Features Supported by the Editions of SQL Server 2012)
SQL Server CE is embedded database, meaning that it runs in user mode, it's easy to deploy (requires you to copy just few assemblies), lightweight but fast, can be run by a low privileged user. It's supported by NHibernate. However, has more limitations. To me most notable is that there are problems when you try to have multiple connections to same database. Although MS claims that this is supported, if you try this in Windows 2008 server, you will fail. And what's worse, such use scenario may lead to DB corruption. This means that you will effectively not be able to use some Management tool to update data while your service/website is running. Also, SQL Server Management studio doesn't support SQL CE anymore, so you will have to use a 3rd party tool, like Database.NET. It also does not support subqueries.
localDB, having not used it, sounds like a compromise. It's a standalone database which is executed in user mode (can be used by low privilege user), but must be installed so you will need administrative privileges for that part. Offers set of capabilities of SQL Server Express. It's much larger than SQL CE, and also requires to be installed (unlike CE which is just binary drop in). Shortest overview of this DBMS can be found here.

What to consider when getting started with SQL Server?

I've got experience with MySQL, DB2, and Oracle, but aside from writing a few queries, I've never used SQL Server.
My question is a three parter:
1) For a developer, what are some good "free" client tools to look at, and why (by "free" I mean open source, freeware, or the tools that come with SQL Server itself)?
2) I plan to run Developer or Express Edition on my workstation for development, and either Standard or Enterprise Edition in the testing and production environments. What methods exist if any for transferring data between different servers and the different editions?
3) Are there any common pitfalls that someone like me (who is used to the other database systems that I mentioned) might encountered during development?
TIA
SQL Server Express with tools.
All editions have the same SQL language features and code is 100% portable between them. There are 3rd party tools to synch changes, but moving entire DBs is easy using inbuilt tools.
Nah. The problem with databases is SQL and set theory, not the choice of RDBMS. If you understand databases/SQL you'll be OK.
SQL Server Management Studio which comes with SQL Server (any editions), or you can download it separately. SQL Server Profiler which doesn't come with Express.
Management studio has tools for backup/restore database. You can also consider detach/attach method to synchronize db .
It's hard to say. But if you had Mysql experience you will be pleasantly surprised by SQL Server.
UPDATE
There are so many things that each DB vendor implements differently that it's really hard to focus on some of them. One thing I was not used before is that SQL Server doesn't let unique columns to have more than 1 NULL value(there is a workaround though)

Delphi 3 to SQL 2008

One my clients has a system written in Delphi 3 and the database is Paradox. My job is to convert it to use SQL Server 2008. How can I make it connect to SQL 2008?
This is pretty old stuff, I know. I appreciate the help.
Thanks
At the very least BDE should be able connect using ODBC and choosing the SQL 2008 Driver in ODBC. I haven't tried, but I doubt that the BDE SQL driver will connect to SQL 2008, and I doubt anybody will develop a BDE driver for 2k8.
Do you intend on moving from Delphi 3? If so, then SDAC (SQL Server Direct Access Components) from Devart would be worth looking at. They support SQL Server 2008 but unfortunately require Delphi 5 or above. They use OLE DB and any Windows machine with 2000 or above will have the drivers installed (which is part of Microsoft Data Access Components - MDAC).
You can use ADO without using Ado Components, by importing ActiveX Data Objects Library, but this will require more work.
Why not upgrade the project to Delphi 2007 as a stepping stone towards the future? There have been many improvements and bug fixes to the language since Delphi 3 that you could easily take care of. The pain of migration might be much easier than dealing with issues which have been already addressed and corrected in the latest versions of the compiler.
You can try one of the Free Components from Torry.net to connect to the SQL server using ADO.
Check TaoADODataSet and Free ADO Dataset in the page http://www.torry.net/pages.php?id=569. These components have Delphi 3 support.

Resources