Showing posts with label alter. Show all posts
Showing posts with label alter. Show all posts

Friday, February 24, 2012

ERROR - The row value(s) updated or deleted either do not make the row unique or they alter mult

i am getting the above error on my database i have 2 rows with the same info on and another 2 with the same info on. example:

ID username password

1 bob bob

1 bob bob

1 john john

1 john john

I know this is a fault with ms sql 2005 however how do i fix it?

Ive found this link which explains everything but how do i start a query. I tried clicking on new query and copying the code. What is table1 meant to be? the database is dbl.tbl_admin. It wont find my database.

Im not sure how to do it anyway.

I need to change it though as its my admin password and Ive given it out to web design companys

http://geekswithblogs.net/allensb/archive/2006/07/27/86484.aspx

Can some 1 read the above page and give me full instructions, I dont know what im doing thanks

info@.uktattoostudios.co.uk

hi,

follow solution 3:

open (and download SQL Server Management Studio Express at http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en) SQL Server Management Studio Express..

connect to the desired SQL Server instance... select "New Query".. in the database combo box select your database..

execute the

ALTER TABLE dbo.tbl_admin ADD TempID int IDENTITY(1, 1);

this will add a new unique column to tyou tbl_admin table, and this column is a valid alternate candidate key...

if you do not have a primary key defined in your table, execute

ALTER TABLE dbo.tbl_admin

ADD CONSTRAINT pk_tbl_admin

PRIMARY KEY (TempId);

this will generate a primary key based on the TempId column of your table..

you can then purge your duplicate data as desired/required...

regards

|||hi, thanks for that its sorted. the reason it didnt work before was I didnt choose a database for the query to work on. master was the default just change it to my database and your code worked fine. many thanks

ERROR - The row value(s) updated or deleted either do not make the row unique or they alter

i am getting the above error on my database i have 2 rows with the same info on and another 2 with the same info on. example:

ID username password

1 bob bob

1 bob bob

1 john john

1 john john

I know this is a fault with ms sql 2005 however how do i fix it?

Ive found this link which explains everything but how do i start a query. I tried clicking on new query and copying the code. What is table1 meant to be? the database is dbl.tbl_admin. It wont find my database.

Im not sure how to do it anyway.

I need to change it though as its my admin password and Ive given it out to web design companys

http://geekswithblogs.net/allensb/archive/2006/07/27/86484.aspx

Can some 1 read the above page and give me full instructions, I dont know what im doing thanks

info@.uktattoostudios.co.uk

hi,

follow solution 3:

open (and download SQL Server Management Studio Express at http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en) SQL Server Management Studio Express..

connect to the desired SQL Server instance... select "New Query".. in the database combo box select your database..

execute the

ALTER TABLE dbo.tbl_admin ADD TempID int IDENTITY(1, 1);

this will add a new unique column to tyou tbl_admin table, and this column is a valid alternate candidate key...

if you do not have a primary key defined in your table, execute

ALTER TABLE dbo.tbl_admin

ADD CONSTRAINT pk_tbl_admin

PRIMARY KEY (TempId);

this will generate a primary key based on the TempId column of your table..

you can then purge your duplicate data as desired/required...

regards

|||hi, thanks for that its sorted. the reason it didnt work before was I didnt choose a database for the query to work on. master was the default just change it to my database and your code worked fine. many thanks

Friday, February 17, 2012

Error

I get this error message when I alter my stored procedure. Can someone help me out plsAdd parentheses around the string.

-PatP|||Why aren't you using the templates I showed you?

In any event, post the code not a picture...

But switch to

IF @.@.ERROR <> 0

But my guess is it's before that|||I'm 99% sure that the problem is just needing parentheses around the string after RAISERROR.

She probably got the 0 <> @.@.error from some of my code. Is there anybody that can guess why I almost always put constants on the left?

-PatP|||No clue...I thought that wasn't a good thing....|||The problem goes back to the days of cruddy compilers, and poor language syntax. This is just an example, but you can interpret the construct:SELECT @.a = 0to mean two very different things. You can only interpret the construct:SELECT 0 = @.aone way. Once upon a time, Transact-SQL could get confused, and many other tools still have the same problem. By always using an expression that can't be an l-value on the left side of a comparison, there is almost no chance that the code can be mis-interpreted.

There was actually one mainframe language that would let you assign new values to constants. That one confounded even me, but it was such a weird thing that I'm not too defensive about it! I doubt that it will happen again, but it was weird being allowed to redefine the value of zero!

-PatP|||I did get the @.@.Error from pats coding and I looked it up on the internet after I did a post here and that helped me to determine how to better use it and troubleshoot. I do love Google..sometime Books online does not give you enough information. Also you guys those Transact SQL books youi refered me to are awesome. they answer alot of question and are a wonderful source of info on programming (for those of us new to the programming concept)|||works great guys thanks again :):):)