October 5, 2012 at 6:26 am
Hello Everybody,
As most people here I have a load of scripts. There is no real organisation in these scripts, because they are collected from projects, from the internet, own developments, examples from others etc.
Does anybody here use a database to keep the scripts and snippets off scripts in?
I asume a lot of people must be doing this, but searching on 'SCRIPT DATABASE SQLSERVER' does
not give the required results. (Suggestions for better searches are wellcome).
Scripts is in the broadest sense of the wordt.
Scripts with examples of SQL - constructions, String functions, functions.
Information_schema scripts.
Maintenance scripts.
Scripts where the table name has to be substituted in.
In my view the scrips would have a group (or scope) and a name.
Offcourse the database would be searchable.
Scripts should parts which can be replaced.
Functions:
Export to file (off all scripts), import from file (from all script).
Searching on scripts, showing of scripts execution of scripts (With some substitutions ?).
At the moment I keep mij scripts in files, but is a database a better place to keep al my scripts ?
How?, Where?, What? Suggestions?, Internet links for databases which contain scripts?
Offcourse I have my own idea's, but I suspect this has been done before, so I'll can use an existing one or learn from that. Thanks.
Thanks for your time and attention,
Ben Brugman
October 5, 2012 at 7:05 am
you can use a version control tool for it.
Regards,
[font="Verdana"]Sqlfrenzy[/font]
October 5, 2012 at 7:14 am
Sqlfrenzy (10/5/2012)
you can use a version control tool for it.
Thanks for your anwser.
To my knowledge (I know VSS and TFS) version control tools can only store versions of files. At the moment I store my scripts in files, but they are not accessable from within Management studio. I often can not find scripts I know I have. A version control tool would not help with that.
Having the scripts in a database would have some advantages above having the scripts in files.
Thanks for your time and attention,
Ben Brugman
October 5, 2012 at 7:28 am
you can check SQL source control from red gate. Also, having scripts in database is kind of similar a document store. Do more research on document store..
Regards,
[font="Verdana"]Sqlfrenzy[/font]
October 5, 2012 at 7:34 am
I have what I call a sandbox DB to hold scripts, some T-SQL and have it set up so as to be able to search by key words, for example 'openrowset'. In many, the table that is searched also if appropriate contains a link to the source of the item .. Find it extremely useful.
October 5, 2012 at 7:48 am
Your google-fu is just failing you today. Try searching "code snippet storage". You will find lots of apps for doing just that.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
October 5, 2012 at 8:12 am
bitbucket-25253 (10/5/2012)
I have what I call a sandbox DB to hold scripts, some T-SQL and have it set up so as to be able to search by key words, for example 'openrowset'. In many, the table that is searched also if appropriate contains a link to the source of the item .. Find it extremely useful.
This sounds like what I want to use.
Could you share your knowledge about this?
I do not get the remark that I am overlooking something.
I want to use the database only (no application), no source control either but something simple and 'handy'. Some people must have done this. And offcourse I could reinvent the wheel, which would be fun. But it would be more efficient to use experience and or an implementation which is allready made. The suggestion of the link to the source of the item is a good suggestion. (Now I include the source within the scripts comment).
I want the solution to be completely selfcontained, for example as you described in a Sandbox DB.
Thanks for your reply
Ben Brugman
October 5, 2012 at 8:16 am
ben.brugman (10/5/2012)
bitbucket-25253 (10/5/2012)
I have what I call a sandbox DB to hold scripts, some T-SQL and have it set up so as to be able to search by key words, for example 'openrowset'. In many, the table that is searched also if appropriate contains a link to the source of the item .. Find it extremely useful.This sounds like what I want to use.
Could you share your knowledge about this?
I do not get the remark that I am overlooking something.
I want to use the database only (no application), no source control either but something simple and 'handy'. Some people must have done this. And offcourse I could reinvent the wheel, which would be fun. But it would be more efficient to use experience and or an implementation which is allready made. The suggestion of the link to the source of the item is a good suggestion. (Now I include the source within the scripts comment).
I want the solution to be completely selfcontained, for example as you described in a Sandbox DB.
Thanks for your reply
Ben Brugman
I use one called codebox. It works well enough and uses sql server as the backend. It has a treeview to help organize stuff by category and whatnot. I find something like that far easier than having to query the database to find queries. It is very simple and quite handy. I have been meaning to write my own version of it for a few years but never seem to find the time to get it done.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
October 5, 2012 at 12:38 pm
Sean Lange (10/5/2012)
ben.brugman (10/5/2012)
bitbucket-25253 (10/5/2012)
I have what I call a sandbox DB to hold scripts, some T-SQL and have it set up so as to be able to search by key words, for example 'openrowset'. In many, the table that is searched also if appropriate contains a link to the source of the item .. Find it extremely useful.This sounds like what I want to use.
Could you share your knowledge about this?
I do not get the remark that I am overlooking something.
I want to use the database only (no application), no source control either but something simple and 'handy'. Some people must have done this. And offcourse I could reinvent the wheel, which would be fun. But it would be more efficient to use experience and or an implementation which is allready made. The suggestion of the link to the source of the item is a good suggestion. (Now I include the source within the scripts comment).
I want the solution to be completely selfcontained, for example as you described in a Sandbox DB.
Thanks for your reply
Ben Brugman
I use one called codebox. It works well enough and uses sql server as the backend. It has a treeview to help organize stuff by category and whatnot. I find something like that far easier than having to query the database to find queries. It is very simple and quite handy. I have been meaning to write my own version of it for a few years but never seem to find the time to get it done.
Care to post a link to codebox... would be appreciated ... my Sandbox DB was constructed when I was first introduced to SQL Server and that is way, way back when the current version was 6.0.. never got around to truly updating / rebuilding my Sandbox, and maybe your posting of the link might be the final nudge I need to get off my lazy butt and get modern.
October 5, 2012 at 1:01 pm
bitbucket-25253 (10/5/2012)
Sean Lange (10/5/2012)
ben.brugman (10/5/2012)
bitbucket-25253 (10/5/2012)
I have what I call a sandbox DB to hold scripts, some T-SQL and have it set up so as to be able to search by key words, for example 'openrowset'. In many, the table that is searched also if appropriate contains a link to the source of the item .. Find it extremely useful.This sounds like what I want to use.
Could you share your knowledge about this?
I do not get the remark that I am overlooking something.
I want to use the database only (no application), no source control either but something simple and 'handy'. Some people must have done this. And offcourse I could reinvent the wheel, which would be fun. But it would be more efficient to use experience and or an implementation which is allready made. The suggestion of the link to the source of the item is a good suggestion. (Now I include the source within the scripts comment).
I want the solution to be completely selfcontained, for example as you described in a Sandbox DB.
Thanks for your reply
Ben Brugman
I use one called codebox. It works well enough and uses sql server as the backend. It has a treeview to help organize stuff by category and whatnot. I find something like that far easier than having to query the database to find queries. It is very simple and quite handy. I have been meaning to write my own version of it for a few years but never seem to find the time to get it done.
Care to post a link to codebox... would be appreciated ... my Sandbox DB was constructed when I was first introduced to SQL Server and that is way, way back when the current version was 6.0.. never got around to truly updating / rebuilding my Sandbox, and maybe your posting of the link might be the final nudge I need to get off my lazy butt and get modern.
WOW I have had this app for a long time!!!! I just clicked Help -> About and went to their website. I am quite glad that HR was nowhere around. :blush: I am guessing the site is no longer around. I will see if I can find the installer somewhere.
I attached a screen shot so you can get a general feel of this. It is by no means what I would call modern, I have had it for quite a few years. It does do a decent job of organizing tons and tons of scripts. Maybe this is the push I need to rewrite this thing as a webapp. I can post their db but if I were doing this myself it wouldn't look the same.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply