Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

sql server - Is the SQL LocalDB API deprecated or not?

Overview

I am developing a C++ application that uses SQL Server LocalDB and I want to avoid making users perform any SQL administration tasks. When my application starts up, it needs to create a named SQL instance "ABC" and then start it. This ensures that the application can later connect to the instance, attach databases and run queries as needed.

Details

If I were creating and starting the instances manually, I would use SqlLocalDB.exe, the command-line utility described here. The linked page says this command-line utility is "a simple wrapper around the LocalDB instance API", so my natural thought is that I can use the same underlying API to automate this process. On this page, I see that to create a named LocalDB instance, my application should use the "LocalDB management API". There is also a page that gives a detailed code sample. Indeed, I have modified the code sample and it works in my application, even using the latest SQL Server LocalDB 2019.

However, note that the code sample includes "sqlncli.h". There is another page that refers to "SQLNCLI" as the "SQL Server Native Client API", and says this API is deprecated and "it is not recommended to use it for new development work".

So, in summary, the recommended way to automate SQL LocalDB instance management is through the SQL LocalDB API, but that API is part of the Native Client API, and the Native Client API is deprecated and shouldn't be used.

Question

Is the SQL LocalDB API deprecated or not? And if it is, then what should I use instead?

My hope is that the LocalDB API is a special, non-deprecated part of the wider Native Client API, but my co-workers and I would appreciate some reassurance about this.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...