Is there a way in SQL SERVER MANAGEMENT STUDIO to highlight all usage of variables when we click on a variable name?
It might not work in all cases, but I find that using the F2 button, which on my machine is mapped to 'View.EditLabel'. It allows me to highlight all of one 'type' things like aliases, variable names and others. Not perfect, but fits my purpose.
I still stand by the fact that it might not be perfect, but it does do what the original poster asked. If you want to see what this command is mapped to see the Options windows.
In the last version of SSMS (currently version 17.1), select the text and type CTRL + F .
No, there's not such feature on SSMS
This has been added in SSMS 2016.
Available for download from https://msdn.microsoft.com/en-us/library/mt238290.aspx
Related
How do I stop Visual Studion 2017 form auto-formatting my T-SQL code and changing the case of keywords, functions, etc? I want to keep the code exactly as I type it. The only relevant option I see is under Editor - SQL Server Tools - IntelliSense - Casing for built-in functrion names, which does not seem to do anything (I changed it to Lower case, restarted the IDE, but it still converts them to upper case). I did not find anything relevant under the T-SQL90 and U-SQL, and I do not see any other T-SQL specific settings (I'd expect something like Transact-SQL, but there is no such option). Any idea?
Here is the first place which can't be easily found without using the search bar. Also, it's not language specific either unfortunately.
Search for 'format' and turn off 'format as you type' option
Here is the 2nd place I'm aware of
Search for 'pretty' and turn off reformatting
Hope this is helpful -- if you find a SQL specific way to avoid the annoyance please post a response to my answer.
I use version control and some of my team use Toad, others use SQL Developer. Is there someway to align the two formats?
The reason being that when you compare the versions most of the changes are due to formatting.
In Toad, you use Ctrl + Shift + F
In SQL Developer, you use Ctrl + F7
In SQL Developer it has some other formatting, but nothing for Toad which uses QP5 (Quest Parser Version 5)
You can change how SQL Developer formats your code; from the menu go to:
Tools->Preferences->Code Editor->Format.
Go into Advanced Formatting to configure alignment, line breaks. whitespace etc.
Toad presumably has similar options. You just need to set them up the same, which may need a bit of trial and error to get right.
My colleagues using TOAD has a nice feature of a shortcut to queries. For example, they write get_customer_info and the word is replaced by a full joined query. This feature is very nice for productivity. My machine is not licensed to Toad and I use Oracle SQL developer. I wasn't lucky enough to find this feature. I wonder if it has this feature in the first place?
SQLDeveloper has code templates for commonly used statements (see Tools > Preferences > Database > SQL Editor Code templates ). Then there are Snippets ( View > Snippets ) that can be dragged to existing code in the worksheet. It has also some built-in constructs (FOR, IF, etc.) that can be called with CTRL+SPACE if you start typing the statement. You could technically imitate TOADs behavior with the code templates and create templates for statements that you use often. I'm not sure if this even compares to TOADs capabilities, but that's pretty much all you have available in SQLDeveloper.
You may do this by editing Code Template.xml file in the following location:
C:\Users\username\AppData\Roaming\SQL Developer
Add/Edit the file to write convenient shortcut:
<row>
<key>upt</key>
<value>UPDATE table_name SET col_name='val' WHERE col_name='val';
</value>
</row>
[Please restart your sql developer after edit this file.]
I am using Eclipse 3.6.1 Build id: M20100909-0800 and Aptana Studio 2.0.5 which is based on Eclipse 3.5.2 (both on OS X) and in both programs the external tools feature seems to swallow double quotes and whitespace for the ${selected_text} variable.
Isn't the ${selected_text} variable essentially useless with the mentioned behaviour?
Is there a way around that or maybe a hidden setting somewhere?
Thanks for reading.
This could easily be considered a safety/security feature.
I suggest "${selected_text}".
...but if it's eating ALL whitespace, that won't really help. Huh. Maybe it's clever enough to detect the quotes and preserve the whitespace... but probably not.
Okay, I did a little poking around. Quotes within the argument list itself are preserved, as per my initial suggestion above. I found the following auto-generated argument list that was working Just Fine:
-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog
-debug "${workspace_loc:/com.cardiff.bpm.ide.webforms.ui/debug.options}"
But if your text selection contains quotes, I'd expect it to be handled as per the underlying OS. Windows "cmd" does some... creative things with them for example. My *nix-fu is Not Mighty, so I couldn't tell you what OS X will do under the covers, but I suspect that's where you'll find your solution.
You may have to do something goofy like URL-encode your selection, and use some command line tool to un-encode it before passing it to your desired external tool once the text is out of Eclipse's clutches.
A (very) quick look around my 3.6.1 UI didn't turn up that would do this automagically for you, but there's probably a plugin out there somewhere that'll add that feature to an editor's context (right click) menu.
I'd expect the HTML editor to have this ability already... but I don't see anything other than "smart insert mode" that sounds promising, and I don't see that working either.
That doth bloweth goats, most heartily, yay for weeks on end. E'en till yon goat hath a rash, most unpleasant in both severity and locality. Verily.
I don't think you're getting my proposed solution:
Set up your tool so it'll de-url-encode-ificate the incoming string with some proposed command line tool.
In your editor (in eclipse), URL-encode the text you wish to select and pass to the tool. Manually.
Run the tool on the selected (url-encoded) text.
Revert the selected text. Also manually. Probably just "undo".
"1" is why I was looking for some eclipse UI way of url-encoding a selection. The HTML Editor won't even do it when you paste into an attribute string. Sheesh.
Two Other Options:
Fix the bug yourself. Open Source and all that.
Write a plugin that exposes it's own version of ${selected_text} that doesn't strip out all the strings.
Hey! SED! Replace the quotes with some random (unused in any selection you might make) high-ascii character and sed it back to a double quote instead of the proposed de-url-encode-ificationizer. You'd still have to manually edit/undo the text, but at least you won't have to """ Actually search/replace over a given selection makes that less painful than one might think.
I'm not sure what the scope of #2 is, but I'd image if you don't have any eclipse plugin experience the thought might be rather daunting. There might even be a sample plugin that exposes such a variable, though I haven't checked.
I don't think we're communicating.
You don't select text with quotes in it. You select mangled text, and sed demangles it back into quotes for you.
For example, you have the string print("hello world"); in your editor and want to send that to your tool.
change it to print(~hello world~); in your editor. Manually or via a script or whatever.
select it
run your tool, maybe wrapped in a script that'll sed the ~s back to "s.
change it back to print("hello world");.
This is a manual process. It's not pretty. Bug workarounds are like that. You can probably come up with a monkey script to convert quotes to Something Else, and "undo" is easy. You might even be able to get your script attached to a keyboard short cut... dunno. And ~ is a lousy choice for a replacement character, it's just the first thing I could think of that was rare enough to be a decent example.
Are we communicating yet?
For the record, I put together a patch using some guidance from a gentleman in the bug comments.
I don't know if it will be accepted, but it fixes things for me so maybe someone else may find it useful.
Again, this is only for Mac OS X Eclipse.
Start Eclipse.
Go to Import > Plug-ins and Fragments.
Import From: Active Platform
Fragments to import: Select from all plug-ins
Import As: Projects from a repository
Next >
Pick org.eclipse.debug.ui and org.eclipse.debug.core
Once the projects are in your workspace, apply the two patches that compose proposed patch v1, found at the bug tracker page for bug 255619
Go to Export > Deployable plug-ins and fragments and make a jar out of your changed packages.
Hope it helps.
Is there any diff tool for Lotus Notes which allows to compare scripts, design elements and documents?
I see this is an old question, and most of the other answers are a little outdated now, so I thought I would add some hopefully valuable information for those who should stumble upon this now.
In Domino Designer, open either the Navigator or Package Explorer (Window menu -> Show Eclipse Views). Here you can expand databases/templates to see the design elements they contain. Select two or three elements (CTRL-click). They can be in different databases or the same database. Right click on one of the elements and select Compare with -> Each other.
You can also compare two databases element by element by selecting two databases/templates, right-clicking and selecting Compare with -> Each other. You will then get the differences between the two databases listed. You will be able to see which elements differ between the two databases, and which elements exist in one database but not the other. By double-clicking on a differing element, you will open a diff tool which lets you see differences line by line, and you can easily copy changes from left to right or right to left.
There is a tool from TeamStudio called Delta: http://www.teamstudio.com/products/delta.html
If all else fails (and by "all else" I mean the often ridiculous corporate procurement system) you can always do a an export to DXL (or a Design Synopsis for code alone) and use any decent text editor with a diff function. It's not TeamStudio Delta, but it will get you where you want to go.
There is a free tool from OpenNTF which does document comparisons:
http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/Compare%20Notes%20Documents
Ytria also has a product which, among other things, will compare data documents (I don't believe it compares design elements).
http://www.ytria.com/website.nsf/WebPageRequest/Solutions_scanEZ_specen
And, I believe Martin Scott (http://www.martinscott.com) has a similar product which compares documents.
DDE (Domino Designer on Eclipse) let's you compare design elements natively. Same way as the search. It's pretty efficient (faster than a DXL exportation) and it's free.
I had a discussion on my blog a little while back about this:
http://rosshawkins.net/archive/2009/12/24/notesdomino-refactoringanalysis-tools.aspx
However what I've ended up doing in the past is exporting the design to the filesystem and using standard text tools (WinMerge and SublimeText for me personally) to do what I need.
Being able to do the raw dump is something that was added with the Eclipse based designer, and isn't overly obvious, but you can read more about it here:
rosshawkins.net/archive/2010/01/20/searching-the-contents-of-notesdomino-design-elements.aspx
(link mangled as my rep is too low to post 2 links in one post yet!)
Teamstudio Delta is really nice. However it might kill you with too many details. As Ross pointed out the Domino Designer 8.5 can use the Diff tool inherited from Eclipse. You also could head over to http://www.openntf.org and look for the DXLMagic project. It can generate a report that shows differences (including code) between 2 databases (typically a template and a variation of it). It is not as complete as Delta, but shows the essentials. It's free and source is included (Disclaimer: I wrote it).
This is what I do. I run a design synopsis of the database using the Notes Designer. Dump the file to a text file. You can actually split the synopsis out to different objects like Agents, Forms, Views, etc. Then you can run UNIX/Linux/Mac Unix commands to compare the elements. By doing this operation you find out what code is active, and have a complete documented source code. You do a lot of csplit and a few sed commands.
Version 12.0.1 has such a tool as part of the server. Look for comparedbs.ntf and designsynopsis.ntf on the Domino server.