Solved

SQL Server 2008 CLR Stored Procedure Insert

Posted on 2011-02-21
2
530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

732 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