Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 18,241 of 19,505    |
|    Gene Wirchenko to All    |
|    SSMS 2008: Confusing/Incorrect Error Mes    |
|    14 Apr 11 15:29:55    |
      XPost: microsoft.public.sqlserver.programming       From: genew@ocis.net              Dear SQLers:               Take 2 on trying to resolve this:               WARNING: The script drops the database Banking.               Start SSMS. Load the following script. Execute the script. It       should execute fine with no errors except possibly that the database       Banking does not exist.               Drill down to Banking's Accounts table, right-click, and select       Edit Top 200 Rows. Move to "Main Account" in the ACName column,       replace it with "Main", and press down-arrow. The change should be       accepted.               Drill down to Banking's Subaccounts table, right-click, and       select Edit Top 200 Rows. Move to "Pocket S/A" in the SAName column,       replace it with "Pocket", and press down-arrow. BOOM! WHY?               Drill down to Banking's TranTypes table, right-click, and select       Edit Top 200 Rows. Move to "Cheque" in the TTName column, replace it       with "Check", and press down-arrow. BOOM! WHY?               The trigger code is very similar between the three tables. I       have selected analogous columns that NiceString() modifies in the same       way. Why does Accounts work and Subaccounts and TranTypes not work?               The complaint is that two rows would be modified, BUT when I have       inserted code in a trigger to check, I find that there is only one row       being modified.               Maybe, I am overlooking something trivial, but at this point, I       have no idea what.              ***** Start of Code *****       -- Banking Learning Database       -- Version of 2011-04-14 15:16                            --       -- Create Database       --              use master       go              drop database Banking       go              create database Banking       go              use Banking       go                            --       -- Create Tables and Indexes       --              -- Bank Accounts Table              create table Accounts        (        ACUK nvarchar(4) primary key, -- arbitrary length        ACOrd int,        ACName nvarchar(40), -- arbitrary length        ACNr nvarchar(20) -- arbitrary length        )              create index ACOrd on Accounts(ACOrd,ACName)              go              -- Subaccounts Table       -- Some are set-asides (S/A).              create table Subaccounts        (        SAUK nvarchar(4) unique, -- arbitrary length        SAOrd int,        SAName nvarchar(40), -- arbitrary length        SAInACUK nvarchar(4), -- arbitrary length        foreign key (SAInACUK) references Accounts(ACUK)        )              create index SAOrder on Subaccounts(SAOrd,SAInACUK,SAName)              go              -- Transaction Types Table              create table TranTypes        (        TTUK nvarchar(2) unique,        TTName nvarchar(40), -- arbitrary length        TTUsualSign nvarchar(1)        constraint ckTTUsualSign check(TTUsualSign in (N'D',N'C'))        -- D: Debit, C: Credit        )              go                            --       -- Stored Procedures       --              -- NiceString       -- This procedure makes a string "nice". "nice" means that each line       of the       -- string has:       -- 1) no occurrences of |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca