Re: Simple join problem (I think!)



"RS200Phil" <philsowden@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1138644205.614132.301400@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I'm tearing my hair out on the simplest of queries (SQL Server 2k).
> I'm using ASP and the code I was using worked fine when attached to an
> Access MDB, but I can't crack it under SQL Server.
>
> This is the code I'm trying in the SQL Query analyzer:
>
> Update ClientTable inner join Cancellations on ClientTable.mobileno =
> Cancellations.mobileno set ClientTable .ExpiryReason = 888,
> Cancellations.Cancelled = true
>
> The word "join" is greyed out and I'm getting the error:
> Incorrect syntax near the keyword 'inner'.
>
> I'm sure it's something obvious, but I can't see the wood for the
> trees!
>
> Can anyone help???
>
> TIA
>
> Phil


You are writing ASP with a connection to a SQL Server database? It doesn't
really have much to do with MS Access, does it? Anyway, apart from the
extra space which has been pointed out, there is a more fundamental issue.
SQL statements for Access (Jet) and those for SQL Server are not necessarily
interchangeable - what might work in one might not in the other. Update
queries are one of those things. You cannot hope to update two tables
simultaneously with one SQL statement. Either create a stored procedure to
do this or wrap two updates in a single transaction.


.



Relevant Pages

  • Connection.Execute and SQL stored procedures
    ... ..asp, the connection object and MS SQL Server as the DB can help me out. ... Five of the six calls execute as expected. ... This particular stored procedure does quite a bit of work within the DB, ...
    (microsoft.public.sqlserver.odbc)
  • Re: Heres a rather broad question...
    ... I'm familiar enough with using ADO with VBScript/Javascript in ASP pages, ... authentication or permission issues with SQL Server 2000. ... IIS user doesn't have the proper permissions to access the database, ...
    (microsoft.public.data.ado)
  • Re: WAP, ASP engineer required - London
    ... > at the company I work for we need to hire in London a WAP ASP engineer ... > You should have experience of SQL Server database design and as ... online service development the ideal ... > candidate will be technically minded and have experience in SQL Server ...
    (microsoft.public.inetserver.asp.general)
  • Re: Need some fresh ideas
    ... I have an upload form that allows a user to browse and select ... asp server script validates the input ... SQL Server to it ... * editFile updates the form data. ...
    (comp.lang.javascript)
  • Re: Test Platform for ASP [newbie]
    ... need an add in such as sun ASP ONE server. ... > 6.0 which will be deployed on IIS & a MS SQL Server db. ... > waste time & petrol & give up on flexibility. ... > Do I need IIServer for this or is there an alternative? ...
    (microsoft.public.inetserver.asp.db)