MS SQL separate Sql Files for distribution purpose

Hi,
How can I have for distribution purpose (at my client place):
1. Separate SQL file with all my tables (Table Definition and Potential Data)
2. Separate SQL file with key tables (Table Definition and Potential Data)
3. Separate SQL file with my stored procedures/functions

The idea is to be able to run them at the client place, depending if it a new installation or an update.
I was able to do that with MySQL workbench with export options.
I wonder how this can be done in MS SQL.

Best regards.
Omer-PitouAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
SimonConnect With a Mentor Commented:
>Does the generated script contain both table definition and potential data?

By default it includes definitions only, but you can tick an option to include data as well. It's under the 'Advanced' button at the "Set Scripting Option" step of the prcoess. Change 'Types of data to script' from 'Schema only' to 'Schema and data'.
0
 
SimonCommented:
Do you mean the Generate Scripts option, which you can access by right-clicking on the database node.
0
 
Omer-PitouAuthor Commented:
Does the generated script contain both table definition and potential data?
In one word, how can I deploy or distribute my database along with my application.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I would consider to have the "my tables" and "my procedure" all in the same dedicated schema, and the key tables with another schema.
that way, you can easily filter in the sql generation process what you want to include in each of the file(s) to be generated;
0
 
Omer-PitouAuthor Commented:
This is already a good news. Let me test it
0
 
Omer-PitouAuthor Commented:
Thanks Simon. This is exactly what I am looking for. I can have the 3 different sql files.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.