ssms

How to remove cached server names from the Connect to Server dialog?

女生的网名这么多〃 提交于 2019-11-27 11:39:05
问题 Or, to put it another way, where is SqlStudio.bin for SQL Server 2012? It doesn't seem to be in the place that would be expected by looking at this other SO question. 回答1: As of SQL Server 2012 you no longer have to go through the hassle of deleting the bin file (which causes other side effects). You should be able to press the Delete key within the MRU list of the Server Name dropdown in the Connect to Server dialog. This is documented in this Connect item and this blog post. To be clear,

How to quickly edit values in table in SQL Server Management Studio?

烂漫一生 提交于 2019-11-27 11:30:55
Aside from context menu -> "Edit Top 200 Rows" from Object Explorer, is there a quick way to open a table in Edit mode where I can just quickly modify the value of a cell? I need to be able to page past the first 200 rows. And I dont want to write "insert" script for every minor tweak I need to do... I don't understand why SMS doesn't offer quick access to a paged table editor (like Navicat). In Mgmt Studio, when you are editing the top 200, you can view the SQL pane - either by right clicking in the grid and choosing Pane->SQL or by the button in the upper left. This will allow you to write a

Find all references to an object in an SQL Server database

浪子不回头ぞ 提交于 2019-11-27 11:28:17
问题 I'm trying to find all references to an object in an SQL Server database. How can I quickly search? SQL Server Management Studio does not seem to do it. I use http://www.red-gate.com/products/SQL_Search/ but I'd like to find the "official" Microsoft solution to this. Is it in another product? For example, when I do a mass search in visual studio, I would like to be able to also find something in all stored procedures. Or maybe I'm not coding this the right way? Carl 回答1: Use: select object

The backend version is not supported to design database diagrams or tables

隐身守侯 提交于 2019-11-27 11:23:57
I'm trying to add a table to my newly created database through SQL Server Management Studio. However I get the error: the backend version is not supported to design database diagrams or tables To see my currently installed versions I clicked about in SSMS and this is what came up: What's wrong here? Gary Walker This is commonly reported as an error due to using the wrong version of SSMS(Sql Server Management Studio). Use the version designed for your database version. You can use the command select @@version to check which version of sql server you are actually using. This version is reported

Decent simple SQL Server client [closed]

﹥>﹥吖頭↗ 提交于 2019-11-27 10:45:45
问题 does anyone know of a very simple SQL Server client tool - that does the same basic functions as Management Studio (i.e. choose a database and run a query - doesn't need an Object Explorer, or anything fancy)? Ideally it would be great to have a single exe or zip file version that I could take around on a USB key - anything to avoid installing the full set of SQL Server client tools all the time 回答1: Mini SQL Query ... https://github.com/paulkohler/minisqlquery Note If you are having errors ,

Restrict varchar() column to specific values?

有些话、适合烂在心里 提交于 2019-11-27 10:42:49
Is there a way to specify, for example 4 distinct values for a varchar column in MS SQL Server 2008? For example, I need a column called Frequency (varchar) that only accepts 'Daily', 'Weekly', 'Monthly', 'Yearly' as possible values Is this possible to set within the SQL Server Management Studio when creating the table? Ashish Gupta Have you already looked at adding a check constraint on that column which would restrict values? Something like: CREATE TABLE SomeTable ( Id int NOT NULL, Frequency varchar(200), CONSTRAINT chk_Frequency CHECK (Frequency IN ('Daily', 'Weekly', 'Monthly', 'Yearly'))

How to generate scripts to recreate table using SQL Server Management Studio [Schema and data]?

不想你离开。 提交于 2019-11-27 10:41:52
问题 I have a table in a local SQL server database. I want to recreate this table in a hosted database. What I want to do is to have a script that when run against the hosted database, this table is recreated with all the data, etc. How do I create this script using SQL Server Management Studio? Thanks. 回答1: 1- Open SQL server Management Studio. 2- Right click on the DB that contains your desired table. 3- Select "Tasks => Generate Scripts...". 4- Follow on the wizard, and choose the objects that

How can I check if an SQL result contains a newline character?

一世执手 提交于 2019-11-27 10:17:17
问题 I have a varchar column that contains the string lol\ncats , however, in SQL Management Studio it shows up as lol cats . How can I check if the \n is there or not? 回答1: SELECT * FROM your_table WHERE your_column LIKE '%' + CHAR(10) + '%' Or... SELECT * FROM your_table WHERE CHARINDEX(CHAR(10), your_column) > 0 回答2: Use char(13) for '\r' and char(10) for '\n' SELECT * FROM your_table WHERE your_column LIKE '%' + CHAR(10) + '%' or SELECT * FROM your_table WHERE your_column LIKE '%' + CHAR(13) +

SQL Server 2008 can't login with newly created user

醉酒当歌 提交于 2019-11-27 10:10:57
I'm using using Windows Vista and I'm having trouble logging in with a newly created user. I open SQL Server Management Studio. I create a new Login by right-clicking on Security->Logins. Check: SQL Server Authentication Login name: tester Password: test Click OK I added this user to User Mapping to my database of choice. Click File -> Connect Object Explorer, select SQL Server Authentication and enter tester/test and click Connect. I get an error: Login failed for user 'tester'. (Microsoft SQL Server, Error: 18456" with Severity = 14 and State = 1. What causes this error and how do I login

How can I display the execution plan for a stored procedure?

烈酒焚心 提交于 2019-11-27 09:46:11
问题 I am able to view the Estimated Execution Plan (Management Studio 9.0) for a query without a problem but when it comes to stored procedures I do not see an easy way to do this without copying the code from the ALTER screen and pasting it into a query window, otherwise it will show the plan for the ALTER and not the procedure. Even after doing this, any inputs are missing and I would need to DECLARE them as such. Is there an easier way to do this on stored procedures? Edit: I just thought of