Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 19th, 2005, 07:58 PM
Authorized User
Join Date: Jun 2003
Location: Shah Alam, Selangor, Malaysia.
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete Statement Error


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!



Reply With Quote
  #2 (permalink)  
Old October 21st, 2005, 01:45 PM
Authorized User
Join Date: Oct 2005
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts

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
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 06:04 PM.

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