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 |
|
pharoah35
Yak Posting Veteran
81 Posts |
Posted - 2003-09-09 : 08:58:18
|
| Good morning good people.I am having a bit of a problem with the following T-SQL Syntax.I was hoping that one of you kind Ladies or Gentlemen could lend some assistance.I am referencing 2 tables listed below via the Select statementdbo.tblproitem & dbo.tblingrampb, I need to update the [Brand] column in table dbo.tblingrampb with 'COMPAQ' where the value in column [vendid] in table dbo.tblproitem is the same as the value in [vend id] in table dbo.tblingrampb and the [progid] in table dbo.tblproitem = 21099Here is the syntax I used. ----------------------------------------------------------------------SELECT * from dbo.tblproitem, dbo.tblingrampbupdate dbo.tblingrampbset dbo.tblingrampb.[Brand] = 'COMPAQ'Where dbo.tblproitem.[vendid] = dbo.tblingrampb.[vend id] and dbo.tblproitem.[ProgID] = '21099'----------------------------------------------------------------------I get the following error message via QA (Query Analyzer)----------------------------------------------------------------------Server: Msg 107, Level 16, State 3, Line 1The column prefix 'dbo.tblproitem' does not match with a table name or alias name used in the query.Server: Msg 107, Level 16, State 1, Line 1The column prefix 'dbo.tblproitem' does not match with a table name or alias name used in the query.----------------------------------------------------------------------I would appreciate any assistance you may be able to provideThanks in advancePharoah35 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2003-09-09 : 09:36:14
|
You're almost there...update dbo.tblingrampbset dbo.tblingrampb.[Brand] = 'COMPAQ'FROM dbo.tblingrampbINNER JOIN dbo.tblproitem ONdbo.tblproitem.[vendid] = dbo.tblingrampb.[vend id]Where dbo.tblproitem.[ProgID] = '21099' -------Moo. :) |
 |
|
|
pharoah35
Yak Posting Veteran
81 Posts |
Posted - 2003-09-09 : 10:51:27
|
| Dear Mr MistThank you so very much for your assistance.That really did the trick.Thanks againPharoah35 |
 |
|
|
|
|
|