Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601

    Unanswered: I am sooooo close to configuring SQL Management Studio (SQL-MS) to do what I want

    Using the External Tools item under the Tools menubar, I can create "calls" to custom BAT files where, using utilities like 'sqlcmd', I can do just about anything I want.

    I can also create a custom menubar in SQL-MS and I can associate each of those External Tools "calls" to individual buttons on my custom menubar.

    So, for common activities, I can just push a button and this custom action will be executed while I am sitting in the SQL-MS.

    That is great ! ! !

    Now, one of the features of the External Tools allows me to pass arguments to those called BAT files.

    I'd like to send, to my called BAT file, the currently-selected object on the Summary sheet of the SQL-MS (or the Object Explorer). The External Tools functionality currently has a list of SQL-MS environment supplied values (I'll call them "tokens") centered upon values in the current query window. But I do not see any tokens that refer to the Summary sheet (or the Object Explorer).

    Does anyone know how I might be able to refer to the currently selected object in either the Summary sheet, or the Object Explorer? I would also need the currently selected database and server.

    If I could make those references, I could set-up SQL-MS just the way I want it, without having to be a heavy-duty programmer.

    Any help would be appreciated.

    Thanks.
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Hmmm... That tool was never intended to work quite that way, but I have to give you credit for originality!

    I'm one of those text based creatures, so I can usually highlight a snippet in a result set and be merrily on my way. As you're a GUI based creature, I suspect that you might have to check the "prompt" box and type in the appropriate snippet to get to the same place.

    -PatP

  3. #3
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    You can see from my username, whatever is practical . . .

    As you guessed, I'm not a text person.

    But the fact is that SQL-MS IS a GUI environment and my idea is simply leveraging that interface.

    Think how powerful this idea is for the mid-range user.

    Suppose I regularly bcp data from various databases. I could easily write a universal script which would take as its parameters the ServerName, DatabaseName and TableName and export the data to a file in some default directory.

    If I had "tokens" for those parameters, I would be literally one click away from having that functionality in SQL-MS.

    The reason I was wanting this is I wrote an audit system (I don't like MSSQL's) which would track changes to critical tables. I want to, at a moment's notice, create log tables and install triggers (or remove them). I've parameterized the code so that it can be used against any SQL table. I was looking for a way to add an item on right-clicking when selecting a table from the Object Explorer. I couldn't do that, but found this External Tools methodology. For want of some simple tokens, it would work perfect.

    How do I communicate to Microsoft this simple idea.Do they have a suggestions box?
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    I am not sure, but I think that auditing idea has already been incorporated into SQL 2008. I think it was the CDC schema. Can't remember, it was one slide in a presentation a few months back.

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by PracticalProgram
    How do I communicate to Microsoft this simple idea.Do they have a suggestions box?
    Yes. My boss went to SQLPASS and they showed the top 10 requests for SQL 2008. You know what the top request was? Integration with X-Box! Unbelievable. I thought everyone used the WII nowadays.

    Anyway - it's called connect or sommat:
    https://connect.microsoft.com/SQLServer/feedback/

  6. #6
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    this shows you how to do create addins for SSMS. it's not supported by MS though. you are on your own.

    http://aspalliance.com/1374_Extend_F...ith_Addins.all

    also check this out: http://www.ssmstoolspack.com - the author is a regular on sqlteam.com - he's very nice and would probably be able to answer any questions you have about writing your own plugins.
    Last edited by jezemine; 02-21-08 at 00:13.

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by PracticalProgram
    The reason I was wanting this is I wrote an audit system (I don't like MSSQL's)
    http://thedailywtf.com/Articles/Perls-of-Wisdom.aspx
    George
    Home | Blog

  8. #8
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    jezemine, thanks. Looks like I might, eventually, be able to accomplish this, but I'm not a .NET programmer, not even a VB programmer, and I'm not looking for a solution that involvs me writing thousands of lines of code. What is frustrating is that this ALMOST works in Management Studio, except for the fact that only a couple of tokens are missing. Everything works--they even have tokens already set up, but just not the right ones. When you think about it, you could do, literally, just about ANYTHING that can be done in T-SQL against ANY SQL object, and never have to type again; if these tokens existed. This would be really powerful, for the everyday administrator, and NOT involve programming.

    georgev, thanks. I think you are implying that "I should not re-invent the wheel." Actually, my statement "I don't like MSSQL's" was not precise enough. Actually, my audit needs are highly specialized and MSSQL's auditing would not track the multi-table data states that I need to track.
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  9. #9
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    I don't think there's any way to do what you want without writing some code, or better, getting someone else to do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •