Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
madamvegas
Starting Member
3 Posts |
Posted - 2012-05-10 : 11:03:52
|
| I have this access query that I need to convert to sql and not quite sure what to use.UPDATE Attribute_Data SET Attribute_Data.AttValue = Int([AttValue])WHERE (((IsNumeric([AttValue]))=-1) AND ((Right([AttValue],2))=".0")) OR (((IsNumeric([AttValue]))=-1) AND ((Right([AttValue],3))=".00")) OR (((IsNumeric([AttValue]))=-1) AND ((Right([AttValue],4))=".000")) OR (((IsNumeric([AttValue]))=-1) AND ((Right([AttValue],5))=".0000")) OR (((IsNumeric([AttValue]))=-1) AND ((Right([AttValue],6))=".00000"))Theresa Burk |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-05-10 : 11:41:16
|
Something like this?UPDATE Attribute_Data SET Attribute_Data.AttValue = CAST([AttValue] AS INT)WHERE ISNUMERIC([AttValue]) = 1 AND FLOOR([AttValue]) = [AttValue] Most people who work with relational databases such as SQL Server would advise against using entity-attribute type of data storage. So if you have an opportunity to redesign the tables that would be something to keep in mind. |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
|
|
|
|