April 24, 2009 at 7:43 am
OK. Few comments.
The EducationCode and EducationCodeType fields require a non empty string. Are you sure you passing some value into the @EducationCodeDesc parameter?
The procedure code you posted. Is this the entire code? You have @MajorCode param which is not used.
Tha last update you have will update ALL records in your tEDUCATION_CODES table. The where clause does not do any filtering.
---------------------------------------------
[font="Verdana"]Nothing is impossible.
It is just a matter of time and money.[/font]
April 24, 2009 at 7:44 am
I was just playing with that and i noticed that if i give space then am getting error like i mentioned.
As this site is live and users have started regisering , we can expect people just enter all the crap and they dont follow instructions that we provide to enter details.. i think somehow i should handle this throught not to enter spaces...
I will mess with it and see if this is the olny reason why it is causing that error.
If you have any suggestions then please let me know.
Thank you
April 24, 2009 at 7:49 am
I think you meant to do this.
SET @CODE = SCOPE_IDENTITY()
SELECT @CODE AS EducationCodeidno
UPDATE tEDUCATION_CODES set EDucationCodedomainIdno = EducationCodeidno where Educationcodeidno = @CODE
---------------------------------------------
[font="Verdana"]Nothing is impossible.
It is just a matter of time and money.[/font]
April 24, 2009 at 7:59 am
My code in SP seems to be working and where clause is working..
What i wanted to do is that i need to update other column of that table with the ID of that row immediatly after insertion...
because i can not modify table and EducationCodeDomainIDNo shouls be same as the ID of that row...Its weared as the application we bought will work only if those two cloumn values are smae..
Anyways i guess i need to stop users enteing blank values(Spaces).
April 24, 2009 at 9:02 am
Your code might be working but the last UPDATE is updating ALL the records not the last inserted only. Your WHERE caluse is basically saying WHERE 1 = 1.
---------------------------------------------
[font="Verdana"]Nothing is impossible.
It is just a matter of time and money.[/font]
April 24, 2009 at 10:39 am
Hi JacekO,
the issue regarding the update statement for this specific procedure has been discussed in the following thread:
http://www.sqlservercentral.com/Forums/FindPost681895.aspx
Your code snippet in post http://www.sqlservercentral.com/Forums/FindPost703959.aspx is the scripted form of the "verbal" recommendation #1 in post http://www.sqlservercentral.com/Forums/FindPost682567.aspx ... 😉
April 24, 2009 at 11:00 am
Hi Imu92,
How are you doing. Nice to see your reply regarding my post again.
Huhh!! am still facing problems with that issue since then....
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply