ssms

organize sql server enterprise manager DB Diagram view

As i get more and more tables, using the diagram view becomes harder and harder. is there anyway to have it auto order or sort to align joined tables, etc and avoid having to do it manually ...

Can I do a foreign key lookup while importing data into SQL Server 2005?

Background I have a spreadsheet of data that I'm importing into SQL Server 2005. I'm using the Import Wizard in Management Studio to do this. Problem I'm importing the data into Table A. Table A has a foreign key reference to Table B. My spreadsheet contains a value in Table B and I need the key for that value so I can put it into Ta...

Permissions issue in SSMS: "The SELECT permission was denied on the object 'extended_properties', database 'mssqlsystem_resource', ... Error 229)"

Here’s the simplest repro case possible. Create a brand new database. (I'm using SQL 2005.) Create a login, a SQL user, and a table in the new database (see sample code below). Launch SSMS and open Object Explorer, logging in as the newly-created user. Attempt to open the "Tables" folder in the Object Explorer. The Problem Fails wit...

How to alter SQL in "Edit Top 200 Rows" in SSMS 2008

In SQL Server 2008 Management Studio, when I right click on a database table and choose "Select Top 100 Rows", I can then e.g. easily add a "ORDER BY " statement to the SQL. That works fine. But when I do choose "Edit Top 200 Rows", I don't have the ability to alter the SQL (which makes it hard to find and edit a record just added in th...

Is there a way in SQL Server Management Studio to view field data in a multi-line editable field?

I have a database that I am viewing with SQL Server Management Studio 2008. I right-click on the table and choose edit top 200 rows. I tab over to my "SerializedXML" varchar(max) field that has 100s of lines of data in it but I am only able to move back and forth in it with my cursor in a tiny one-line textbox. I remember there being ...

How does SSMS get the transaction log usage?

When you right-click on database, Reports...Disk Usage, I get a report. Because I have limited permissions, I only get the top portion, which shows "Transaction Log Space Usage" - that number alone could be useful to me. However, later I get error messages about not having permissions to run DBCC showfilestats, and I also definitely don...

Strange behaviour when renaming a column in SQL Server 2008

I need to write some code for renaming a column in SQL Server 2008. When scripting that in Management Studio I got a double renaming : NAME1 ==> TEMPNAME ==> NAME2 BEGIN TRANSACTION GO EXECUTE sp_rename N'dbo.Table_1.columFirstName', N'Tmp_columSecondName_2', 'COLUMN' GO EXECUTE sp_rename N'dbo.Table_1.Tmp_columSecondName_2', N'colum...

Cannot modify maintenance plan in SSMS

I'm running several Maintenance Plans on my SQL Server 2008 SP1 Standard installation. I'm running SQL Server Management Studio on both my development machine and a copy of it on the server. On either box, if I try and modify any of the existing Maintenance Plans or select "New Maintenance Plan...", nothing happens. The only solution th...

SQL Server Management Studio - Shortcut for entering Dates?

In SSMS, when editing a row of data in a table, you can press Ctrl+0 to enter a null in the current cell. Is there any shortcut for entering the current date in a cell? ...

Debugging in SSMS exits without stepping in to code

Hello, I've recently put Windows 7 on my development PC, and I have Visual Studio 2008 Team System Development Edition, and SQL Server Management Studio 2008, and for some reason I can't seem to step in to any SQL code for debugging in SSMS. Before I formatted in favour of Windows 7, I was able to debug on the same two SQL servers I'm ...

Is there a way to hide a schema or at least the aspnet procedures from Sql Server Management Studio's proc list?

I think the question speaks for itself, but I'm sick of scrolling through my procedure list filled with 50 aspnet procedures. Is there a way to hide the dbo schema, or these procedures from the list? Is there a different/equivalent tool that would let me do this? With TOAD, I could open each schema independently - that'd be wonderfu...

Error connecting to all of my SQL servers

I suddenly started getting this error when trying to connect to any of my sql servers (25+) from SSMS on Windows XP. When I left work yesterday everything was working fine, came in this morning, and I started getting this. Tried rebooting my pc but that obviously didn't fix it. My co-workers can all connect just fine. Searched for a solu...

Why isn't SSMS smart when it comes to adding columns?

Whenever I want to add a column to a table it usually goes something like this: Fire up SQL Server Management Studio (SSMS) Select "Design" on the table I want to add the column to Add the new column to the table Save Get an error that SSMS can't save because it would need to drop the table (and it can't because the the table has forei...

Possible to hide columns in a SQL Server Management Studio database diagram?

All of my tables have certain audit columns (CreateDate,CreateBy,UpdateDate,UpdateBy) Since they just take up visual space, is it possible to somehow hide these columns so they do not show up in a database diagram in SSMS or SSMSE? ...

Output not displaying - SQL Server

I have a print statement in a while loop of a stored procedure. The procedure updates around 20,000 records. The print statement should print out the primary key of each record but it does not display in the output window even though the procedure executes entirely and updates all the records. Is there some limit to the amount of data...

SQL Server Create multiple foreign keys

The table contains a PRIMARY KEY column and another column which is FOREIGN KEY. This works fine. When I attempt to add another column as a FOREIGN KEY I get the following message: Link to pic ...

What version control tool can generate this header

This is from a sql script. What tool can generate this? Thanks --USE [MY_TABLE] GO /****** Object: StoredProcedure [dbo].[adminIncExp] Script Date: 03/05/2010 09:14:12 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <...

SSMS 2008 Add-In - Execute Query

I'm loading a sql script up to an SSMS 2008 add-in like so: ' create a new blank document ServiceCache.ScriptFactory.CreateNewBlankScript(Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptType.Sql) ' insert SQL statement to the blank document Dim doc As EnvDTE.TextDocument = CType(Service...

Diaplaying SSMS standard report in your web application

SSMS 2005 & 2008 comes with inbuilt standard reports. How can we display these standard reports inside a asp.net web site? ...

SQL Invalid Object Name 'AddressType'

I am getting the above error in my VS 2008 C# method when I try to invoke the SQL getColumnNames stored procedure from VS. This SP accepts one input parameter, the table name, and works successfully from SSMS. Currently I am selecting the AdventureWorks AddressType table for it to pull the column names from this table. I can see teh A...