Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 19th, 2005, 07:58 PM
Authorized User
 
Join Date: Jun 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete Statement Error

Hi,

I having a problem when i write SQL statement for deletion using parameter. my statement as below:

delete tablea
from tablea as a ,tableb as b
where a.ord_no=b.ord_no
and b.ord_date=? (? is a parameter i had set into my DTS)

why it give me error as this:



Error source : Microsoft OLE DB Porvider for SQL Server

Error Description : The column prefix 'a' does not match with a table name or alias name used in the query.



anyone can you give me a advise how to resolve a problem as above!

Urgent!

Thanks


Jane
 
Old October 21st, 2005, 01:45 PM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Once you assigned an alias to a table, you should always be using that alias:

delete a
from tablea as a ,tableb as b
where a.ord_no=b.ord_no
and b.ord_date=?

SQL Server Helper
http://www.sql-server-helper.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
problem with delete statement thas123 SQL Server 2000 6 March 23rd, 2006 01:13 PM
T-SQL Delete statement Alcapone C# 3 November 3rd, 2004 01:08 PM
sql delete statement sand133 VB Databases Basics 2 July 7th, 2004 10:56 PM
DELETE statement with ASP.NET kaz VS.NET 2002/2003 1 December 9th, 2003 09:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.