Yes, you were already aware of 40 or 50 reasons not to use Open Table. I have one more. Say you are creating a table with a composite key that includes a binary column. An example I came across recently was a table that captures additional data not covered by CDC (e.g. username). So, I created this table:
CREATE TABLE dbo.CaptureDetails
(
StartLSN BINARY(10) NOT NULL,
EndLSN BINARY(10) NOT NULL,
ActionType INT NOT NULL,
Username VARCHAR(32) NOT NULL,
PRIMARY KEY(StartLSN, EndLSN, ActionType)
);
GO
— now I actually use cdc schema not of dbo, and populate
— this via a trigger on the CDC change table, but for ease
— of reproduction, let's just jimmy some data in there:
INSERT dbo.CaptureDetails(StartLSN, EndLSN, ActionType, Username)
SELECT 0x0000001A000001360013, 0x0000001A000001360012, 2, 'sa'
UNION SELECT 0x0000001A0000013A0003, 0x0000001A0000013A0002, 2, 'sa'
UNION SELECT 0x0000001A0000013B0004, 0x0000001A0000013B0002, 3, 'sa'
UNION SELECT 0x0000001A0000013B0004, 0x0000001A0000013B0002, 4, 'sa'
UNION SELECT 0x0000001A000001490013, 0x0000001A000001490012, 2, 'sa'
UNION SELECT 0x0000001A0000014C0003, 0x0000001A0000014C0002, 2, 'sa'
UNION SELECT 0x0000001A000001560003, 0x0000001A000001560002, 2, 'sa'
UNION SELECT 0x0000001A000001570003, 0x0000001A000001570002, 2, 'sa'
UNION SELECT 0x0000001A000001590004, 0x0000001A000001590002, 3, 'sa';
GO
I have filed this defect (with a few more details) at the following URL, and encourage you to vote:
http://web.archive.org/web/*/https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=289541
As for the 40 or 50 reasons not to use Open Table, if you are familiar with Connect, start here:
http://web.archive.org/web/*/https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=264592
In addition to the problem I outline there, I also reference a whole slew of Connect items that mention Open Table.
Good news, SJ! In SQL Server 2008, Open Table is being replaced by the following menu items:
SELECT n1 ROWS
EDIT n2 ROWS
n1 and n2 will be configurable via Tools | Options.
If you choose the SELECT option, it will launch a new query window, with SELECT TOP <column list> FROM <selected table>. There will be a nice big comment in there to add an ORDER BY so that which n1 rows you receive is not arbitrary, and so that it is not misleading users into thinking TOP has some meaning without ORDER BY.
If you choose the EDIT option, you will get the datagrid like you get with Open Table today. In this case, there isn't a good way to make it very obvious that if the user wants a specific set of rows, they should switch to the SQL view and add an ORDER BY clause.
Actually, I would love to see the list of 40-50 reasons to not use Open Table. My programmers and Jr. DBA do this all the time and it annoys the heck out of me. And then they complain of performance.
Really, I would love to find a way to remove this menu item from the SSMS. Know of anything?
Thanks
SJ
<a href="http://feeds.feedburner.com/~r/MathomSolutionsBlog-it/~6/1"><img src="http://feeds.feedburner.com/MathomSolutionsBlog-it.1.gif" alt="Mathom Solutions Blog-IT" style="border:0"></a>