October 1, 2003 at 5:55 pm
Gary, thanks for the kind words. Any chance you could genericify that best practices document and submit as an article (or two)?
Andy
October 1, 2003 at 6:08 pm
Andy,
At this point I just don't have time to get the legal stuff I would need to have done to do that. Plus I believe there is already one on the Technet CD. I'll have to check on that. I'm just a developer who also has to do DBA duties. I actually have nothing to do with the SQL Server team.
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
Gary Johnson
Microsoft Natural Language Group
DBA, Sr. DB Engineer
This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.
October 2, 2003 at 1:26 am
I think the problem with Access is that it is an end-user database and as such has to be as simple and as forgiving as possible.
This is fine, but how many programmers start off with Access then migrate their skills to SQL Server?
Chances are that you pick up skills on the job and therefore the poor old Access developer learns about the pitfalls as he plummets into the hole grabbing handfuls of air as he falls.
I have a bee in my bonnet over the lack of training that companies put their employees through and the "make-do-and-mend" culture when it comes to tools.
After 5 days each on the original MS SQL 6.5 courses my productivity went through the roof and this obviously had massive benefits for my then employer.
I know that for small employers training costs are an issue but
October 2, 2003 at 4:34 am
I figured it was of your own making, that's why it was interesting. If there is one on Technet, a link would be handy. We're hoping to have the topic covered in more detail soon, as one or more articles.
Andy
October 1, 2004 at 6:53 am
Wow! Hot topic... I don't know what the big deal is though. I like spaces in table names, column names, wherever...
JUST KIDDING!!!
I think a "best practices" option should be added to YUKON so default naming conventions can be enforced. For example, pattern match object names.
No! Please don't ask for more Yukon features!! We have waited long enough already!!!
I blame the practice on Access database users. Access allows this practice and then if the Access database has to be moved to SQL Server, those tasked with the move get bitten.
That would explain that horrible SQL Server sample database NorthWind... AARGH!!
Aaaah... fun with formatting and smileys. Can you tell it's Friday?!
[font="Tahoma"]Bryant E. Byrd, BSSE MCDBA MCAD[/font]
Business Intelligence Administrator
MSBI Administration Blog
October 1, 2004 at 11:12 am
What about spaces in the database name itself. I had a consultant come in (for another part of the IT dept), and pop a DB onto my server the was "Company Citrix Farm".
Blew up my stats SP_ that I had built. His reply was "Microsoft says it's Ok." I reamed him a new one. But it was a week before I had found this out. Took a year and a new consultant to get it corrected.
I encourage my fellow programmers to use the underscores in the table names and columns, and then CamelBack the variables in the programs. That way you end up easily distinguishing variables and table refs and you aren't likely to get wierd crossovers when working muptiple recordsets and programs.
Just my $0.02.
----------------
Jim P.
A little bit of this and a little byte of that can cause bloatware.
October 1, 2004 at 11:24 am
I am glad you mentioned the spaces in the database name Jim! I had a SQL Server 7.0 server that I inherited and somehow a space got in the name of the database at the end! This gave the sqlmaint utility fits because if you create a folder with a space at the end, Windows takes it out. So when the sqlmaint utility tried to back up to the folder with the database name, it couldn't find it and the backup failed.
After this thread, we should probably just take spaces out of the English language altogether...
[font="Tahoma"]Bryant E. Byrd, BSSE MCDBA MCAD[/font]
Business Intelligence Administrator
MSBI Administration Blog
October 1, 2004 at 3:20 pm
I love this thread! It is so refreshing to see persons so set on following a Best Practices mentality with SQL instead of shortcutting it. I see so much of this type of stuff at work on a daily basis.
Does anyone know of a Best Practices document for working with SQL? I have convinced the development group at my company to at least consider putting together some type of Naming Convention and Standards document so that everyone is on the same wave length. I personally am a stickler for proper and neat coding. I see SQL and coding a a while as sort of Art form. If I had a good doc to start from it sure would make my life a lot easier. I'd like to add that if I can get something that either has Microsofts Name or approval on it that would be even better.
Thanks!
Ed
Kindest Regards,
Just say No to Facebook!October 4, 2004 at 7:06 am
These might help. The first is related to security and should be of interest to both admins and developers. The second is more developer oriented as it relates to patterns and practices.
http://www.microsoft.com/sql/techinfo/administration/2000/security/default.asp
http://www.microsoft.com/resources/practices/database/default.mspx
Enjoy!
[font="Tahoma"]Bryant E. Byrd, BSSE MCDBA MCAD[/font]
Business Intelligence Administrator
MSBI Administration Blog
October 9, 2004 at 8:17 pm
I too detest SPACES in ANY names, Directory, Files, Tables, Fields, etc. I have noticed that when using MS Access that IF there's a space in a field name, Access will promptly put that entry in "double quotes" because it takes the entry as a Text Value rather than a FieldName. THEN you have to REMOVE the " and replace them with []. What a pain! Underscores are better than spaces, but I still opt for just he UpperCase / LowerCase format.
Butch
May 20, 2022 at 5:48 pm
This sounds more like a Windows/Microsoft hate group. It's a small thing really. If SQL Developer and other tools were redesigned to handle spaces in a name, it wouldn't be an issue. If I wrote a letter and put an underscore under each space, it would look pretty weird. Spaces are normal characters, they have an ascii value. Why all the fuss? Just fix it.
Signed,
Yours_Truly_Today_But_It_Is_Awkward_To_Add_So_Many_Spaces_When_I_Type
Jamie
May 20, 2022 at 6:10 pm
I don't see how this is about hate for Windows or Microsoft. There is some legitimate criticism of practices which defaulted to or seemed to encourage practices (spaces in names) that make life harder for everyone that has to interact with such names. But most people here are using Microsoft SQL Server, and many of us really like, and believe it is one of the best RDBMS ecosystems and has some of the best user communities.
This isn't just a tool thing, it's a programming language thing, fundamental to how parsers/compilers/interpreters can recognize & distinguish all the language elements. Most programming languages of which I'm aware treat white space as a delimiter between words (object/variable/parameter/method/function/procedure names, etc.). All client tools (e.g., SSMS) can handle spaces in names if the right syntax is used. Most RDBMS allow use of double quotes to wrap object names in order to handle non-standard naming (in some cases, this means even use of mixed case). SQL Server happens to allow both double quotes or square brackets. And it's very easy to alias columns names in selects if the tools need that (though many would argue that even that should be done in the client application, since it's a presentation issue).
There's nothing to fix except habits that make it harder to write code/queries. Imagine having to use a character other than space to separate words, given the design of keyboards and lifetime habit (user programming).
May 20, 2022 at 6:23 pm
I'm in agreement with you about SQL Server. I am a fan from the very first time I used SQL Server 6.5, 7 , 2000 and so on. Yes, SQL Server handles spaces without difficulty... easily in fact. But if you sit with an Oracle and Linux person, they'll spew hate for code page 1252, spaces in names, Excel, Access and anything else they can find to poke a hole in Microsoft. My environment tends to interact with more of that crowd, so I get the "hate" frequently.
My thoughts are that SQL Server has no issue with spaces. If I import a CSV that has spaces in the column name to SQL Developer - well, frankly, why doesn't Oracle just fix that problem. I stumbled here for that reason and while I agree about how great a job Microsoft has done from the beginning with SQL Server, I don't think you'll find agreement about how Microsoft should handle white space. They do handle white space, in fact, they do so with flying colors. What's the problem with white space in a column name? I don't get it. I am spoiled from using Microsoft tools. But - sorry - sure feels like hate to me.
Jamie
May 22, 2022 at 5:04 am
Just my 2 cents...
Again, all just my personal preferences and observations. And I'd much rather have parentheses vertically aligned on properly indented code. In other words, I believe in writing code according to the word represented by the "S" in SQL. 😀 I even have a structure that I follow when adding comments that explains the basic business reason for every lick of code as well as useful/informative flower boxes with usage examples and revision history.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 14 posts - 16 through 28 (of 28 total)
You must be logged in to reply to this topic. Login to reply