The Question : 200 people think this question is useful I have a table called provider. I have three columns called person, place, thing. There can be duplicate persons, duplicate places, and duplicate things, but there can never be a dupicate person-place-thing combination. How would I ALTER TABLE to add a composite primary key for
The Question : 203 people think this question is useful I’m trying to modify a table to make its primary key column AUTO_INCREMENT after the fact. I have tried the following SQL, but got a syntax error notification. Am I doing something wrong or is this not possible? +--------------------+ | VERSION() | +--------------------+ | 5.0.75-0ubuntu10.2
The Question : 305 people think this question is useful I have created a table and accidentally put varchar length as 300 instead of 65353. How can I fix that? An example would be appreciated. The Question Comments : The Answer 1 582 people think this answer is useful Have you tried this? This will
The Question : 686 people think this question is useful I am using the following code to check if the temporary table exists and drop the table if it exists before creating again. It works fine as long as I don’t change the columns. If I add a column later, it will give an error
The Question : 679 people think this question is useful I am using SQL Server 2008 and Navicat. I need to rename a column in a table using SQL. This statement doesn’t work. The Question Comments : check out stackoverflow.com/questions/174582/… Note that this is not quite a duplicate of question #174582 which swetha linked: this
The Question : 1251 people think this question is useful I have a table that has several nullable integer columns. This is undesirable for several reasons, so I am looking to update all nulls to 0 and then set these columns to NOT NULL. Aside from changing nulls to 0, data must be preserved. I
The Question : 436 people think this question is useful How do I rename a column in table xyz? The columns are: I want to rename to manufacturerid I tried using PHPMyAdmin panel, but I get this error: The Question Comments : You’re trying to change a table that has a foreign key reference in
The Question : 458 people think this question is useful Given the table created using: How can I delete the column IsDeleted? The Question Comments : The Answer 1 734 people think this answer is useful Here’s a working example. Note that the COLUMN keyword is optional, as MySQL will accept just DROP IsDeleted. Also,