DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

13
kicks
published 5 months, 30 days ago, submitted by Vort3X 6 months ago

objectreference.net — As a .NET programmer most of my time is spent coding in C# and I try to avoid writing SQL where possible. Recently I had to write an insert stored procedure and needed to return the ID of the row I was inserting. While writing my usual bad SQL I came across a fascinating function I’ve never used before, SCOPE_IDENTITY().

Add a comment 7 comments | category: | Views: 285 | Get KickIt image code
tags: | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
I don't mean to sound rude, but this is pretty basic stuff. If you're a .NET programmer and don't know what SCOPE_IDENTITY() is, I'd be worried about you... Every ".NET developer" should know some basics about SQL development.
posted by xlar54 5 months, 30 days ago
Ugh... this comment on the link:

"why is it so complicated to write a loop without turning the database upside down? "

Sorry...fired. I can't even read the rest of the article for the pain that statement just caused me.
posted by xlar54 5 months, 30 days ago
The whole point of the articles on my site are to help people learn and share knowledge.

We are not all programming genius like yourself and if you know what SCOPE_IDENTITY() why are you even reading this article? it's not intended for you.

I erg people to continue and write articles no matter how basic and to not be put of by comments like xlar54's.
posted by Vort3X 5 months, 29 days ago
Even SQL Server magazine now has a monthly article about the basics. There are plenty of mid-level developers (5-7 years experience)...that have not heard of cascading deletes, index seek vs. scan, why does dropping a clustered index affect others. To me they are basic, but if your not using them or have not been exposed to them ur rarely going to remember an article 2 years back and say...oh yeah I read about that and know exactly how to use it. Plus it doesn't hurt to reinforce your knowledge of the subject.
posted by rev4bart 5 months, 28 days ago
>>> "As a .NET programmer most of my time is spent coding in C# and I try to avoid writing SQL where possible"

Exactly why so many applications are so poorly designed.

>>> "why is it so complicated to write a loop without turning the database upside down? "

As xlar54 stated... if you are thinking this, you really need to rethink your priorities, and go learn about all the links in the chain before developing another application that is brutally designed because of your ignorance of an important component of most applications.
posted by damber 5 months, 28 days ago
Hi you seem to be taking my words the wrong way let me clarify things for you.

Since I work as part of a team of developers, DBA's and designers, the DBA's deal with writing complicated sprocs or help us write them so we (developers) just focus on our application. Because of this I'm in the position to be able to avoid writing SQL, that's doesn't mean I don't know my way round the database it's just I prefer to write C# not SQL.

"why is it so complicated to write a loop without turning the database upside down? "

That was meant as sarcastic comment it's perfectly possible to write a loop it's just that it's not as easy as writing say one in C# eg.

myList.ForEach(x => x.Category == "Home");

Naz
posted by Vort3X 5 months, 27 days ago
I understand your situation. Some companies are like this. And I recognize the intent of trying to help others learn. But there are times when it is best to be blunt. Believe me, I make alot of mistakes myself and at times, take short cuts that would not be acceptable to others. Perhaps I was too harsh in my original comment. Do realize, though, that when you post on topics openly, you will be reviewed and critiqued. Just as you performed a service to others by educating them on this, my response is meant to educate them that this is critical stuff to learn. (and that loops in SQL are generally discouraged) Some of us are just more grumpy about these things as we tend to spend alot of time trying to improve the performance of poorly designed applications.

Make no mistake though; I absolutely do encourage you and your readers to continue posting articles. Basic topics are always welcome just the same.
posted by xlar54 5 months, 22 days ago



information Login or create an account to comment on this story
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge