Tag: ssms

Quick way to grant Exec permissions to DB role for many stored procs

Consider the scenario where a database has a SQL Database Role or Application Role. The task is to grant Execute permissions to n stored procedures. When using SQL Management Studio, there’s a nice screen to help apply permissions to objects for a Role. SQL Management Studio http://i26.tinypic.com/2r5g6c3.png Here are the steps to apply permissions: select […]

SQL Server Management Studio won't let me add an index to a table

When I right click on the indexes folder in the table the “New Index” menu item is grayed out. I don’t understand why. I’ve deleted all data in the table just in case, and refreshed and restarted SSMS, but no luck. I’m using SQL Server 2012 Business Intelligence SP1 CTP.

How can I resolve the “Table 'dbo.Foo' already exists.” error when the table does not exist?

I’ve created a table and then realised I made a mistake. SSMS wouldn’t let me update the table without recreating it, so I’ve deleted the table and then tried to create it again. It won’t let me do this, and I get an error dialog Table ‘dbo.Foo’ already exists. So I try to delete it […]

Client Statistics table (Microsoft SQL Server Management Studio)

Is there any way to clear the Client Statistics table in Microsoft SQL Server Management Studio (2008 R2) besides create a new query?

Is there a way to “export” an entire SQL Server database (schema and data) to text?

On a per-object basis, SQL Server Management Studio has the option to script the object to clipboard, file, etc. Is there a way (at the database level) to do a “1-click” export of ddl AND data to a text file? Ideally I’d like to select a database and create a big text file containing the […]

Visual Studio vs. SQL Server Management Studio – Your Pick

Just to preface: I work in a small company that does ASP.NET development and uses SQL Server 2005 for all of our database needs. I was curious as to what were the pros and cons of using Visual Studio or SQL Server Management Studio for our development on the database side (i.e. table creation, stored […]

Why is “close existing connections to destination database” is grayed out on SQL Server 2012 Management Studio?

I am normally using SQL Server 2012 Management Studio to restore a SQL Server database from a “bak” file. I do this by overwriting an existing database. In the “Options” page, there is a check-box labeled “Close existing connections to destination database”, which I mostly check because the target database is always “in use”, even […]

How do I search for a ', ' and replace with ', '<CR><LF> in SQL Server Management Studio's editor

I have a long query that I’d like to replace the , with a carriage return to put all the fields on their own line but I can’t figure out how to do it in the editor. It wont be fool proof, but better than doing it by hand.

SQL Server. How to refresh the intellisense?

Possible Duplicate: Lost the IntelliSense SQL Server 2008 Intellisense problem I’m new to SQL Server, so this is probably an easy fix. In SQL Server 2008 R2, I’ve just imported a new data table and/or renamed fields in an existing table (it happens either way). When I start to write some SQL, the intellisense doesn’t […]

How can I change the look of SQL Server Management Studio based on which database I'm connected to?

I’d like to modify the appearance of the query window in SQL Server Management Studio based on which database I’m currently connected to. For example, using a yellow background for production databases. Is there a way to do this? Is there also a way to change the default color of the query status bar at […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.