Solved

SQL CODE REVERSE

Posted on 2007-11-15
6
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 11

Accepted Solution

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

Assisted Solution

by:Zberteoc
Zberteoc earned 250 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
MS SQL Update query with connected table data 3 77
how to make geography query faster?  SQL 7 59
Not listening to where 1 39
Question about Common Table Expressions 3 38
In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
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.​
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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