1

I am working on a C# application which depends on a few SQL Server databases. Now, in my development environment, I am using SSMS (SQL Server Management Studio) to create and manage my databases. My connection string looks like this:

 SQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
                        "Data Source=xxx.xxx.xxx.xxx,1433;" & _
                        "Initial Catalog=mySQLServerDBName;" & _
                        "User ID=myUsername;" & _
                        "Password=myPassword"

I am not sure how to properly ask the question. The point is, how do I provide the databases then? I mean:

  • Should I backup my databases, ask the client to install both SQL Server instance and SSMS, then restore the databases from SSMS?

  • Should I provide my databases and ask the client only to install SQL Server instance? In this case, how should they restore the databases?

Please, I am not very experienced, that's why I am asking.

closed as unclear what you're asking by LowlyDBA, Scott Hodgin, Colin 't Hart, mustaccio, paparazzo Jun 13 '18 at 16:05

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

2

I suppose that you have a setup kit to ship your application.

I also suppose that you want to ship an empty database with your application, with at most a handful of rows for built-in values in some tables.

The correct way to handle this is to include your database setup in your setup kit, so that it creates the database and all required objects (tables, views, procedures, users, logins, ...).

One possible way to do this is to include a .dacpac file in your setup kit and invoke sqlpackage to deploy it to a target sql server instance. The .dacpac file should be obtained by building a database project in visual studio (SSDT).

If you don't have a database project or you don't have a setup kit, you should probably rethink your deployment strategy completely.

  • But here's what i am thinking of the scenario : Client may be a company, so they have a mainserver, now, i should ask them to install SMSS and SQL instance, then i'll ask them to restore the given database using SMSS and give away required credentials to their employees such as IP and PORT for DataSource(in the connectionstring) - is this thinking correct or am i missing something ? – Aousaf rashid Jun 13 '18 at 15:18
  • 1
    If your client already has a SQL Server instance, you should provide the .dacpac file separately to the DBA, so that they can deploy it manually to the existing instance. – spaghettidba Jun 13 '18 at 15:20
  • can you provide a link to any tutorial on how to make a .dacpac and also how the client will deploy it to the existing instance? – Aousaf rashid Jun 13 '18 at 15:30
  • 1
    First Google hit for "visual studio ssdt tutorial" mssqltips.com/sqlservertutorial/9000/… – spaghettidba Jun 13 '18 at 15:32
  • i am going through the link you shared....One last question : By following the steps , i would be able to deploy a database with required tables and the deployed database can also be deployed to any running instance of sql server - is this correct ? So, does that mean, from my program's installer, i can just trigger/fire/launch a required file(let's say an exe or anything) which will deploy the database all by itself ?? – Aousaf rashid Jun 13 '18 at 15:38
0

There is way too much missing background and context to give much of an answer here.

"a few SQL Server databases"?

How large will your DB(s) become, and how many users do you expect to access the same DB(s)?

Is this one of those situations where the application could or should legitimately be run locally with a different DB on each target machine, or a single DB on a central server?

Will your application be one of many running on whatever it is running on, or might it make sense that you are delivering an entire disk image or PC?

Whatever the case, you want to minimize effort and complication for your client. Have your application or its installation program do the work, don't expect them to understand or have to jump through many complicated hoops. This applies even if they are large companies with IT departments, although in that case you cannot just install on their servers - they are in charge.

  • one question i might ask .... I am thinking of using one database with multiple tables.... Is this the way to go or should i choose multiple databases with single tables ? and the databases will become very huge..Let's say .. umm ... a few TB – Aousaf rashid Jun 13 '18 at 15:44
  • Sorry, but "a few TB" database and no experience is asking for trouble. You need to design your achitecture wisely and IMHO you need professional help to do so. Hire a professional to help you – spaghettidba Jun 13 '18 at 15:49
  • 2
    " Is this the way to go or should i choose multiple databases with single tables ? " "Please, I am not very experienced". Apparently. You need to back up a few steps and get some DB theory under your belt before you write another line of code. Seriously. – mickeyf Jun 13 '18 at 15:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.