No Pk On Table Error
Contents |
Discussions Activity Best Of... Unanswered Categories 62.5K All Categories73 General 73 Announcements 57.1K Microsoft Dynamics NAV 11.3K NAV Three Tier 37.1K
Cannot Change Column : Used In A Foreign Key Constraint
NAV/Navision Classic Client 3.6K Navision Attain 2.2K Navision Financials 107 Navision DOS foreign_key_checks 828 Navision e-Commerce 532 NAV Tips & Tricks 728 NAV Dutch speaking only 580 NAV Courses, Exams &
Mysql Add Foreign Key
Certification 1.8K Microsoft Dynamics-Other 1.4K Dynamics AX 195 Dynamics CRM 96 Dynamics GP 5 Dynamics SL 1.4K Other 928 SQL General 354 SQL Performance 24 SQL Tips & Tricks 17 drop foreign key Design Patterns (General & Best Practices) 0 Architectural Patterns 6 Design Patterns 2 Implementation Patterns 28 3rd Party Products, Services & Events 860 General 860 General Chat 1.5K Website 73 Testing 1.1K Download section 23 How Tos section 231 Feedback 12 NAV TechDays 2013 Sessions 13 NAV TechDays 2012 Sessions Resolving error "No primary key error for table in SQL Desc" alter table add foreign key chander Member Posts: 12 2010-12-06 edited 2014-12-01 in SQL General Hello, Could some please help me in resolving the error "The Pay Journal Line table has no primary key constraint in the SQL Server table description." I am getting this error after running the sp_removedbreplication even though there were no replication was done but i was getting error messages for publications and subscriptions of articles. So i removed them using sp_removedbreplicaton so that i can alter the objects of navision. But after that i am facing the above mentioned error. Could someone please help me in resolving this. Thanks heaps in advance. Chander 0 Comments chander Member Posts: 12 2010-12-07 Could someone help me out on this issue. 0 Luc_Van_Dyck WilrijkMember, Moderator, Administrator Posts: 3,624 2010-12-07 It would help if you post in the correct forum. No support using PM or e-mail - Please use this forum. || Search is your friend NAV TechDays 2016: 17 & 18 November 2016, Antwerp (Belgium)0 Administrator Member, Moderator, Administrator Posts: 2,281 2010-12-07 [Topic moved from 'NAV Tips & Tricks' to 'SQL
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error altering primary key column in mysql table up vote 3 down vote favorite 1 I am http://forum.mibuso.com/discussion/45005/resolving-error-no-primary-key-error-for-table-in-sql-desc very new to SQL and MySQL. I am trying to modify a primary key column in a table so that it auto-increments. This primary key is also a foreign key in another table. I am not able to modify this column due to an error related to the foreign key in the other table. Here is the error: mysql> desc favourite_food; +-----------+----------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default http://stackoverflow.com/questions/17266401/error-altering-primary-key-column-in-mysql-table | Extra | +-----------+----------------------+------+-----+---------+-------+ | person_id | smallint(5) unsigned | NO | PRI | 0 | | | food | varchar(20) | NO | PRI | | | +-----------+----------------------+------+-----+---------+-------+ 2 rows in set (0.09 sec) mysql> alter table person modify person_id smallint unsigned auto_increment; ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 22 Current database: bank ERROR 1833 (HY000): Cannot change column 'person_id': used in a foreign key cons traint 'fk_fav_food_person_id' of table 'bank.favourite_food' mysql> I'm sure it is something simple, but I can't figure out why and teh book I am following does not indicate why. Thanks. mysql sql database share|improve this question asked Jun 23 '13 at 23:56 fdama 671613 Why not just drop the fk, do your alter statement then recreate the fk –Java Devil Jun 24 '13 at 0:14 Would you be able to show me how to do that? Secondly, why does the fk need to be dropped? –fdama Jun 24 '13 at 0:19 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote Do it something like this --Drop fk ALTER TABLE favourite_food DROP FOREIGN KEY fk_fav_food_person_id; --Alter your pk ALTER TABLE person modify person_id smallint unsigned auto_increment; --Recreate fk ALTER TABLE favour
All Products Customers Pricing Developers Support Developer Support Consulting Partners Consulting Services Contact Sales Resources Blog FAQ Partners Webinars About Xamarin Blog About Xamarin Questions Best Of... Sign In · Register Welcome https://forums.xamarin.com/discussion/46542/sqlite-net-update-generating-error-it-has-no-pk Guides Recipes APIs Samples Forums Components Videos Forum › General Categories Recent Threads Activity Best Of... Unanswered SQLite.Net Update generating error "it has no PK" SteveSykes Steve SykesUSMember ✭ July 2015 edited July 2015 in General Here is my simple class: public class settings { [PrimaryKey, AutoIncrement] public int ID { get; set; } public string user_name { get; set; } public string password { get; set; foreign key } public string server { get; set; } } void CreateTables() { database.CreateTable