Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL CODE REVERSE

Posted on 2007-11-15
6
Medium Priority
?
189 Views
Last Modified: 2010-03-20
Could someone please tell me what code I should use to reverse the first line of the follwing code and remove the table that was created in my database?

ALTER TABLE newsletters ADD template varchar(64) AFTER locked;
CREATE TABLE `newsletters_to_products` (
`newsletter_id` INT( 11 ) DEFAULT '0' NOT NULL ,
`products_id` INT( 11 ) DEFAULT '0' NOT NULL ,
PRIMARY KEY ( `newsletter_id` , `products_id` )
);

Many thanks
0
Comment
Question by:Nicci_Leitch
  • 3
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
Angelp1ay earned 1000 total points
ID: 20289617
ALTER TABLE newsletters DROP COLUMN template;
DROP TABLE newsletters_to_products;
0
 
LVL 27

Assisted Solution

by:Zberteoc
Zberteoc earned 1000 total points
ID: 20289658
--to remove the template column:
ALTER TABLE newsletters DROP COLUMN template

-- to remove the created table:
DROP TABLE newsletters_to_products


however, the AFTER locked clause is not part of SQL synthax, as I know, and
the CREATE sythax is wrong because for INT (integer) type you don't specify size lke (11). so I doobt it run succesfully.
0
 

Author Comment

by:Nicci_Leitch
ID: 20290147
Zberteoc:
Blimey! I have spent days trying to get this working properly due to some error and even after everyone's galant efforts of trying to help me, I decided to scrap it as it just wasn't happening, hence needing the reversal.

Now I'm thinking that because of the error you've pointed out, this could have been the route of the problem. (I don't know as I'm not too clever when it comes to this kind of thing, hence why I try to get help wherever I can!)

Thank you for your help
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Expert Comment

by:Angelp1ay
ID: 20290250
0
 
LVL 11

Expert Comment

by:Angelp1ay
ID: 20290282
0
 

Author Comment

by:Nicci_Leitch
ID: 20290316
Thank you both very much.  Its much appreciated.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

824 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