SSMS unable to change Table View Type in Database diagram. SSMS 17 - sql-server

In SQL Server Management Studio 2017, When I am creating a new diagram & adding a new Table (or adding an existing table) to the diagram,
I am unable to change the Table View type to Custom.
Also, when I am modifying Table View "Custom" to include columns such as Default Value or Description, SSMS fails to update the table view type.
I have tried connecting instances of SQL Server 2008 R2 as well as SQL Server 2016 to the studio.
Is it a bug or is there a setting which I need to change ?
Extra Info : Downloaded it from here https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms

it might be you hit a bug. i've tested it using SSMS 14.0.17213.0 (17.4) and the table view custom is working fine. please check again. You may need to update your SSMS as Microsoft updates SSMS every month to provide bug fixes and add new features.
HTH

Related

Why did renaming a table in SQL Server also update a view?

Had a view created that referenced tableA. Renamed tableA to tableA_old and created a new tableA. The view is now referencing tableA_old. How did this happen?
It's SQL Server 2016 (running in SQL Server 2008 mode)
I could not reproduce your issue. I just made a small test database, created a table and a view, renamed the table and created a new one with the original name, and the view just selects the data from the new table. As expected. What do you mean by "running in SQL Server 2008 mode"? Do you mean the compatibility level of the database you are using? Or something else? But I don't think it would matter anyway; this behavior should be the same in all versions of SQL Server as far as I know... Very strange.
Are you really sure the view references the old table? You might want to script your view to a new query editor window to be sure... If your new table contains the same data as your old table, it's difficult to see the difference using just a SELECT query.

Adding new rows that contain identities, defaults via SQL Server Management Studio GUI

In Enterprise Manager (SQL Server 2000-), you can add new rows to an existing table by right-clicking the table and selecting "Open Table". You get an MS Access-like grid with a single blank row at the bottom for adding new rows.
In Management Studio (SQL Server 2008+), the same functionality is available by right-clicking and selecting "Edit Top 200 Rows".
In the old Enterprise Manager version, any untouched columns are set with either their default value or new identity (if applicable). This happens as soon as focus leaves the row.
In Management studio, any values not explicitly typed-in are set to NULL (even if NULL is not allowed for the column). After focus leaves the row, there is a little exclamation icon to the left of the row with this tooltip:
"This row was successfully committed to the database. However, a problem occurred when attempting to retrieve the data back after the commit. Because of this, the data in this row is read-only. To fix this problem, please re-run the query."
Is there a setting somewhere to enable the old behavior? Or, is there a keyboard shortcut (similar to CTRL+0 == NULL) to indicate you want to use the default?
I feel like I must be missing something obvious--otherwise this view is pretty useless for quickly adding new rows.
I've found that this behavior only happens when SQL Management Studio is connected to a SQL 2000 database. When editing rows on a SQL 2012 database the primary key immediately updates and there is no error icon. I think the best workaround is to just continue to use Enterprise Manager if you need to make quick edits on SQL 2000 databases.
To clear the "to fix this problem please rerun the query" just right click on the read only row with the error and select "! Execute SQL".
the issue is not management studio
this will take place even on a front end application
the issue is having identity column in a table
for some reason this behavior started when SQL 2012 came to life

Can't Create New Columns in SQL Server Management Studio

As per the image below; I have no options to design the table or add new rows to my table. I can create a new table; but not modify the existing. Why won't it let me add a new column to my table? I am connecting to an Azure database.
Make sure that the version of Management Studio you are using is >= that of your Azure database. I think that means you should be using SQL Server 2012's version of Management Studio. If you don't have access to that, you can get the free, no-longer-license-encumbered 2012 version. Click download, then scroll to the bottom, and choose whichever SQLManagementStudio file is appropriate for your language and platform (hopefully 64-bit, and it has to be > XP).
Of course, a better way to add a column is:
ALTER TABLE dbo.Loo...
ADD NewColumn INT;
Not only do you not have to rely on potentially buggy UI disasters, you can also store that in source control, which is much tougher to do when you've run a series of points and clicks.

How do I commit database table changes in Visual Studio 2012 Web Express?

This is probably obvious, but I can't see it.
I'm using Visual Studio 2012 Web Express. I open an existing database table using the internal editor, go to table definition and add a couple of extra columns.
I can see the T-SQL for a create table, if I save the table I get a prompt to save a SQL file, if I run the SQL it's a create table...
How do I just alter the existing table? Do I really have to do this manually?
On the top left there is going to be a button that says "Update". This will push the changes to your database. It will then create an alter script that you will run.
{To overcome the issue in MS SQL Server 2012 - this cell has changed, the change has not been committed to the database}
Find the "Change Type" Drop-Down Menu towards the left side of the third row, in which you can locate the Update option, which will update the records in your table.
.

SQL Server Mangement Studio Alter Script (2005)

Is it possible to generated ALTER sql script from the changes you perform in Server Studio. This is possible in different tools for mysql, basically you get the log of executed statements. Is similar thing possible here, or how do you go about finding out what the modification (ALTER) script is?
Thanks.
-- MB
You will be able to auto generate change scripts in SSMS. Take a look at this article, I believe it might be what you are looking for. http://www.mssqltips.com/tip.asp?tip=1723
from the article
As a part of my best practices, I always save the T-SQL scripts used for creation and modification of objects in SQL Server. When creating and modifying tables using SQL Server Management Studio designer it is easy to right click in the designer and select "Generate Change Script...", but is there a way to automatically script the creation and/or modification of tables made through of SQL Server Management Studio (SSMS) designer? This tip shows you an option that exists within SSMS to automatically generate these scripts for all table changes when using the table designer.
If you're altering a table (by right-clicking and selecting Design, then there is a button named Generate Change Script on the Table Designer toolbar.
If you're talking about changes made in a properties window, there is a script button at the top of each of those that can generate scripts for changes you make through the UI.
Not sure about SQL Server 2005, but in SQL Server Management Studio 2008 and later, you can definitely do this.
When you modify a table in the table designer (right-click on a table in your Object Explorer and pick "Design" from the menu), you can have SSMS generate the ALTER script for you by right-clicking in the designer and choosing "Generate Change Script":

Resources