ssms

Is there any way to view whitespace in the query editor for SQL Server Management Studio Express 2005?

无人久伴 提交于 2019-12-17 23:08:40
问题 I have it enabled in Visual Studio 2008, but I'd really like to enable this feature in SQL Server Management Studio 2005 Express. Does anyone know if its possible? Maybe in a later version? EDIT: Sorry, I meant specifically in the text/query editor. 回答1: In case you still need to know how to do this. Edit the Registry Key in HKEY_CURRENT_USER : Software\Microsoft\Microsoft SQL Server\xx\Tools\Shell\Text Editor\Visible Whitespace Where xx is the version you have (90 is 2005, 100 is 2008) And

Saving results with headers in Sql Server Management Studio

时光怂恿深爱的人放手 提交于 2019-12-17 22:08:44
问题 I am using SQL Server Management Studio. I wish to save the results of a query to an excel file. I choose "save as" and then save to CSV file which I can open in excel. All good except I am missing column headers, any ideas how I get them exported? 回答1: Tools > Options > Query Results > SQL Server > Results to Text (or Grid if you want) > Include columns headers in the result set You might need to close and reopen SSMS after changing this option. On the SQL Editor Toolbar you can select save

SQL Server Management Studio, how to get execution time down to milliseconds

本小妞迷上赌 提交于 2019-12-17 17:23:42
问题 When I submit a batch (e.g., perform a query) in SSMS, I see the time it took to execute in the status bar. Is it possible to configure SSMS to show the query time with millisecond resolution? Here is the bar I am talking about with the section of interest circled in red: 回答1: I was struggling with that until i found this... http://blog.sqlauthority.com/2009/10/01/sql-server-sql-server-management-studio-and-client-statistics/ Also, if you open the Properties window you may find some magical

How to export all data from table to an insertable sql format?

蓝咒 提交于 2019-12-17 17:19:12
问题 I have a Table (call it A_table ) in a database (call it A_db ) in Microsoft SQL Server Management Studio, and there are 10 rows. I have another database (call it B_db ), and it has a Table (call it B_table ), which has the same column settings as A_table has. But the B_table is empty. What I want: Copy every rows from A_table to B_table . Is there any option in Microsoft SQL Server Management Studio 2012 , to create an insert SQL from a table? Or is there any other option to do that? 回答1:

Auto-increment primary key in SQL tables

ぃ、小莉子 提交于 2019-12-17 15:39:15
问题 Using Sql Express Management Studio 2008 GUI (not with coding), how can I make a primary key auto-incremented? Let me explain: there is a table which has a column named "id" and the items of this column are set to be primary keys. I want to make this column auto-incremented, but how? Cheers 回答1: Presumably you are in the design of the table. If not: right click the table name - " Design ". Click the required column. In " Column properties " (at the bottom), scroll to the " Identity

How to get export output in “real” CSV format in SQL Server Management Studio?

◇◆丶佛笑我妖孽 提交于 2019-12-17 15:26:40
问题 I have a query that I am running in SQL Server Management Studio (connecting to a SQL Server 2005 database). I want to export the data in CSV format. Not wannabe CSV format, where you just stick a comma between each column, but "real" CSV format, where you put quotes around your strings. This way you can export data that has commas or quotes in it. All the examples I see limit themselves to the wannabe format. I can't figure out where the option to quote strings is. If SSMS is truly incapable

Restrict varchar() column to specific values?

和自甴很熟 提交于 2019-12-17 10:15:34
问题 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? 回答1: 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

Saving changes after table edit in SQL Server Management Studio

限于喜欢 提交于 2019-12-17 05:32:05
问题 If I want to save any changes in a table, previously saved in SQL Server Management Studio (no data in table present) I get an error message: Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created. What can prevent the table to be easily edited? Or, is it the usual way for SQL Server

sql runs fast in ssms slow in asp.net

纵然是瞬间 提交于 2019-12-17 03:41:10
问题 I have been having this problem for a couple of weeks now. The problem is that the query takes 4-5 minutes to run on the website and at most 2 or 3 seconds to run in ssms. Also I found that after I make a change to this query like adding the customerId variable it will start running quickly on the web page but by the next day it is slow again. The query in question is this one: DECLARE @customerID INT SET @customerID = @CustID DECLARE @MyTable table( Iden int NOT NULL IDENTITY(1,1), ProductID

sql runs fast in ssms slow in asp.net

倖福魔咒の 提交于 2019-12-17 03:40:32
问题 I have been having this problem for a couple of weeks now. The problem is that the query takes 4-5 minutes to run on the website and at most 2 or 3 seconds to run in ssms. Also I found that after I make a change to this query like adding the customerId variable it will start running quickly on the web page but by the next day it is slow again. The query in question is this one: DECLARE @customerID INT SET @customerID = @CustID DECLARE @MyTable table( Iden int NOT NULL IDENTITY(1,1), ProductID