Database Constaint Violation Error In SQL For Great Plains

Feb 1, 2006

Hi there. We're doing a save on a MS Great Plains with SQL Server screen and get the following error:
"A save operation on table 'WS_Time_Sheet_TRX_WORK' failed because a database constraint was violated."

If I hit More Info it says:
[Microsoft][ODBC SQL Server Driver][SQL Server]INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_WS10702_UPR00100'. The conflict occurred in database 'NSP', table 'U00100PR', column 'EMPLOYID'.

I know these messages probably make perfect sense to you guys, but I'm a newbie. Can you point me in the right direction? My thinking is that maybe I should force the foreign key constraint using the "WITH NOCHECK" option or maybe the wrong data type is mapped between the two tables sharing the Foreign Key and the key should be deleted and recreated.

Any help you can provide would be most appreciated! Assume that I'm a newbie and that I know very little. You won't hurt my feelings if you "dumb it down" so I can understand where to begin! lol I'm not even entirely sure I know where to look to edit the connection in the first place.

View 1 Replies


ADVERTISEMENT

Great Plains Database Replication

Feb 1, 2007

Our company has a database server (Windows Server 2003 x64 EE w/ SQL Server 2005 x64 EE) that has Great Plains installed. We have a database for one of our companies that I would like to begin replicating to another server. The reason behind this is that we want to run the GP/CRM Connector which requires 32-bit ODBC connections.

Anyways, what I need to do is enable replication to our 32-bit server. We have been successful in making this happen from 64-bit to 32-bit with a much smaller database. When I go to enable peer-to-peer in the properties of the publication (which I set up using all of the default settings), SQL Management Studio will hang and run for days while appearing to be working. However, when we end up killing Management Studio days later (we let it run for a week once) the peer-to-peer option does not seem to have been set properly.

Any ideas?

View 1 Replies View Related

Trigger Throws Exception Error In Great Plains 8.0

Sep 21, 2007

Not sure if there's a GP 8.0 forum, so giving this one a go.



I've added an AFTER UPDATE trigger to the RM00101 table (customer master) in a Great Plains 8.0 SQL Server 2000 SP4 DB. The trigger assigns field values to variables, constructs an update query, and executes the query on a table in a linked SQL Server 2005 DB.

The trigger works fine when fired as a result of a direct field update made through Enterprise Manager. However, when the same update is made through the Great Plains GIU (customer card window), an exception error is thrown:

"Unhandled database exception:
A Save operation on table €˜RM_Customer_MSTR€™ failed accessing SQL data

EXCEPTION_CLASS_DB
DB_ERR_SQL_DATA_ACCESS_ERR€?

The odd thing is that if I drop the trigger from the RM00101 table, the exception error still occurs. Not just on the record originally updated, but on all records and all fields within the record.

Code for the trigger follows:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE TRIGGER CTrig_Logic_Update_Customer
ON RM00101

AFTER UPDATE
AS

IF UPDATE(CUSTNMBR) or
UPDATE(CUSTCLAS) or
UPDATE(CNTCPRSN) or
UPDATE(STMTNAME) or
UPDATE(SHRTNAME) or
UPDATE(TAXSCHID) or
UPDATE(ADDRESS1) or
UPDATE(ADDRESS2) or
UPDATE(ADDRESS3) or
UPDATE(CITY) or
UPDATE(STATE) or
UPDATE(ZIP) or
UPDATE(PHONE1) or
UPDATE(FAX) or
UPDATE(SLPRSNID) or
UPDATE(PYMTRMID) or
UPDATE(PRCLEVEL) or
UPDATE(SALSTERR) or
UPDATE(INACTIVE) or
UPDATE(HOLD) or
UPDATE(CRLMTAMT)

BEGIN

DECLARE @Server_Name Varchar(25),
@Logic_DB_Name Varchar(25),
@SQLStr nvarchar(1000),
@CustomerN int,
@SICCode int,
@ARContact Varchar(35),
@LongName Varchar(50),
@CustomerName Varchar(24),
@SalesTaxCode Int,
@AddrLine1 Varchar(40),
@AddrLine2 Varchar(40),
@AddrLine3 Varchar(40),
@City Varchar(30),
@StateProv Varchar(4),
@PostalCode Varchar(15),
@TelephoneN Varchar(25),
@FaxTelephoneN Varchar(25),
@SalespersonN Int,
@TermsCode Varchar(60), -- Put the customer terms into the CommentN1 field
@CustRateSched Int,
@SalesAreaCode Int,
@InactivePurge Tinyint,
@CreditStatus Tinyint,
@CreditLimit Int

------- Get the new Customer data from Inserted table

SELECT @CustomerN = CAST(RTRIM(i.CUSTNMBR) as Integer),
@SICCode = ISNULL((SELECT Dex_Row_ID FROM RM00201 WHERE RM00201.CLASSID = i.CUSTCLAS),0),
@ARContact = RTRIM(i.CNTCPRSN),
@LongName = RTRIM(i.STMTNAME),
@CustomerName = RTRIM(i.SHRTNAME),
@SalesTaxCode = ISNULL((SELECT Dex_Row_ID FROM TX00101 WHERE TX00101.TAXSCHID = i.TAXSCHID),0),
@AddrLine1 = RTRIM(i.ADDRESS1),
@AddrLine2 = RTRIM(i.ADDRESS2),
@AddrLine3 = RTRIM(i.ADDRESS3),
@City = RTRIM(i.CITY),
@StateProv = RTRIM(LEFT(i.STATE,2)),
@PostalCode = RTRIM(i.ZIP),
@TelephoneN = RTRIM(LEFT(i.PHONE1,10)),
@FaxTelephoneN = RTRIM(LEFT(i.FAX,10)),
@SalespersonN = RTRIM(i.SLPRSNID),
@TermsCode = RTRIM(i.PYMTRMID),
@CustRateSched = RTRIM(i.DEX_ROW_ID),
@SalesAreaCode = ISNULL((SELECT Dex_Row_ID FROM RM00303 WHERE RM00303.SALSTERR = i.SALSTERR),0),
@InactivePurge = i.INACTIVE,
@CreditStatus = i.HOLD,
@CreditLimit = i.CRLMTAMT
FROM inserted i

------- Get Logic server name and database name

SELECT @Server_Name = RTRIM(l.Server_Name),
@Logic_DB_Name = RTRIM(l.Logic_DB_Name)
FROM tbl_Logic_DB l

------- Insert new Customer record into Logic database

SET @SQLStr = 'UPDATE [' + @Server_Name + '].[' + @Logic_DB_Name + '].dbo.[Customer] ' + '
SET SICCode = ' + CAST(@SICCode as varchar(10)) + ', ' + '
ARContact = ''' + @ARContact + ''', ' + '
LongName = ''' + @LongName + ''', ' + '
CustomerName = ''' + @CustomerName + ''', ' + '
SalesTaxCode = ' + CAST(@SalesTaxCode as varchar(10)) + ', ' + '
AddrLine1 = ''' + @AddrLine1 + ''', ' + '
AddrLine2 = ''' + @AddrLine2 + ''', ' + '
AddrLine3 = ''' + @AddrLine3 + ''', ' + '
City = ''' + @City + ''', ' + '
StateProv = ''' + @StateProv + ''', ' + '
PostalCode = ''' + @PostalCode + ''', ' + '
FaxTelephoneN = ''' + @TelephoneN + ''',' + '
SalespersonN = ' + CAST(@SalespersonN as varchar(10)) + ', ' + '
CommentN1 = ''' + @TermsCode + ''', ' + '
CustRateSched = ' + CAST(@CustRateSched as varchar(10)) + ', ' + '
SalesAreaCode = ' + CAST(@SalesAreaCode as varchar(10)) + ', ' + '
InactivePurge = ' + CAST(@InactivePurge as varchar(10)) + ', ' + '
CreditStatus = ' + CAST(@CreditStatus as varchar(10)) + ', ' + '
CreditLimit = ' + CAST(@CreditLimit as varchar(10)) + ' ' + '
WHERE CustomerN = ' + CAST(@CustomerN as varchar(10))


SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
SET XACT_ABORT ON

EXEC sp_executesql @SQLStr

END

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

View 1 Replies View Related

Great Plains V8

Aug 20, 2007

Hope someone can solve my problem

I have a working version of the above installed on a win 2000 machine with SQL ver (MSDE2000A.exe)


I purchase a laptop with vista home premium installed on it


MSDE2000A.exe would not install hence I installed SQL Server Express I managed to install the server and connect but when trying to login through Great Plains it says that I need SQL version 7. I have done a little research and found that SQL 7 is not supported by Vista.

Which way do I go now ?????


Do I install a copy of xp, update Great Plains or wait for an updated version of SQL Server Express SP ???


Please can anyone help !!!
and please dont get too technical Im not an expert


Many Thanks
Mr Magoo

View 2 Replies View Related

Help With Great Plains Query

May 31, 2006

Greetings,

We currently use GP 8.00 with the SQL Server 8.0.

We are trying to develop a view based on manfacturing orders - when a finished good is placed on hold and then calculating the componet parts that are on hold.

The calculation runs fine, we multiply end quanity x componet quanity found on the BOM. But we are not getting the correct componet item numbers to display.

Here is the syntax we are using:

SELECT DISTINCT
TOP 100 dbo.BM010115.QUANTITY_I, dbo.WO010032.ENDQTY_I, dbo.WO010032.ENDQTY_I * dbo.BM010115.QUANTITY_I AS QTY_REQHOLDMO,
dbo.BM010115.CPN_I, dbo.WO010032.MANUFACTUREORDER_I, dbo.WO010032.ITEMNMBR, dbo.WO010032.MANUFACTUREORDERST_I
FROM dbo.TEC_MOSumm RIGHT OUTER JOIN
dbo.WO010032 ON dbo.TEC_MOSumm.ITEMNMBR = dbo.WO010032.ITEMNMBR RIGHT OUTER JOIN
dbo.BM010115 ON dbo.WO010032.BOMCAT_I = dbo.BM010115.BOMCAT_I
WHERE (dbo.WO010032.MANUFACTUREORDERST_I = 4)

We have tried several different types of joins but still no luck. The upshot is we need to know that when a finished good is placed on hold, - how many of its componet parts are placed on hold.

Any assistance you can provide will be appreciated.

Sam

View 1 Replies View Related

Installing Great Plains V8.0

Feb 27, 2008

Here is my problem.

I am setting up a new server with Great Plains v8.0 (I have migrated all the databases from the other server, which has a working version of Great Plains v8.0 at the present moment). We are planning on getting rid of that server as it causing a lot of problems at the moment. I start the install of Great Plains v8.0 on the new server, install the components. After Great Plains v8.0 installs I go into Great Plains Utilities, and get the following message (I have installed SQL Server 2005 on the new server, and SQL Server 2000 is being used on the old server).

After I run Great Plains Utilities, I get the following error message -
"The stored procedure verifyServerVersion() of form duSQLinstall: 111
Pass Through SQL returned the following results: DBMS: 0, Great Plains: 0."

and when I click OK, it gives me another notification message -
"Your current SQL SERVER is not a support version

Req: Microsoft SQL Server 7.0
Act: Microsoft Server 2005

You need to upgrade to SQL Server 7.0 before continuing".

Why am I get that error message when I have SQL Server 2005 installed?

Can someone point me in the right direction.

Thanks

View 4 Replies View Related

Replication Of Great Plains Data

Jan 13, 2006

Hi All,

We have the requirement to replicate financial data to Aus from the UK, however I dont know if Replication is the best solution around?

Reason why I ask this, is that to create the publication, there are in excess of 10000 articles, which takes forever and a day to create, then when setting up the push subscription, this takes equally as long.

DB's physically range between 100MB and 2GB. Link to Aus is 2MB E1.

The accounts server isnt the most powerful of beasts (HP DL380, 1x1.4Ghx CPU) and with 4 DB's to setup and replicate, it's going to take some time.

With this in mind, I would also be looking to script out the publication should there be any failures and put it into SourceSafe, however this would also take a vast amount of time.

I've thought about using Log Shipping, however I dont know if there are any better ways
?

Thoughts appreciated.

Steve

View 5 Replies View Related

Defaults And Constaint Values In SQL Server And DB2?

Mar 22, 2004

Hi,
I Just wanted know that where is the Default and Constraint values are stored in SQL server or DB2 sytem Tables?

View 4 Replies View Related

Execute SQL Task: Executing The Query Exec (?) Failed With The Following Error: Syntax Error Or Access Violation. Possible F

Jan 23, 2008

Hi,
I'm having an SSIS package which gives the following error when executed :

Error: 0xC002F210 at Create Linked Server, Execute SQL Task: Executing the query "exec (?)" failed with the following error: "Syntax error or access violation". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.Task failed: Create Linked Server

The package has a single Execute SQL task with the properties listed below :

General Properties
Result Set : None

ConnectionType : OLEDB
Connection : Connected to a Local Database (DB1)
SQLSourceType : Direct Input
SQL Statement : exec(?)
IsQueryStorePro : False
BypassPrepare : False

Parameter Mapping Properties

variableName Direction DataType ParameterName

User::AddLinkSql Input Varchar 0


'AddLinkSql' is a global variable of package scope of type string with the value
Exec sp_AddLinkedServer 'Srv1','','SQLOLEDB.1',@DataSrc='localhost',@catalog ='DB1'

When I try to execute the Query task, it fails with the above error. Also, the above the sql statement cannot be parsed and gives error "The query failed to parse. Syntax or access violation"

I would like to add that the above package was migrated from DTS, where it runs without any error, eventhough
it gives the same parse error message.

I would appreciate if anybody can help me out of this issue by suggeting where the problem is.

Thanks in Advance.

View 12 Replies View Related

Error 0: Syntax Error Or Access Violation

Aug 1, 2004

Hi,
I'm writing a stored procedure and when I click on the Check Syntax button its giving me the error in the subject. I'm not really sure whats wrong with this. Here is my Stored Procedure code. Any help wud be appreciated.


CREATE PROC CabsSchedule_Insert
{
@JulianDatesmallint,
@SiteCodesmallint,
@CalendarDaysmallint,
@BillPeriodsmallint,
@WorkDaysmallint,
@CalDayBillRcvd varchar(30),
@Remarksvarchar(50)
}
AS
INSERT INTO CabsSchedule
(JulianDate, SiteCode, CalendarDay, BillPeriod, WorkDay, CalDayBillRcvd, Remarks)
VALUES
(@JulianDate, @SiteCode, @CalendarDay, @BillPeriod, @WorkDay, @CalDayBillRcvd, @Remarks)


Thanks,

View 2 Replies View Related

Violation Of Primary Key Error

Dec 13, 2005

hi,
I am trying to save the record which is displayed in the textbox by selecting a row in the datagrid. If i click the save button I am getting the following error.
Violation of PRIMARY KEY constraint 'PK_clientinfo'. Cannot insert duplicate key in object 'clientinfo'. The statement has been terminated.      
button save-----------
    conn.Open();    SqlCommand cmd = new SqlCommand("insert into clientinfo (client_name, address, telephone, fax, email, contperson1, dept, contpos1, contperson2, contpos2, rscompname, rscontperson, rsposition, actdate, acttime, instsno, actkey) values ('"+txtclientname.Text+"', '"+txtaddress.Text+"', '"+txttelephone.Text+"', '"+txtfax.Text+"', '"+txtemail.Text+"', '"+txtcntperson1.Text+"', '"+txtdept.Text+"', '"+txtcnt1pos.Text+"', '"+txtcntperson2.Text+"', '"+txtcnt2pos.Text+"', '"+txtcompname.Text+"', '"+txtrscntperson.Text+"', '"+txtrspos.Text+"', '"+txtactdate.Text+"', '"+txtacttime.Text+"','"+txtinstno.Text+"', '"+txtactkey.Text+"')", conn);    cmd.ExecuteNonQuery();    conn.Close();    BindData();    txtclear();       } 

View 1 Replies View Related

Concurrency Violation Error!

May 16, 2006

Hiim keep getting  the following errorConcurrency violation: the UpdateCommand affected 0 recordsI dunno whats wrong, im the only person using the database and program at the moment.Anyone know what im doing wrong?thanks 

View 1 Replies View Related

ERROR MSG: Violation Of PRIMARY KEY

Apr 30, 1999

Hi,

On a regular basis, it seems that the primary key of my table gets corrupted and I get the error message below. I can still read the data but no longer update or insert.
There is no reason why there should be such error. I fix it by creating a temporary table and copying the data accross, then renaming the
table, but I would rather prevent it. Any thought on this??


<P>ODBC Error Code = 23000 (Integrity constraint violation)
<P>[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY
constraint 'PK___1__23': Attempt to insert duplicate key in object 'SiteList'

View 1 Replies View Related

Primary Key Violation Error

Apr 8, 2008

Can anyone help me in handling errors I'm trying to update Employee master table, but i get error messege of violating primary-key constraint

View 3 Replies View Related

Capture Primary Key Violation Error

Sep 14, 2007

Hello,,
I need to capture the primary key violation error:
        If e.CommandName = "Insert" Then            Dim EmployeeIDTextBox As TextBox = CType(dvContact.FindControl("EmployeeIDTextBox"), TextBox)            Dim LastName As TextBox = CType(dvContact.FindControl("LastName"), TextBox)            Dim FirstName As TextBox = CType(dvContact.FindControl("FirstName"), TextBox)     
            Using cmdAdd As New System.Data.SqlClient.SqlCommand
                'Establish connection to the database connection                Dim sqlcon As New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("eConnString").ToString)
                'Open connection                sqlcon.Open()
                'Pass opened connection (see above) to the command object                cmdAdd.Connection = sqlcon
                'Using "With/End With" pass content to columns from text objects and datatime variables (see above)                With cmdAdd                    .Parameters.Add(New SqlClient.SqlParameter("@EmployeeID", EmployeeIDTextBox.Text))                    .Parameters.Add(New SqlClient.SqlParameter("@LastName", LastName.Text))                    .Parameters.Add(New SqlClient.SqlParameter("@FirstName", FirstName.Text))                              'Establish the type of commandy object                    .CommandType = CommandType.Text
                    'Pass the Update nonquery statement to the commandText object previously instantiated                    .CommandText = "INSERT INTO ATTEmployee(EmployeeID, LastName, FirstName & _                         "VALUES (@EmployeeID, @LastName, @FirstName)"                End With
                'Execute the nonquerry via the command object                cmdAdd.ExecuteNonQuery() '<==Need to capture primaryKey violation, give user message, cancel insert,return to detailView ReadOnly
               'I haven't figured out the correct code to capture the primary key violation
               EDITMsg.Text="You can not insert an duplicate record.  Try Again."
                'Close the sql connection                sqlcon.Close()            End Using        End If
 
Thank you for your help

View 6 Replies View Related

Primary Key Violation Error In SQL 2005

Oct 17, 2006

Hey guys...

I've recently migrated a SQL 2000 db to SQL 2005. There is a table with a defined primary key. In 2000 when I try importing a duplicate record my application would continue and just skip the duplicates. In 2005 I get an error message "Cannot insert duplicate key row in object ... with unique index..." Is there a setting that I can enable/disable to ignore and continue processing when these errors are encountered? I've read a little on "fail package on step failure" but not quite clear on it. Any tips? Thanks alot

View 10 Replies View Related

Violation Of PRIMARY KEY Constraint Error

Apr 18, 2007

We are using web application, our server log this type error. some can help me out how to slove this type of error


4/16/2007 2:44:26 PM DECIMonitoring.DocTracking.Db:insertState [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of PRIMARY KEY constraint 'idx_edcstate_p_cl_01'. Cannot insert duplicate key in object 'tbl_edc_state'. tech.deci.com:5555

4/16/2007 2:44:26 PM DECIMonitoring.DocTracking.Db:insertState [ADA.1.316] Cannot execute the SQL statement "INSERT INTO db_webmethods_support_edc.dbo.tbl_edc_state(stat_s tate_id, state_item_id, state_start_ts) VALUES (?, ?, ?)". "

(23000/2627) [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of PRIMARY KEY constraint 'idx_edcstate_p_cl_01'. Cannot insert duplicate key in object 'tbl_edc_state'.

(HY000/3621) [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The statement has been terminated."

[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of PRIMARY KEY constraint 'idx_edcstate_p_cl_01'. Cannot insert duplicate key in object 'tbl_edc_state'. tech.deci.com:5555

4/16/2007 2:44:26 PM DECIMonitoring.DocTracking.Db:insertState [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of PRIMARY KEY constraint 'idx_edcstate_p_cl_01'. Cannot insert duplicate key in object 'tbl_edc_state'. tech.deci.com:5555

View 3 Replies View Related

Catching Primary Key Violation On Insert Error

Aug 9, 2007

I've read a few different articticles wrt how the handle this error gracefully. I am thinking of wrapping my sql insert statement in a try catch  and have the catch be something likeIF ( e.ToString() LIKE '% System.Data.SqlClient.SqlException:
Violation of PRIMARY KEY constraint 'PK_PS_HR_Hrs'. Cannot insert duplicate key
in object %'){lable1.text = "Sorry, you already have reported hours for that day, please select anothe rdate" } Is there a better way?TIA Dan 

View 4 Replies View Related

Replication Fails With Primary Key Violation Error

Jun 7, 1999

I have a publication that has been working great for over eight months. I have on occassion had to stop publishing and stop subscribing in normal operation without problems.

Yesterday, I ran into a problem that I am not sure how to solve.

I keep getting a distribution task failure "Violation of Primary Key constraint 'aaaashipm_pk'. Attempt to insert duplicate key in object shipm failed while bulk copying into shipm

Anyone run across this or have any suggestions -- do I have a transaction log problem, distribution data base/log problem. I have checked the identity column to make sure its not out of sync, run a check on the table to make sure its not corrupted. I have a couple of other things I am trying but was curious if anyone else had come across this?

Will let you know if I find a solution but it doesn't look good.

View 1 Replies View Related

Client Agent Error: Integrity Violation

Mar 16, 2006

Hello:

I tried to do the merge replication between SQL 2000 database and the SQL mobile server on PDA with SQL server management studio from SQL 2005 and I have already successfully synchronized my PDA with one small SQL server database file. However when I tried to synchronized my PDA with another larger SQL server database file, I got the error on PDA as following: €œThe row operation cannot be reapplied due to an integrity violation. Check the publication filter. [Table = AuditCriterion, operation = Insert, RowGuid = {1ee9321d-f00d-410c-8d5b-08d4220d2627}]€?. I have keep checking the size of sdf file during synchronization, I found after the size of the sdf file stop increasing for about 20 mintues, then I got the error above. Morever, AuditCriterion table have a foreign key with another table AuditElement and I have not used publication filter at this stage.

Please help thanks.

Eddie

View 1 Replies View Related

Contraint Violation When Reading From Database

Apr 4, 2008

I have created a typed-dataset AuthorsDataSet and created a table in with name Authors, manually by right-click > New > Table. I have kept the data-types, sizes and contstriants exactly same as the table in the database, though I have kept the Column names different. I am filling the AuthorsDataSet with the following code on Form_Loadif (!IsPostBack)
{      SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["pubsConnectionString"].ConnectionString);
      SqlCommand cmd = new SqlCommand("SELECT au_id, au_lname, au_fname, phone, address, city, state, zip, contract FROM authors", conn);      using (SqlDataAdapter da = new SqlDataAdapter(cmd))
      {
            conn.Open();
            da.Fill(ds.Authors);
            grdAuthors.DataSource = ds.Authors;
            grdAuthors.DataBind();
            conn.Close();
      }
      conn.Dispose();
      cmd.Dispose();
}
The connection string is as follows:<connectionStrings>
      <add name="pubsConnectionString" connectionString="Data Source = localhost; Initial Catalog = pubs; Integrated Security = SSPI"/>
</connectionStrings>
The following error occurs when I run the page
System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

View 3 Replies View Related

SP Causes The Error Violation Of UNIQUE KEY Constraint Cannot Insert Duplicate Key

Dec 23, 2007

The following SP causes the error "Violation of UNIQUE KEY constraint 'AlumniID'. Cannot insert duplicate key in object [table name].
The statement has been terminated." AlumniID is the table's PK and is set to autoincrement. I'd appreciate any help or suggestions.

1 ALTER PROCEDURE dbo.sp_CreateUser
2
3 @UserID uniqueidentifier,
4 @UserName nvarchar(128),
5 @Email nvarchar(50),
6 @FirstName nvarchar(25),
7 @LastName nvarchar(50),
8 @Teacher nvarchar(25),
9 @GradYr int
10
11 AS
12 SET NOCOUNT ON;
13 --DECLARE @UserID uniqueidentifier
14 --SELECT @UserID = NULL
15 --SELECT @UserID = UserID FROM dbo.aspnet_Users WHERE LOWER(@UserName) = LoweredUserName-- AND @ApplicationId = ApplicationId
16 INSERT INTO [table]
17 (UserID,UserName,Email,FirstName,LastName,Teacher,GradYr)
18 VALUES (@UserID,@UserName,@Email,@FirstName,@LastName,@Teacher,@GradYr 

View 2 Replies View Related

SP Causes The Error Violation Of UNIQUE KEY Constraint Cannot Insert Duplicate Key

Mar 14, 2008



I have a table with 0 records. When I try to insert records using a SP, it gives the following error.
Violation of UNIQUE KEY Constraint 'constraint name'. Cannot insert duplicate key in object 'Objectname'.
How do I resolve this.
Thanks.

View 1 Replies View Related

SQL 2012 :: Trace Flag To Capture Error Messages Like PK Violation

Apr 24, 2015

Is there a dbcc flag that will capture all error messages in the log

e.g. when inserting data into a table, a PK violation occurs throwing, Msg 2627

..similar to trace flag 1222 to capture deadlock info..

View 3 Replies View Related

Delete Database File On Server -&> Sharing Violation

Oct 17, 2007

Hi,I have some database files (.MDF, .LDF,...) on the server. When I tryto delete them, the warning "Cannot delete file: There has been asharing violation. The source or destination file may be in use."appears.Since I am new to the environment I don't know where the files comefrom and where they might be used.Can anybody tell me what to do to delete those files?Thank you.

View 36 Replies View Related

[Microsoft][ODBC SQL Server Driver]Syntax Error Or Access Violation'

Apr 25, 2003

Where i try to create stored procedure in sql server 2000 using query analyzer i'm getting an error

'[Microsoft][ODBC SQL Server Driver]Syntax error or access violation'

and the same stored procedure if i try after some time without any changes it gets created..

how is wrong?

View 2 Replies View Related

WMI File Watcher In Control Flow Issues Quota Violation Error

May 22, 2008

My SSIS control flow includes a standard "textbook" WMI Event Watcher Task that monitors a folder for incoming files. Generally it works fine, but now I regularly see the error message:

"Watching for the Wql Query caused the following system exception: "Quota Violation." Check the query for errors or WMI connection for access rights/permissions"


I do not see any indication of trouble in the event logs. The SSIS log simply states that it failed.

Is there any magic about WMI Event Watcher?

When I restart, it runs fine for hours.

SQL05 is 9.0.3054 on W2003 with all microsoft updates applied. It is basically a bare machine with SQL Server, SSIS running and a service that kicks in occasionally.

Thanks for reading!

View 3 Replies View Related

[Microsoft][ODBC SQL Server Driver]Syntax Error Or Access Violation

Apr 17, 2008



Hi guys! I am using SQL 2005 and I wonder why I am encountering the error "[Microsoft][ODBC SQL Server Driver]Syntax error or access violation" everytime I am trying to create stored procedure with temp table and table variable.
See my code below with temp table.


Any thoughts will be appreciated!

CREATE PROCEDURE DBO.SAMPLESP
(@DETAILS AS VARCHAR(8000),
@ID AS VARCHAR(15))


AS

BEGIN TRANSACTION

CREATE TABLE DBO.#TEMPTABLE
{
ASSET VARCHAR(50)
}

DECLARE @INSTINSERT AS NVARCHAR(4000)
SET @INSTINSERT= 'INSERT INTO #TEMPTABLE(ASSET)'
SET @INSTINSERT= @INSTINSERT+ @DETAILS

EXEC sp_ExecuteSQL @INSTINSERT

INSERT INTO InstDetail
(TrackNum, ASSETID)
SELECT @ID, A.ASSE
FROM #TEMPTABLE A

DROP TABLE #TEMPTABLE


IF @@ERROR != 0
BEGIN
ROLLBACK TRANSACTION
RAISERROR('There was an error in here', 11, 1)
RETURN
END
ELSE
COMMIT TRANSACTION

View 5 Replies View Related

Access Violation Error On Setup.exe When Installing SQl Server 6.5 On NT 4.0 Server

Feb 18, 1999

I have tried several times to install SQL server onto an NT4.0 server which is more than capable of having more than one application to cope with, however, when going through the install procedure the programm stops with the following message


DR.Watson
Access Violation
Setup.exe
In address :

Any hints as to where the problems lies or point me inthe right direction would be appreciated.

View 1 Replies View Related

SQL Hell....little Help Would Be Great!

Jan 4, 2005

hi, im currently on sql hell right now. im having a hard time learning this sql thingie....

...the thing is this: im currently using the book ASP.NET Unleashed and most of the examples there are on SQL. what i was trying to do before was convert everything to OleDb to fit the ms access which i have right now.

unfortunately, some of the codes seem not to work properly. maybe its because of im using OleDb...

so what i did was i downloaded the MSDE sp3 package and installed it on my PC. now that i have an sql server for my WebMatrix, i just dont know what to do next? i mean, where do i put the sql sample databases like northwind and pubs???

im really confused about this sql thing. i really hate it.

help!!!

View 1 Replies View Related

Great MS SQL Sites?

Mar 17, 2004

Does anyone know of any links to some great MS SQL sites I can check out to learn from?

Thanks for your thoughts.

Sincerely,

Tim

View 4 Replies View Related

Between Or Great Than Operator

Feb 10, 2014

Im not getting data when I execute the below 0 Rows:

select mydate from [dbo].mytable
where convert(varchar, mydate,101) between '11/18/2013' and '02/08/2014'

However the below gives results...

select mydate from [dbo].mytable
where convert(varchar, mydate,101) between '01/01/2013' and '02/08/2014'

View 5 Replies View Related

Morning - Any Help Would Be Great

Jan 30, 2007

I have two servers both with different collation. Server A being SQL_Latin1_General_CP1_CI_AS and the live server and Server B being Latin1_General_CI_AS and a dev server. Now i have a load of data on the dev which i'm query to see if its on the live server.
select * from ServerA.Table1 where Col1 in
(select Col1 from ServerB.Table1)

I get this Error message.
Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved