Solved

SQL Server 2008 CLR Stored Procedure Insert

Posted on 2011-02-21
2
525 Views
Last Modified: 2012-05-11
Hi,

I am not sure how to receive the @@identity variable from sql server when I execute through a CLR Stored Procedure. Could someone give me an example or point me in the right direction

Thanks

0
Comment
Question by:dilithiumtoys_dot_com
2 Comments
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 75 total points
ID: 34948130
You're better using scope_identity see link:

http://msdn.microsoft.com/en-us/library/ms190315.aspx
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 175 total points
ID: 34948139
In CLR, instead of @@Identity use SELECT SCOPE_IDENTITY() to get the same output

Kindly go through the thread below and especially the last one which would be of interest to you..
http://www.bigresource.com/Tracker/Track-ms_sql-8t5Yvti6/
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Negative isnull? 3 25
Compare a column in results by values left of decimal 2 22
Many to one in one row 2 35
Change this SQL to get all nodes 3 36
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question