Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3697572
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:52:35+00:00 2026-05-19T04:52:35+00:00

I was wondering if there is any civilized method of assembling SQL deployment scripts

  • 0

I was wondering if there is any civilized method of assembling SQL deployment scripts out of parts. Like if you’ve got ten files with stored procedure definitions (it’s easier to change and debug them that way), a list of tables with fields and three sets of initial data (for every client). Or from any other set that’s more complex and organised.

Because changing schema file that is 200k big and grows is very hard.

I personally ended up writing some PHP scripts that assembled whole file for me. So, the stored proc file looks like this:

--<?php $procParams = "@UserLogin varchar(50), @RightName varchar(100)"; ?> 
--<?php if (!defined('PROC_INNER')) { ?> 
if exists (select * from sys.objects where object_id = OBJECT_ID(N'DepriveUserRight') and type in (N'P', N'PC'))
begin
  drop procedure DepriveUserRight
end;
go

--returns all the object types
create procedure DepriveUserRight @UserLogin varchar(50), @RightName varchar(100)
as
--<?php } ?> 
  declare @RightId int
  select @RightId = RightID from [Right] where RightName = @RightName

  exec DepriveUserRightById @UserLogin, @RightId
--<?php if (!defined('PROC_INNER')) { ?> 
go

exec DepriveUserRight 'mgr', 'save_login'
--<?php } ?> 

I’ve also included some semantics, such as type building from a table definition. Tables look like this:

 addTable('LinkObjectType');
?>
 LinkObjectTypeID int not null identity primary key,
 LinkObjectTypeName varchar(100) not null,
 LinkObjectTypeData varchar(250) null
<?php
 endTable();

And the command I execute is php realSchema.sql > bin/realSchema.sql

(I use MS SQL, and my application is not Web one, if it matters.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:52:35+00:00Added an answer on May 19, 2026 at 4:52 am

    I would recommend you get a design tool to manage your database, one that creates a script for you.

    Personally I use Dezign for Databases from Datanamic as, for the money, it’s an excellent tool.

    Another I have used, which is open source, is DBDesignerFork. It also can reverse engineer your database to make it easier to create the model.

    Of course these tools will not be able to help with the user data scripts but it shouldn’t be a problem for the person setting up the DB to run the table creation script and then import the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio?
I'm wondering if there are any architectural frameworks out there to create desktop or
I'm wondering is there any open-source solution for web-book creation like The Django Book
Wondering if there is any Text to Speech software available as a plug in
Wondering if there's any not-too-hard way to edit non-form text in html 4. I
Just wondering if there is any way (in C) to get the contents of
i'm wondering if there is any nice and neat tool to replace the GNU
I was wondering if there is any way to escape a CDATA end token
I'm wondering if there are any simple ways to get a list of all
I am wondering if there are any well-known algorithms that I should be aware

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.