Home All Groups Group Topic Archive Search About

SQL Server better than DB2

Author
19 Nov 2007 9:56 PM
Ian Boyd
About two years ago we had to deal quite heavily with DB2. DB2 is a
monsterous mess. Having used SQL Server so long i felt like i was being
tortured with DB2 and it's tools. i had a few back and forth conversations
with a guy at IBM who was interested in making DB2 more appealing. i got to
a list of about 40 issues.

That's not to say that SQL Server and Enterprise Manager (yes Enterprise
Manager) are not without it's problems. So in fairness i started recording
the usability issues with SQL Server. It's now two years later, and i've
decided to post what i have so far.



SQL Server Issues List
===============

1. Database using in "Task Pad" view in Enterprise Manager is not always
accurte. You must run
EXECUTE sp_spaceused @UpdateUsage=True
in order to get accurate numbers.

Solution:
Include a note on the page saying:
     NOTE: Values shown may not be current. Click [here] to update
                database usage statistics now (this may take a while to
run).
                For more information see "sp_spaceused" in the Books Online.



2. Modifying a table can cause views to return corrupt data until the view
is refreshed.

Solution:
When modifying a table, implicitly call "sp_refreshview" on all affected
views. At the very least show that a refresh view failed because the view
references invalid columns, mark those views for a 'recompile', or warn that
"the following views" may need to be refreshed.



3. Restoring a database to a server can lead to invalid mappings between a
login and a user; requiring a call to
EXECUTE sp_change_users_login 'Update_One', 'LoginName', 'DatabaseUserName'

Solution: provide a more obvious representation of login-user mappings, with
the users that have no login, and the logins that have no user.



4. When trying to restore a database to a new server, the database must be
created first. But then the database by default will try to use the original
filenames/paths for the MDF/LDF files. You have to manually enter the
filename of the MDF/LDF of your newly created database. This remains the
case even if you select "force restore over existing database"; it doesn't
actually restore over the existing database.

Solution:
i. By default restore a backup into a database; use the current database
files. Never use the original files stored with the backup.
ii. Don't require that the database already exist, since those data/log
files will be orphaned anyway.
iii. Allow option to specify that the database files will be restored to the
existing files, overwriting the current MDF/LDF of the already created
database.


5. "String or binary data would be truncated. The statement has been
terminated."

Solution: Tell me which field, and optionally it's type, and ideally the
data.


6. When scripting databases, it reverts every time to My Documents, rather
than going to my current folder. Every time (when doing this one after the
other) i have to browse to where i want them to go.

Solution: Go to my "current" folder, or perhaps record where i last put
them.


7. The script objects "Browse for Folder" dialog is very tiny, and is not
resizable. (Combined with #6, this is very, very annoying.

Solution: Use the Windows Browse for folder shell function that presents a
more usable dialog.


8. If you run sp_ChangeUsersLogin, you must close and reopen Enterprise
Manager or you will get non-sensical error messages.

Author
20 Nov 2007 12:00 AM
Norman Yuan
Add to your list for my most wanted feature from SQL Server

an easy way to orgnize stored procedures, such as a structure similar to
file system. So you can orgnize hundreds or thousands SPs used by different
applications/purpose into a hierarchical folders.

It is generally recommended to use SPs to control access to SQL Server by
applications. It is not uncommon to have thousands of SPs in a database. So
far, the only way for developer/DBA to easily know what a SP does is to name
it meaningfully. Well, if you have tens of thousands of SPs, try to name
them meaningfully and make the name being easily distinguashed. It is
painful to scroll a long list to find a SP you know you wrote previously.

I just wondering why such obviously missiing feature is still not there
after using SPs being promoted for so long? Dare I hope SQL Server2008 has
done something on this (if not, then it is too late to add it, I guess)?


Show quote
"Ian Boyd" <ian.msnews***@avatopia.com> wrote in message
news:%23YQoecvKIHA.2176@TK2MSFTNGP06.phx.gbl...
> About two years ago we had to deal quite heavily with DB2. DB2 is a
> monsterous mess. Having used SQL Server so long i felt like i was being
> tortured with DB2 and it's tools. i had a few back and forth conversations
> with a guy at IBM who was interested in making DB2 more appealing. i got
> to a list of about 40 issues.
>
> That's not to say that SQL Server and Enterprise Manager (yes Enterprise
> Manager) are not without it's problems. So in fairness i started recording
> the usability issues with SQL Server. It's now two years later, and i've
> decided to post what i have so far.
>
>
>
> SQL Server Issues List
> ===============
>
> 1. Database using in "Task Pad" view in Enterprise Manager is not always
> accurte. You must run
> EXECUTE sp_spaceused @UpdateUsage=True
> in order to get accurate numbers.
>
> Solution:
> Include a note on the page saying:
>     NOTE: Values shown may not be current. Click [here] to update
>                database usage statistics now (this may take a while to
> run).
>                For more information see "sp_spaceused" in the Books
> Online.
>
>
>
> 2. Modifying a table can cause views to return corrupt data until the view
> is refreshed.
>
> Solution:
> When modifying a table, implicitly call "sp_refreshview" on all affected
> views. At the very least show that a refresh view failed because the view
> references invalid columns, mark those views for a 'recompile', or warn
> that "the following views" may need to be refreshed.
>
>
>
> 3. Restoring a database to a server can lead to invalid mappings between a
> login and a user; requiring a call to
> EXECUTE sp_change_users_login 'Update_One', 'LoginName',
> 'DatabaseUserName'
>
> Solution: provide a more obvious representation of login-user mappings,
> with the users that have no login, and the logins that have no user.
>
>
>
> 4. When trying to restore a database to a new server, the database must be
> created first. But then the database by default will try to use the
> original filenames/paths for the MDF/LDF files. You have to manually enter
> the filename of the MDF/LDF of your newly created database. This remains
> the case even if you select "force restore over existing database"; it
> doesn't actually restore over the existing database.
>
> Solution:
> i. By default restore a backup into a database; use the current database
> files. Never use the original files stored with the backup.
> ii. Don't require that the database already exist, since those data/log
> files will be orphaned anyway.
> iii. Allow option to specify that the database files will be restored to
> the existing files, overwriting the current MDF/LDF of the already created
> database.
>
>
> 5. "String or binary data would be truncated. The statement has been
> terminated."
>
> Solution: Tell me which field, and optionally it's type, and ideally the
> data.
>
>
> 6. When scripting databases, it reverts every time to My Documents, rather
> than going to my current folder. Every time (when doing this one after the
> other) i have to browse to where i want them to go.
>
> Solution: Go to my "current" folder, or perhaps record where i last put
> them.
>
>
> 7. The script objects "Browse for Folder" dialog is very tiny, and is not
> resizable. (Combined with #6, this is very, very annoying.
>
> Solution: Use the Windows Browse for folder shell function that presents a
> more usable dialog.
>
>
> 8. If you run sp_ChangeUsersLogin, you must close and reopen Enterprise
> Manager or you will get non-sensical error messages.
>
Author
20 Nov 2007 12:25 PM
David Portas
Show quote
"Norman Yuan" <NoAddr***@NoEmail.fake> wrote in message
news:eFbDUiwKIHA.5764@TK2MSFTNGP06.phx.gbl...
> Add to your list for my most wanted feature from SQL Server
>
> an easy way to orgnize stored procedures, such as a structure similar to
> file system. So you can orgnize hundreds or thousands SPs used by
> different applications/purpose into a hierarchical folders.
>
> It is generally recommended to use SPs to control access to SQL Server by
> applications. It is not uncommon to have thousands of SPs in a database.
> So far, the only way for developer/DBA to easily know what a SP does is to
> name it meaningfully. Well, if you have tens of thousands of SPs, try to
> name them meaningfully and make the name being easily distinguashed. It is
> painful to scroll a long list to find a SP you know you wrote previously.
>
> I just wondering why such obviously missiing feature is still not there
> after using SPs being promoted for so long? Dare I hope SQL Server2008 has
> done something on this (if not, then it is too late to add it, I guess)?
>
>

You can achieve this already using a Visual Studio database project
structure with subfolders. It would be very nice if Management Studio
solution and project files were compatible with VS ones but unfortunately
they aren't and SSMS projects don't allow subfolders. Microsoft would
probably say that you should use VS and Team System for this functionality
because that's their flagship tool for development and source control.

--
David Portas
Author
20 Nov 2007 2:35 PM
Norman Yuan
Why do we need another huge software package to do this? This is feature
shoudl have been available in SQL Server itself. Sure, if some other tools
can help, and I happed to have that tool, OK, I use it. What if I do not
need that tool? Say, I were in charge of our company's DB, and we hired
different consultants to develop apps for us. Each consultant built hundreds
of SPs and organized them VERY WELL in their VS DB project. However, I do
not use VS, I end up with thousands of SPs in a huge list. and I did need to
do something with the SPs from time to time, such as change execution
permissions or even code optimization.... Do I want the SPs organised
better? You bet! Do I have a way to do it, other than give it a long, long
name?


Show quote
"David Portas" <REMOVE_BEFORE_REPLYING_dpor***@acm.org> wrote in message
news:%23Ivm9B3KIHA.2064@TK2MSFTNGP06.phx.gbl...
> "Norman Yuan" <NoAddr***@NoEmail.fake> wrote in message
> news:eFbDUiwKIHA.5764@TK2MSFTNGP06.phx.gbl...
>> Add to your list for my most wanted feature from SQL Server
>>
>> an easy way to orgnize stored procedures, such as a structure similar to
>> file system. So you can orgnize hundreds or thousands SPs used by
>> different applications/purpose into a hierarchical folders.
>>
>> It is generally recommended to use SPs to control access to SQL Server by
>> applications. It is not uncommon to have thousands of SPs in a database.
>> So far, the only way for developer/DBA to easily know what a SP does is
>> to name it meaningfully. Well, if you have tens of thousands of SPs, try
>> to name them meaningfully and make the name being easily distinguashed.
>> It is painful to scroll a long list to find a SP you know you wrote
>> previously.
>>
>> I just wondering why such obviously missiing feature is still not there
>> after using SPs being promoted for so long? Dare I hope SQL Server2008
>> has done something on this (if not, then it is too late to add it, I
>> guess)?
>>
>>
>
> You can achieve this already using a Visual Studio database project
> structure with subfolders. It would be very nice if Management Studio
> solution and project files were compatible with VS ones but unfortunately
> they aren't and SSMS projects don't allow subfolders. Microsoft would
> probably say that you should use VS and Team System for this functionality
> because that's their flagship tool for development and source control.
>
> --
> David Portas
>
>
Author
21 Nov 2007 9:13 PM
Ian Boyd
> You can achieve this already using a Visual Studio database project
> structure with subfolders. It would be very nice if Management Studio
> solution and project files were compatible with VS ones but unfortunately
> they aren't and SSMS projects don't allow subfolders.

Fortunatly, SQL Server has very little to do with Visual Studio.

> use VS and Team System for this functionality because that's their
> flagship tool for development and source control.

In terms of speed, reliability, usability, maintainability and overall
"yuck" factor: TFS is on par with DB2. We're being forced to endure
SourceUnsafe for a specific customer for a specific project, and we'll be
happy to never touch it again. Ever.
Author
21 Nov 2007 9:07 PM
Ian Boyd
> It is generally recommended to use SPs to control access to SQL Server by
> applications.

Being able to add custom "stored procedure folders", as well as "view
folders" and "table folders" would be a nice addition. (You already get one
level of folders: "System Stored Procedures", etc)


i personally disagree with that design pattern. i use stored procedures
whenever i can, and i do it to make my life easier.
Blindly using this design pattern for all database access makes things the
opposite of easier.
Author
22 Nov 2007 5:09 PM
JXStern
On Mon, 19 Nov 2007 16:56:53 -0500, "Ian Boyd"
<ian.msnews***@avatopia.com> wrote:

>5. "String or binary data would be truncated. The statement has been
>terminated."
>
>Solution: Tell me which field, and optionally it's type, and ideally the
>data.

Yes, yes, yes!

Also support Norman's idea.

Here's another little good idea, hover over index name in tree should
show fields involved.  Naming conventions not always followed,
sometimes need this!

J.
Author
23 Nov 2007 2:24 PM
Ian Boyd
> Here's another little good idea, hover over index name in tree should
> show fields involved.  Naming conventions not always followed,
> sometimes need this!


Which reminds me, when you hover over an operation in an Execution Plan,
have a hint window that can show the entire operand.

AddThis Social Bookmark Button