Deleting a simple row

  • I am new to sql so please be patient. I have created a database and have entered a bad row. I wish only to delete the row, but I can not I receive the following error message:

    The data in row 296 was not committed.

    Error Source: Microsoft.VisualStudio.DataTools.

    Error Message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(3 rows).

    Correct the errors and retry or press ESC to cancel the change(s)

    However I do not know what the error is nor do I undertstand why not deleting the row does not work.

    Can someone please give me the answer to this query. 😉

  • Did you create a primary key on this table? If not, are there duplicate rows in this table.

    If there are duplicates, are you trying to delete all of them or only a specific number?

    You may try to use the DELETE statement in T-SQL.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • I presumed that I did not need a primary key since I only have one table. T SQL what is that exactly:discuss:

  • terrence_daniels (2/22/2008)


    I presumed that I did not need a primary key since I only have one table. T SQL what is that exactly:discuss:

    T-SQL is a language which you can use to query and modify your database. You could delete rows by executing a statement like

    DELETE FROM theNameOfMyTable

    WHERE nameOfFisrtColumn = 1

    AND nameOfSecondColumn = 'foo'

    I assume currently you are using the graphical user interface (Management Studio) to modify the content of your tables. What it does, is that it translates the modifications into statements like above, and executes them. It has limitations, and if you have duplicate rows (rows that have the same value in all their columns), then it cannot delete them (it does not know how to pick one particular row as all are the same). You could write and create these statements yourself, but it will require some learning. We could help though.

    What are you trying to do? Are you trying to delete a row? What columns does your table have? Do you have duplicate rows?

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • My column names are as follows

    Application Vendor, Application Name, Version, MS Vista Compatible, Confirmation, Contact, Region,

    Business Area, Comments, Unique Identifier.

    When I attempt to run the following statement I receive a syntax error

    DELETE FROM [Vista Application Compatibility] [row] 292

    What should I being writing.

  • terrence_daniels (2/22/2008)


    My column names are as follows

    Application Vendor, Application Name, Version, MS Vista Compatible, Confirmation, Contact, Region,

    Business Area, Comments, Unique Identifier.

    When I attempt to run the following statement I receive a syntax error

    DELETE FROM [Vista Application Compatibility] [row] 292

    What should I being writing.

    Hi,

    the statement should look like someting:

    DELETE FROM [Vista Application Compatibility]

    WHERE [Application Vendor] = 'vendor name'

    AND [Application Name] = 'application name'

    AND Version = 'version'

    AND [MS Vista Compatible= true AND Confirmation = 'confirmation value' AND Contact = 'contactstuff' AND Region = 'regioninfo' AND [Business Area] = 'area'

    AND Comments = 'comment'

    AND [Unique Identifier] = 'uniID'

    You should fill in the condition in a way that it identifies the row you are trying to delete. I.e. if the row you are trying to delete has a

    unique [Unique Identifier] column value, say 12345, then it is enough to execute:

    DELETE FROM [Vista Application Compatibility]

    WHERE [Unique Identifier] = '12345'

    If this does not identify the row uniquely, add additional conditions.

    Back to a previous question, do you have any rows that are duplicated?

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply