Tag Info

Hot answers tagged

8

Because while you're right that RIGHT() is a function, RIGHT is also a keyword, as in RIGHT OUTER JOIN. They have to pick one (SSMS is not smart enough to detect context). I face the same problem in the syntax highlighting plugin I use for my blogs - it either has to color all instances of RIGHT as grey, or all instances of RIGHT as purple. (Also, if you ...


4

The script is blocked because it cannot obtain exclusive access to the database (technically it is not executing, it is waiting). I think it's in Microsoft's best interests to not allow you to drop a database that is currently being used, so I wouldn't really blame them for making this hard. What you need to do is not only ensure you run your drop from ...


4

This has nothing to do with SQL Server, is just basic Windows authentication. In a workgroup you can only authenticate using NTLM mirrored accounts. Mirrored accounts are local accounts that have identical name and and password on different machines. So to use Windows authentication between a process running on machine A and a process running on machine B, ...


3

Essentially 2014 is configured by Microsoft to use Help Viewer 1.0 so you have to redirect it yourself to use 2.x. There is a post on MSDN social on how to do this here and the handy little tool you need is on CodePlex here. In regards to why it is not finding your documentation when it loads Help 1.0, I am going to assume it is because you have installed ...


3

Well just while your Tuning Advisor displays a missing index, this won't mean, that your current running query would benefit from this index. The missing index will just be displayed if the current plan would take a benefit from an index. You can also take a look at one of these DMV's, they will display missing indices for the current db. SELECT * FROM ...


2

There are several ways to do it. However, this may work for you: select myTable.* from myTable order by (case myCol when 'FIREARMS' then '' else myCol end);


2

atThis is pretty much when bluefeet gave you as an example in the comment. DECLARE @cols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX) select @cols = STUFF((SELECT distinct ',' + QUOTENAME([Status]) from [EVAULTTEST].[dbo].EvidenceItems FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)') ,1,1,'') set ...


2

The paths in the generated script are the locations where the data and log files should be on your laptop. If you copy paste the script to amazon AWS that will be the location where the files are created when you create the database. If that path doesn't exist on the Amazon instance you will get errors. You could comment out the lines and then the files ...


1

One more very simple solution: use notepad++. Inside there is very good plugin called Poor man's sql formatter. The drawback is that you have to paste SQL inside the notepad++. But it is free. There is also a web page, but I did not try it.


1

And, I was wrong. There was a connection open to the database. I thought that switching to "master" and exiting all other queries would close the connections to the database, but I thought wrong. Even though I had just attached the database by the MDF file, generating the script (or something else) created another connection. I used the following commands ...


1

In addition to solutions that are already mentioned, I'd suggest using ApexSQL Refactor - a free SSMS and Visual Studio add-in. ApexSQL Refactor can help you create your own SQL formatting standards. It can be used to distribute and enforce SQL formatting rules among team members. To perform capitalization formatting, it is enough to: Download ApexSQL ...


1

I fixed the same symptoms/issue (which surfaced after I reinstalled the Visual Studio 2010 Isolated Shell, on which SSMS depends as a component) by removing the 2010 Visal Studio Isolated Shell and then repairing SSMS 2014 (download SSMS 2014 SP1 from here):


1

If it's a named instance well, then, you should have always been using localhost\instance. This is how it's supposed to work. You shouldn't have been able to connect before and I suspect there is a vital detail missing that would explain that. Possible explanations (there may be others): the instance was the only one on the machine, and maybe an alias was ...


1

Due to your comments on the main answer, I would write my suggestions below. You described that your neighbor can still connect to the machine but you not. This doesn't seem like a normal behavior of an SQL Server. This just brings me to another conclusion. It seems to be more likely a network error. In fact, you also described that you could connect to the ...


1

I'll venture a guess at what you're looking for. I've made the assumption that the table is called test, the column which contains the entries for FIREARMS, MONEY, etc. is called category, and of course you have your other columns. So, with a simplified table and some data defined as CREATE TABLE test ( id integer, person varchar(30), category ...



Only top voted, non community-wiki answers of a minimum length are eligible