Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Controversial: SQL

Controversial: SQL

Scheduled Pinned Locked Moved The Lounge
database
76 Posts 34 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A AndrewGT

    Why not store them in a database? You could use SQL to find the best match... :)

    R Offline
    R Offline
    raddevus
    wrote on last edited by
    #52

    Other Dev: What'cha doing? Me: Writing a SQL query to find a SQL query that I can use in this project. :rolleyes:

    1 Reply Last reply
    0
    • R raddevus

      I don't hate Java, actually. I really like Java as a language. Also, this sounds like the kind of thing that I was thinking might be going on out there -- custom solutions that help you design sql queries and manage them(for devs). :thumbsup:

      E Offline
      E Offline
      ElectronProgrammer
      wrote on last edited by
      #53

      I meant that you would hate the methodology of writing SQL using another language, not the language itself, since it is more work initially. You have to break the SQL code into pieces to insert variables in between, write the program code and document it. Most of the times I mention this methodology people look at me as if I just told them to program everything in assembly! I use Java for this since it is very easy to convert to a servlet and have the interface on a web page, although I prefer to use the command line. My knowledge of web technologies is limited and all my pages end up looking like :doh:

      1 Reply Last reply
      0
      • R raddevus

        There is no good way to store good SQL queries for future use. Just, no good way. :rolleyes:

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #54

        What, can't you just ask the computer "give me this data" and it writes the SQL query for you? "Hello, computer." "Use the keyboard? How archaic!" I hope y'all know what movie I'm quoting. ;)

        Latest Articles:
        Thread Safe Quantized Temporal Frame Ring Buffer

        R 1 Reply Last reply
        0
        • R raddevus

          There is no good way to store good SQL queries for future use. Just, no good way. :rolleyes:

          M Offline
          M Offline
          Matt McGuire
          wrote on last edited by
          #55

          evernote or onenote since they allow for naming sub tabs, I can categorize them, make it a little faster to search

          R 1 Reply Last reply
          0
          • R raddevus

            There is no good way to store good SQL queries for future use. Just, no good way. :rolleyes:

            M Offline
            M Offline
            MSBassSinger
            wrote on last edited by
            #56

            I use a private GitHub repo, and use Agent Ransack on my local laptop to find specific files by key words or phrases.

            R 1 Reply Last reply
            0
            • R raddevus

              There is no good way to store good SQL queries for future use. Just, no good way. :rolleyes:

              C Offline
              C Offline
              cwjinc
              wrote on last edited by
              #57

              Create views with meaningful names? Isn't that what views are for?

              R 1 Reply Last reply
              0
              • R raddevus

                There is no good way to store good SQL queries for future use. Just, no good way. :rolleyes:

                C Offline
                C Offline
                Choroid
                wrote on last edited by
                #58

                I wrote a little program called Code Vault it lets me name the snippet of code with a date saved and the code It is searchable from experience it needs a one character field where you enter C for create or U for Update need to rewrite it as it is in VB 6 Just a suggestion

                R 1 Reply Last reply
                0
                • R raddevus

                  There is no good way to store good SQL queries for future use. Just, no good way. :rolleyes:

                  U Offline
                  U Offline
                  User 10911256
                  wrote on last edited by
                  #59

                  Why use text files? A database can store strings. So if you want searchable storage of queries why not make a table?

                  R 1 Reply Last reply
                  0
                  • M Marc Clifton

                    What, can't you just ask the computer "give me this data" and it writes the SQL query for you? "Hello, computer." "Use the keyboard? How archaic!" I hope y'all know what movie I'm quoting. ;)

                    Latest Articles:
                    Thread Safe Quantized Temporal Frame Ring Buffer

                    R Offline
                    R Offline
                    raddevus
                    wrote on last edited by
                    #60

                    Marc Clifton wrote:

                    can't you just ask the computer "give me this data" and it writes the SQL query for you?

                    I know. It's quite annoying that I can't. Even Google Home (assistant) won't just tell me answers a lot of the time.

                    Marc Clifton wrote:

                    I hope y'all know what movie I'm quoting.

                    I tried DuckDuckGo and got nothing for those quotes. Maybe, War Games with Matthew Broderick? Or maybe Star Trek..."Computer...what is our heading?"

                    1 Reply Last reply
                    0
                    • M Matt McGuire

                      evernote or onenote since they allow for naming sub tabs, I can categorize them, make it a little faster to search

                      R Offline
                      R Offline
                      raddevus
                      wrote on last edited by
                      #61

                      Matt McGuire wrote:

                      evernote or onenote since they allow for naming sub tabs, I can categorize them, make it a little faster to search

                      That's an interesting one. I think whatever organization system a dev finds that works for him/her is good. And most people in this thread have said this is basically what they do or just put them all in a text file. These methods just feel like only one step above keeping them in a plastic binder. :laugh: I wish there was a way to really categorize, organize, digitize and systematize the whole situation. But, I'm lazy and slow and I forget SQL all the time (because it is so forgetable). :laugh:

                      M 1 Reply Last reply
                      0
                      • R raddevus

                        There is no good way to store good SQL queries for future use. Just, no good way. :rolleyes:

                        M Offline
                        M Offline
                        Mark Starr
                        wrote on last edited by
                        #62

                        So, it depends on which interface you're using. If you're using Management Studio you can save frequently-used queries in 2 places (I've used both over the years): 1) Create a 'Project' (File / New / Project / SQL Server Scripts) and save .SQL files into that project. Kinda clunky for organization, but workable. I used this method as a default, and used file naming for file sorting and commented keywords for searches. Sometimes you have to open the project file and manually rearrange the file references. 2) use the Code Snippets Manager (Tools / Code Snippet Manager) You can create your own Groups and add scripts to existing or new Groups. pretty handy, a little clunky, but it works. I used this area for some very-frequently-used utility scripts. If this info is coming to you late, well - I read your thread early this morning, but didn't get to my computer till now. Take it for what its worth. Cheers,

                        Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                        M R 2 Replies Last reply
                        0
                        • M MSBassSinger

                          I use a private GitHub repo, and use Agent Ransack on my local laptop to find specific files by key words or phrases.

                          R Offline
                          R Offline
                          raddevus
                          wrote on last edited by
                          #63

                          MSBassSinger wrote:

                          I use a private GitHub repo, and use Agent Ransack on my local laptop to find specific files by key words or phrases.

                          That's a good combination. Easy to get to from anywhere on the Internet and also you can search them. I'm going to have to look into this agent ransack thing, but the word "ransack" has really put me off it. Many here have mentioned agent ransack.

                          1 Reply Last reply
                          0
                          • M Mark Starr

                            So, it depends on which interface you're using. If you're using Management Studio you can save frequently-used queries in 2 places (I've used both over the years): 1) Create a 'Project' (File / New / Project / SQL Server Scripts) and save .SQL files into that project. Kinda clunky for organization, but workable. I used this method as a default, and used file naming for file sorting and commented keywords for searches. Sometimes you have to open the project file and manually rearrange the file references. 2) use the Code Snippets Manager (Tools / Code Snippet Manager) You can create your own Groups and add scripts to existing or new Groups. pretty handy, a little clunky, but it works. I used this area for some very-frequently-used utility scripts. If this info is coming to you late, well - I read your thread early this morning, but didn't get to my computer till now. Take it for what its worth. Cheers,

                            Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                            M Offline
                            M Offline
                            Mark Starr
                            wrote on last edited by
                            #64

                            Oh, by the way: if you use Option 1 (SQL files and SQL Project) you can use version control so as to not lose files or their contents.

                            Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                            1 Reply Last reply
                            0
                            • C cwjinc

                              Create views with meaningful names? Isn't that what views are for?

                              R Offline
                              R Offline
                              raddevus
                              wrote on last edited by
                              #65

                              That's a good thing. I'm more talking about a way to get to old SQL queries / Stored Procs (SP) I've written in past to solve problems which I can use again to solve new problems --- after slightly altering them. I'm talking about query design and SP creation and managing these old queries I have worked through to get to the answer. I often create some cool query and then 3 years from now I totally forget how i did it.

                              C 1 Reply Last reply
                              0
                              • C Choroid

                                I wrote a little program called Code Vault it lets me name the snippet of code with a date saved and the code It is searchable from experience it needs a one character field where you enter C for create or U for Update need to rewrite it as it is in VB 6 Just a suggestion

                                R Offline
                                R Offline
                                raddevus
                                wrote on last edited by
                                #66

                                Yeah a SQL-Vault is the type of thing I'm talking about. It would be nice.

                                C 1 Reply Last reply
                                0
                                • U User 10911256

                                  Why use text files? A database can store strings. So if you want searchable storage of queries why not make a table?

                                  R Offline
                                  R Offline
                                  raddevus
                                  wrote on last edited by
                                  #67

                                  Yes, I'll query the database for the query that I need so I can query the database. :laugh: You are correct though. I'm thinking more of a SQL-Manager that allows me to file away SQL queries with a good summary of what it does and keywords for finding.

                                  U 1 Reply Last reply
                                  0
                                  • M Mark Starr

                                    So, it depends on which interface you're using. If you're using Management Studio you can save frequently-used queries in 2 places (I've used both over the years): 1) Create a 'Project' (File / New / Project / SQL Server Scripts) and save .SQL files into that project. Kinda clunky for organization, but workable. I used this method as a default, and used file naming for file sorting and commented keywords for searches. Sometimes you have to open the project file and manually rearrange the file references. 2) use the Code Snippets Manager (Tools / Code Snippet Manager) You can create your own Groups and add scripts to existing or new Groups. pretty handy, a little clunky, but it works. I used this area for some very-frequently-used utility scripts. If this info is coming to you late, well - I read your thread early this morning, but didn't get to my computer till now. Take it for what its worth. Cheers,

                                    Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                                    R Offline
                                    R Offline
                                    raddevus
                                    wrote on last edited by
                                    #68

                                    This is good stuff. I will read over this again and try it out. Thanks very much for reading and posting. :thumbsup:

                                    M 1 Reply Last reply
                                    0
                                    • R raddevus

                                      This is good stuff. I will read over this again and try it out. Thanks very much for reading and posting. :thumbsup:

                                      M Offline
                                      M Offline
                                      Mark Starr
                                      wrote on last edited by
                                      #69

                                      Sure. No prob. If you have any questions, please send them.

                                      Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                                      1 Reply Last reply
                                      0
                                      • R raddevus

                                        Yes, I'll query the database for the query that I need so I can query the database. :laugh: You are correct though. I'm thinking more of a SQL-Manager that allows me to file away SQL queries with a good summary of what it does and keywords for finding.

                                        U Offline
                                        U Offline
                                        User 10911256
                                        wrote on last edited by
                                        #70

                                        So you mean a separate database of queries that hold the queries that you can query so you can query the other database? :-D Maybe OneNote is what you want.

                                        1 Reply Last reply
                                        0
                                        • R raddevus

                                          That's a good thing. I'm more talking about a way to get to old SQL queries / Stored Procs (SP) I've written in past to solve problems which I can use again to solve new problems --- after slightly altering them. I'm talking about query design and SP creation and managing these old queries I have worked through to get to the answer. I often create some cool query and then 3 years from now I totally forget how i did it.

                                          C Offline
                                          C Offline
                                          cwjinc
                                          wrote on last edited by
                                          #71

                                          Oh, for that I create sql files and store them on servers with multiple backup avenues. Then I forget where they are and run to the internet to look up ways to solve the problems I can't remember the solutions to. ;)

                                          R 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups