﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / General / SQL Server 7,2000  / Error Message:Violation of PRIMARY KEY constraint 'PK_TD_SURVEY_RESULTS'. Cannot insert duplicate key in object 'TD_SURVEY_RESULTS'. The statement has been terminated. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 01:57:56 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Error Message:Violation of PRIMARY KEY constraint 'PK_TD_SURVEY_RESULTS'. Cannot insert duplicate key in object 'TD_SURVEY_RESULTS'. The statement has been terminated.</title><link>http://www.sqlservercentral.com/Forums/Topic651460-9-1.aspx</link><description>Just found this post duplicate [url=http://www.sqlservercentral.com/Forums/Topic651462-145-1.aspx]here[/url] with more answers so please post there.polaiah,Please do not post duplicates as I, and possibly others, just wasted time looking at both.Thanks,</description><pubDate>Fri, 06 Feb 2009 07:24:34 GMT</pubDate><dc:creator>  Jack Corbett</dc:creator></item><item><title>RE: Error Message:Violation of PRIMARY KEY constraint 'PK_TD_SURVEY_RESULTS'. Cannot insert duplicate key in object 'TD_SURVEY_RESULTS'. The statement has been terminated.</title><link>http://www.sqlservercentral.com/Forums/Topic651460-9-1.aspx</link><description>This is causing the error:[code]EXEC SP_TD_GEN_NEXTID 'GN', 'TD_SURVEY_RESULTS', 'nResultID', @pin_nResultID OUT[/code]How is this code working?  When is your id value being incremented?  You need to code something that shows that the id row for this table is locked until your transaction is complete.</description><pubDate>Fri, 06 Feb 2009 07:15:10 GMT</pubDate><dc:creator>  Jack Corbett</dc:creator></item><item><title>Error Message:Violation of PRIMARY KEY constraint 'PK_TD_SURVEY_RESULTS'. Cannot insert duplicate key in object 'TD_SURVEY_RESULTS'. The statement has been terminated.</title><link>http://www.sqlservercentral.com/Forums/Topic651460-9-1.aspx</link><description>Hai, ALlmy store procedure is:CREATE PROC SP_TD_SURVEY_RESULTS	(	@pin_sParam					varchar(10) ,		@pin_nResultID				int				,	@pin_nReferenceID			int				,	@pin_nSurveyID				int				,	@pin_sConductedPlace		varchar(20)		,	@pin_dtConductedPlace		datetime		,	@pin_nActionOperatorID		int					,	@pin_nMandalID				int					,	@pin_nAssemblyID			int						)ASBEGIN--SV - Save New AgendaIF @pin_sParam = 'SV'BEGIN	IF @pin_nActionOperatorID NOT IN(33,36)	BEGIN		EXEC SP_TD_GEN_NEXTID 'GN', 'TD_SURVEY_RESULTS', 'nResultID', @pin_nResultID OUT						INSERT INTO TD_SURVEY_RESULTS (nResultID, nReferenceID,nSurveyID, sConductedPlace, dtConductedPlace , nSortOrder, bActive, nCreatedOperatorID, dtCreated,nMandalID,nAssemblyID)		VALUES (@pin_nResultID	, @pin_nReferenceID, @pin_nSurveyID, @pin_sConductedPlace, @pin_dtConductedPlace, @pin_nResultID ,'Y', @pin_nActionOperatorID, getdate(),@pin_nMandalID,@pin_nAssemblyID)		SELECT  @pin_nResultID 'nResultID', 'Success' 'sStatus'	END	ELSE		SELECT  -999 'nResultID',  'You dont have write Permissions' 'sStatus'ENDENDAbove storeprocedure i am using but in these application 50 users are used at a time.The following the error is comming how to slove that one.......Error Message:Violation of PRIMARY KEY constraint 'PK_TD_SURVEY_RESULTS'. Cannot insert duplicate key in object 'TD_SURVEY_RESULTS'. The statement has been terminated.TraceLog: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at TDPORTAL.DataAccess.DAManager.ExecuteDataset(SqlCommand cmdObject) in D:\My Projects\TDPPORTAL2005\05-Development\SourceCode\TDDataAccess\DAManager.cs:line 40 regard'spolaiah M</description><pubDate>Fri, 06 Feb 2009 02:25:36 GMT</pubDate><dc:creator>polo.csit</dc:creator></item></channel></rss>