Results 1 to 4 of 4

Thread: Data appears TWICE in table

  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Data appears TWICE in table

    I'm JUST getting started with the online SQL tutorial. When I create a table and insert data, the data appears TWICE. A simple example:

    ***Create the table:

    create table rnmrgntable
    (first varchar(20),
    last varchar(30));

    ***Insert data:

    insert into rnmrgntable
    (first, last)
    values ('Bill' , 'Smith');

    ***Then look at the table:

    select * from rnmrgntable;

    And I get:

    first last
    Bill Smith
    Bill Smith

    What the heck's going on? It's really frustrating to try to start learning something new and not even be able to get through the first lesson!

  2. #2
    Join Date
    Mar 2003
    Location
    NJ
    Posts
    201
    Hey, it's not possible sql server will insert two times without your command!

    Maybe it's because you execute twice the insert statement, or you have insert trigger define on the table( since you just start it, I dont think this is possible)

  3. #3
    Join Date
    Mar 2004
    Posts
    4

    Data appears TWICE in table

    Originally posted by Claire
    Hey, it's not possible sql server will insert two times without your command!

    Maybe it's because you execute twice the insert statement, or you have insert trigger define on the table( since you just start it, I dont think this is possible)
    No, I didn't execute the insert statement twice. I entered the code EXACTLY as written above. The lines with the "***" were NOT entered, of course.

  4. #4
    Join Date
    Mar 2003
    Posts
    468
    what interface our you using?
    is this through a third party site or do you have sqlserver installed on your own system.

    if it is through someones website, they may be terminating and executing for you, thus you may need to leave off the ';' termination character.

    i would suggest you drop the table and begin again and then post the results here again without the comments and just cut and paste the full session.


    to drop the table :
    drop table rnmrgntable;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •