0

In my product we are using OSQL to execute the sql script files. Unfortunatly some clients don't have OSQL installed in their machine. They don't agree to install sql management studio for license issues.

Is there any alternative to execute the sql scripts rather than OSQL through c# ?

3
  • 1
    As of SQL Server 2005, you should be using SQLCMD .... that should be installed by a standard SQL Server installation I believe Commented Apr 9, 2013 at 9:31
  • Thank you. Can i use sqlcmd utility in my project? because sql server installed in the server. The client doesn't have sql server and sqlcmd ? Commented Apr 9, 2013 at 9:34
  • If your client uses a SQL Server based solution, then there must be SQL Server somewhere - and that SQL Server somewhere has SQLCMD included. Your clients must have SQLCMD somewhere. I don't think you can just distribute SQLCMD with your own applications. Commented Apr 9, 2013 at 9:36

2 Answers 2

2

SQLCMD.EXE will be installed in the SQL Server binn directory on the server. You will need SQLCMD.EXE on the client, where your application runs. You can install the SQLCMD.EXE and other command line utilities separately, see Microsoft® Command Line Utilities 11 for SQL Server®.

But is not necessary to install SQLCMD, writing a C# script executor is fairly trivial. In fact I wrote one myself, see https://github.com/rusanu/DbUtilSqlCmd and is also available as a NuGet.

Sign up to request clarification or add additional context in comments.

Comments

2

I think SSMS is free for download from microsoft portal and there are no licence issues with it. Check this

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.