| Author |
Topic |
|
smithani
Starting Member
42 Posts |
Posted - 2007-08-27 : 14:55:06
|
| Here is my update statements which doesn't work, can you show me an example or provide a hint.thanksupdate property inner join propinv on propinvid=propertyinvidset property.lotsize='100'where property.lotsize <> '' and property.lotize is not nullThank you |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-27 : 14:56:42
|
[code]update x set x.lotsize = '100'FROM property AS xinner join propinv on <tablename-or alias-here>.propinvid = <tablename-or alias-here>.propertyinvidwhere property.lotsize > ''[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-27 : 14:58:19
|
| [code]update Pset P.lotsize='100'From Property Pinner join propinv PV on PV.propinvid = P.propertyinvidwhere P.lotsize <> '' and P.lotize is not null[/code]Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
smithani
Starting Member
42 Posts |
Posted - 2007-08-27 : 15:07:31
|
| guys thanks for your input, but I had to change my sql a little bit and still get the same error.update Pset P.lotsize=propinv.lotsizeFrom Property Pinner join propinv PV on PV.propinvid = P.propertyinvidwhere P.lotsize <> '' and P.lotize is not null |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-27 : 15:09:28
|
Which error do you get now? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
smithani
Starting Member
42 Posts |
Posted - 2007-08-27 : 15:10:30
|
| Incorrect syntax near the keyword 'update'. |
 |
|
|
smithani
Starting Member
42 Posts |
Posted - 2007-08-27 : 15:12:27
|
| sorry, it had to do with my datatypes, thanks for your input, it really helped |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-27 : 15:12:44
|
quote: Originally posted by smithani Incorrect syntax near the keyword 'update'.
Are you using MICROSOFT SQL Server 2000 or 2005?Or are you using MS Access? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
smithani
Starting Member
42 Posts |
Posted - 2007-08-27 : 15:16:03
|
| I am using sql server 2005 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-08-28 : 03:10:03
|
quote: Originally posted by smithani I am using sql server 2005
Syntax is same in both 2000 and 2005. If you use ACCESS it slightly changesMadhivananFailing to plan is Planning to fail |
 |
|
|
|