- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I think I see the cause of the confusion - we're talking about SQL outside the database, and he thinks that means developers are outside the database. In that scenario, I guess SPs just sort of happen, which would indeed be scary. Actually, there are plenty of serverside developers about, and the vast majority of them can write database code. DBAs tend to specialize in operations and tuning, and generally don't write production code. You would not want a DBA to be writing Hibernate files, if that's what he's proposing.
Admin
You might be right, but if so, he's talking about these (even less qualified) developers (the ones coding all these Web services), having access rights to write SQL and send it to the DB...
Also, although I hope this is not the case, his statement about "Just lock out the developers from the db..." might mean that he's one of those folks who are still passing actual user logins to connect to the DB, instead of creating application service accounts... Otherwise, this statement makes no sense in the context of the issue we are debating... The access level of the developers, using their personal accounts, is immaterial to the architectural design of an application using a service account... Best we assume he was just letting his enthusiasm pull him a bit off track...
Admin
Erm... you could make this even more "Extensible" like so:
Const intNumOfParameters 50
Dim intCounter as Integer
For intCounter = 1 To intNumOfParameters
sqlCmd.Parameters.Append sqlCmd.createParameter("int_" & Right(String("0",Len(CStr(intNumOfParameters))) & intCounter,Len(CStr(intNumOfParameters))) & "_in", adInteger, adParamInput, 8, Null)
Next
That way, if he needs more parameters (even over 100) he can just change the const and the code itself will adjust, including putting in the right correct number of leading "0"'s
Typed freehand, without the aid of intellisense (Or indeed, common sense, but you get the idea, I'm sure).
Admin
And the best thing is that the resulting code is very readable and almost never results in SQL injection vulnerabilities.
NOT!