473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

on delete cascade problem

Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a
connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch
to the sql view, and perform it, it complains about a syntax error at
the word "delete".

does anyone know why that is?

thanks
Nov 13 '05 #1
3 3150
hilz wrote:
Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a
connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch
to the sql view, and perform it, it complains about a syntax error at
the word "delete".

does anyone know why that is?

thanks


no takers?
Nov 13 '05 #2
hilz wrote:
hilz wrote:
Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a
connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch
to the sql view, and perform it, it complains about a syntax error at
the word "delete".

does anyone know why that is?

thanks

no takers?


I assume the back-end database is something like SQL Server?

Access SQL is slightly different to T-SQL, if you made your query a
"pass through" one it would probably work apart from the fact you
already created the constraint so it would probably complain about that :-)
Nov 13 '05 #3

"hilz" <no*@y.com> wrote in message
news:eUA8f.4995$UM1.1460@dukeread10...
hilz wrote:
Hi all
I am trying to create a relation between two tables.

this is the sql statement in question

alter table T1
add constraint relation_T1_to_T2
foreign key (T2_ID)
references T2 (ID) on delete cascade;

This relation is created fine if i execute the SQL statement using a connection to the database.
but if i open the datbase in MSACCESS and open the query build, switch to the sql view, and perform it, it complains about a syntax error at the word "delete".

does anyone know why that is?

thanks


no takers?


hilz,

You may not execute CASCADE clauses via MS Access Query Objects.

I *believe* you must use DAO and execute the SQL directly.
Sincerely,

Chris O.
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
3
by: cfxchange | last post by:
I am looking into work-arounds for what seems to be a flaw, or "undocumented feature" of SQL Server replication and Instead of Delete triggers not playing together. It seems that if you want to...
2
by: P.B. via SQLMonster.com | last post by:
I cannot execute my sql to create a table with ON DELETE CASCADE option. Here is my sql: CREATE TABLE Employees (Name Text(10) not null, Age number, CONSTRAINT pkEmployees PRIMARY KEY (Name)); ...
8
by: jim | last post by:
I have two tables that are related by keys. For instance, Table employee { last_name char(40) not null, first_name char(40) not null, department_name char(40) not null, age int not null, ......
9
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the...
6
by: Paul T. Rong | last post by:
Dear all, Here is my problem: There is a table "products" in my access database, since some of the products are out of date and stopped manufacture, I would like to delete those PRODUCTS from...
3
by: John Rivers | last post by:
Hello, I think this will apply to alot of web applications: users want the ability to delete a record in table x this record is related to records in other tables and those to others in...
14
by: Karl O. Pinc | last post by:
Hi, Thought perhaps some other eyes than mine can tell if I'm doing something wrong here or if there's a bug somewhere. I've never passed a ROWTYPE varaible to a function but I don't see where...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
0
by: Cirene | last post by:
Can you assist me with this database problem? I have 4 tables in my db.... Table1 (key: Table1Id) Table2 (key: Table2Id) Table3 (key: Table3Id) Table 4 has these fields: key: Table4Id...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.