I use SSMS 2012 with IntelliSense and it is usually fine. However, yesterday, the "complete word" function has turned itself on and is forcing my code to change according to what it wants.
For example, if I'm writing a multi table script and I know my first table will have an alias of "a", I will start by writing
Select a.*
But now, as soon as I hit the full stop button, the a changes to ABS
Select ABS.*
I like having IntelliSense on as I do use it, but I am not used to it overwriting what I type. I can't see any options to change this in the IntelliSense part of the Transact-SQL options.
Can anyone help, please?
Edit: I got a fresh install of SSMS2014 and am fine now, but in case anyone can answer this, it would be a handy resource for others.
Related
I have a SQL Server CLR trigger project that was created in VS2008. Opening the project in VS2012 does not present any problem, but on build of the solution, I get SQL71501 errors, with Trigger: [...] has an unresolved reference to object [...].
Based on my reading, this is due to a missing database reference in the project. When I try to add a database reference, I get the Add Database Reference dialog that gives me three options:
Database projects in the current solution ** this option is grayed out/disabled
System database (only shows system DBs)
Data-tier Application (.dacpac) ** there are no options to select as this was not how I created the project.
Further reading suggested that the reason there are no database projects to select for the first option, is because no Data Connections have been added via the Server Explorer. In my case there are certainly Data Connections present, and while my project is open, I can quite happily browse the database, look at data etc.
I thought it might have something to do with the Target Framework, so I have tried targeting 3.5 and even 2, but the same problem occurs.
I feel like I'm missing something fundamental, but just can't quite work it out. Any help would be GREATLY appreciated.
I've seen this dialog not enable the 'OK' button because the Database Variable that it defaults is invalid (in my case it had a '.' in it).
The clue to this being the error is that the text in the 'Example Usage' field contains the error message - it's just hard to see as it's dark grey on light grey.
Editing the Database Variable name fixes this.
I found a workarroud for this, isn't optimal but at least it works:
try this
- open sql server object explorer
- create a new connection to your server
- right click on the database and select create new the project...
- the wizard will create the project with all the references and connection string attached to it.
cheers!
I changed my answer
The problem is you cannot assume an insert is a single row and you can really only reference the primary key as a single value inside the trigger
Hi guys i need help with something really trivial about the query window in SQL 2008.
When I write a command and/or declare a variable I want the pop up help like the one in VS2010
to appear like when you write string you just need to type s and scroll down in VS.
I hope I was clear if I was not then please point it out and I'll try to re-write my question
sens I don't know what this help pop up is called I don't really know what to search for.
Why is IntelliSense not working? 3 possible reasons:
1 The object is not in the local IntelliSense cache, since it was created recently. You can fix this easily by going to Edit > IntelliSense > Refresh Local Cache, or CTRL+SHIFT+R.
2 The query window is connected to a downlevel server (e.g. SQL Server 2005), where IntelliSense does not function
3 Maybe you need to install SQL 2008 R2 Service Pack 1 according to here
In SQL Server 2008 Management studio, I can hit F5 to execute everything in the current query window. I can also highlight a query, and hit F5 to run that highlighted query.
Instead of having to highlight a query, is there a way I can run the single query my cursor is on, or run a query my cursor is on up to a the first ';'?
In options you can configure line numbers to be displayed, then you can just click on a line number, which will highlight the whole line.
Unfortunately no there is no such keyboard shortcut in the MSDN list of keyboard shortcuts for SMSS, and I don't see any way of recording a macro to do so. The only solutions I've found require creating an add-in which is quite a bit of work for a little savings.
Install SQL Complete Express. Its an SSMS plugin that free (also a paid version) and it allows using CTRL+SHIFT+E to execute current statement, I have remapped it to F9 as I use Toad frequently too.
I tried several others but they either didn't work with SSMS 2012 or I just didn't get on with them.
I find the intellisense quicker than the built in version to.
If you are able to use SSMS 2012 then you can use the SSMS Executor add in as mentioned by st-stoqnov in his answer to a similar question.
An Alpha release is also available for SSMS 2014/2016/2017.
In SQL after concluding a statement and as along as your cursor is at the end of the line all you have to do it hit SHIFT+HOME and it will highlight the entire statement and you can then proceed to press f5....
For keyboard users:
I found going down with the cursor to the end of the query line, or the line bellow if it is empty, and then using "SHIFT + arrow up" to select the full query. After selection hit f5
The new SQL Prompt has this feature. You press SHIFT+F5 and the statement that your cursor is currently on will be executed. That's a big time saver and a feature that should have been there from the start in the first place.
I just installed Devart's Sql complete express that is free of charge. With ctrl-shift-e it does what you want.
Now I just need to swap, to make ctrl-e execute current and ctrl-shift-e everything...
I cannot use the Ctrl+F and Ctrl+H in my SQL Management studio. Even if I use the menu items it doesn't work. Haven't installed anything new or changed anything recently. Any ideas?
Have you recently used multi-monitor? Is it possible that it is opening off-screen? I get this problem a lot when disconnecting my laptop from an external monitor...
(edit) There is a Window -> Reset Window Layout menu option in SSMS 2008, that should fix it.
Perfect! multi-monitor causes this.. Just minimize VS. Put to the other monitor.
You'll see opened window when you Ctrl+F
Irina
I currently have this issue also, I am using two monitors but this appears not to be the cause. I say this as the instance of management studio that I have open has two queries - both are connected to the same Server and Instance. On one query, Ctrl+F works fine, on the other query it won't work at all.
I think this is in some way related to debugging - the query which does not allow Ctrl+F currently I mistakenly debugged (as opposed to running) and after this the find/find replace functionality does not work!
Would you recommend me the best approach to edit SQL query with Visual Studio 2008 Professional, please?
I know I can open Query window from context menu in Server Explorer and edit text in SQL Pane. But unfortunately I am not allowed to save query to a file and Find and Replace commands are not working there.
Alternatively I can open text file with extension .SQL in Visual Studio editor obtaining syntax highlighting and full editing capabilities but losing possibility to execute the script.
Now I copy query text from one window to another and back but I hope there is better solution.
Many thanks for suggestions!
When I have to connect to Sql Server, I use NetBeans, as it has a number of features that make it much easier to use than Visual Studio. One of these is intellisense, which is very useful when you have an alias for a table name and lots of long field names. The general handling of connections and connection pools is also much cleaner in NetBeans. I could go on, but suggest trying it for yourself. You will almost certainly need the Sql Server jdbc driver, which can be downloaded from http://msdn.microsoft.com/en-us/data/aa937724.aspx
If you create a Database project within your solution in Visual Studio, then you can set up a default database connection for that project. Then any *.sql files that are included in the database project can be executed against that connection. What I usually do is select the text to be exectued and right-click it, then select "Run Selection".
You can set up any number of database connections under the "Database References" node in the solution explorer, and choose the one you want to run your query against.
Wow you are right, this is a real pain. Would it be acceptable for you to use a local copy of the SQL Management Studio (the name might be wrong)? You would be outside of VS but you could still edit your query and run it at the same time. Definitely not optimal but better than nothing.
Good luck.