Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Update local SQL store procedure

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2010-07-27 : 08:43:09
In a off-line vb.net app (about 20 users) which will use local SQL saver to store all objects, such as tables, store procedures. How to update local server store procedures in each lap top if I update store procedures in server? For example, I create a new store procedure, sp_order_new, I want to load it into 20 lap top local SQL server to be ran for app. So far, I have to update it in all lap top local SQL server. I knew that this is not the best way but I have no idea of how to.

Sachin.Nand

2937 Posts

Posted - 2010-07-27 : 08:56:09
Create a script file for the sp & execute it on each laptop.


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-27 : 10:59:22
We have some scripts that have to be run remotely to update things.

We have a table in the [central] DB that stores them, together with "come-from" and "will-get-you-to" version numbers.

Far end can then be "told" that it needs to get to version C, will check its local database and discover that it is on Version A, and will query to retrieve, and execute, scripts for Version B and Version C [from central DB]

This won't help the first time you do it, as you will have to distribute the bit that actually runs the script at the remote end, but thereafter you should be able to just INSERT a new script to the "version table", and then have the remote ends update (could be a check that they do at each startup, or something you email the users telling them explicitly to do)

I have a friend who sells accounting software and they do the whole thing with an XML file. The XML file includes new executables for the application, changes for the database, all sorts. It processes each element in the XML, in sequence, and Hey Presto! the application and database updates itself. Very slick!
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-07-27 : 12:35:31
I have a friend who sells accounting software and they do the whole thing with an XML file. The XML file includes new executables for the application, changes for the database, all sorts. It processes each element in the XML, in sequence, and Hey Presto! the application and database updates itself. Very slick!


We do it using 3rd party source control where by which you commit the script file into the source safe.a list of databases & servers is maintained in a XML format in the source safe for a project.as soon as you commit those changes in the source safe project, the script file automatically gets executed in all the related servers for that source safe project.
So in the case of OP as soon as the laptop user gets connected to the SourceSafe & if his local server is registered in the source safe the script file will get executed.



Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2010-07-27 : 17:18:53
Can you tell me the name of 3rd party source control? It is what I looking for.
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-07-28 : 00:40:54
quote:
Originally posted by Sun Foster

Can you tell me the name of 3rd party source control? It is what I looking for.



http://www.syntevo.com/smartcvs/index.html.

But it is not free.


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-28 : 01:11:13
(Just drop the "." from the end of the URL ... pesky forum formatting code )

By the by, we use SVN for our source code repository (and Tortoise as the Client) [they are the Opensource components, I don't know about SmartSVN]. I've got absolutely, 100%, NOTHING bad to say about it. For anyone not using version control ... well ... set yourself a resolution, today, to install it and start using it!
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-07-28 : 01:16:03
quote:
Originally posted by Kristen

(Just drop the "." from the end of the URL ... pesky forum formatting code )




Oops....

Done it

http://www.syntevo.com/smartcvs/index.html




Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-28 : 01:18:04
Idera : does SmartSVN have the distribution "tricks" built in, or is that something you built "on top" of SmartSVN?
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-07-28 : 02:08:35
quote:
Originally posted by Kristen

Idera : does SmartSVN have the distribution "tricks" built in, or is that something you built "on top" of SmartSVN?



To be frank enough I have no idea on its internal architechture .
We have an in house Source Control administrator who comes up with different tricks & tweaks.


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-28 : 02:23:15
"We have an in house Source Control administrator"

Blimey! A bit like a Butler then, eh?!!
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-07-28 : 02:48:19
quote:
Originally posted by Kristen

"We have an in house Source Control administrator"

Blimey! A bit like a Butler then, eh?!!



Yeah we have lot of positions in the company which can be synonymoms with butler,chauffeur,masseur etc


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2010-07-28 : 10:25:20
Is there any way to store a store procedure as a record in one table cell? If so, I can use code in app to finish this project.
The problem is that only one line can be copied.
For example, copy sp1 below into a cell will be "SET ANSI_NULLS ON" only.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SP1]
SELECT * FROM ORDER

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-28 : 10:51:52
Its probably in there, just the display-back will not display line breaks. Try query it in a Query Window, rather than an Edit Grid ?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-28 : 10:52:57
Note that "GO" as a separator is only really a Query Analyser / SSMS section terminator, you may need to handle that specifically in your application when it tries to actually "run" the script
Go to Top of Page
   

- Advertisement -