Solved

MS SQL separate Sql Files for distribution purpose

Posted on 2015-02-08
6
42 Views
Last Modified: 2015-02-09
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.
0
Comment
Question by:Omer-Pitou
  • 3
  • 2
6 Comments
 
LVL 18

Expert Comment

by:SimonAdept
ID: 40597796
Do you mean the Generate Scripts option, which you can access by right-clicking on the database node.
0
 

Author Comment

by:Omer-Pitou
ID: 40597818
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
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40597855
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 18

Accepted Solution

by:
SimonAdept earned 500 total points
ID: 40597889
>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
 

Author Comment

by:Omer-Pitou
ID: 40598397
This is already a good news. Let me test it
0
 

Author Comment

by:Omer-Pitou
ID: 40598936
Thanks Simon. This is exactly what I am looking for. I can have the 3 different sql files.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now