Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange behavior when modifying tables or procedures in SQL Server 2008 Management Studio
    primarykey
    data
    text
    <p>This is some weird behavior...</p> <p>Whenever I script certain tables (using CREATE TO...) or edit stored procedures (using modify in the right click context menu) I sometimes get really weird results... For example, scripting most tables gives me: </p> <pre><code>CREATE TABLE [dbo.].[TableINeverAskedFor] ... CREATE TABLE [dbo].[TableIWant]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](128) NOT NULL, [ModuleID] [int] NOT NULL, [OtherInfo] [int] NOT NULL, CONSTRAINT [PK_ModuleDefinitions] PRIMARY KEY NONCLUSTERED CREATE TABLE [dbo.].[TableINeverAskedFor] ... ALTER TABLE [dbo].[TableWhichHasNothingToDoWithMyTable] ADD CONSTRAINT [FK_WhyDoesThisHappen?] DEFAULT ((0)) FOR [ID] </code></pre> <p>Stored procedures are even more weird... the bigger the sotred procedure, the more alter scripts I get, just like above. It's really annoying and I am afraid I'm going to do something stupid and not pay attention one day.</p> <p>Relevant info:</p> <ul> <li>I have SQL Server 2008 R2 installed, a new install.</li> <li>I have a few developers in my shop experiencing similar problems. </li> <li>I also have a SQL Server 2008 box (no R2) doing the same thing. </li> <li>My instance is updated with SP1 and theirs aren't. </li> <li>We can also replicate the issue on multiple databases.</li> <li>Our production server is not giving us the same issue.</li> <li>Some stored procedures and tables don't have this problem however the same stored procedures and tables can be replicated. It's not a random issue.</li> <li>I have no plugins installed.</li> </ul> <p>EDIT: It's not that weird... I can see it being useful for table creation. Editing a stored procedure though, that was what was very confusing to me. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload