|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
It seems it would be the best for you to introduce you to the wise and
master Books Online! http://msdn.microsoft.com/en-us/libr...3(SQL.90).aspx -- Ekrem Önsoy "Big Lebowski" <BigLebowski@discussions.microsoft.com> wrote in message news:8641A31D-9104-47DE-A3EE-C6FAA3DBB6CF@microsoft.com... > my bad I ment to say > > ALTER TABLE DataCenter > DROP COLUMN Servers CASCADE; > > I am unable to execute it only if I remove the CASCADE, from the statement > > thaks > > BL > > "Eric Isaacs" wrote: > >> CASCADE is not a valid keyword in a DELETE statement in SQL Server... >> >> [ WITH <common_table_expression> [ ,...n ] ] >> DELETE >> [ TOP ( expression ) [ PERCENT ] ] >> [ FROM ] >> { <object> | rowset_function_limited >> [ WITH ( <table_hint_limited> [ ...n ] ) ] >> } >> [ <OUTPUT Clause> ] >> [ FROM <table_source> [ ,...n ] ] >> [ WHERE { <search_condition> >> | { [ CURRENT OF >> { { [ GLOBAL ] cursor_name } >> | cursor_variable_name >> } >> ] >> } >> } >> ] >> [ OPTION ( <Query Hint> [ ,...n ] ) ] >> [; ] >> >> <object> ::= >> { >> [ server_name.database_name.schema_name. >> | database_name. [ schema_name ] . >> | schema_name. >> ] >> table_or_view_name >> } >> >> -Eric Isaacs >> |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Hi
I am unable to execute this statement in SQL express 2005 : DELETE TABLE Servers CASCADE ; If I remove the CASCADE, I am able to execute the statement. why is this so , is this statement for SQL Server/Oracle full installs? thanks for any BL |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Sep 11, 9:07 pm, Big Lebowski
<BigLebow...@discussions.microsoft.com> wrote: > Hi > > I am unable to execute this statement in SQL express 2005 : > > DELETE TABLE Servers CASCADE ; > > If I remove the CASCADE, I am able to execute the statement. > > why is this so , is this statement for SQL Server/Oracle full installs? > > thanks for any > > BL Well I cant understand why are you using CASCADE in delete statement. Delete statement does not support cascade argument. If you are also interested to delete data from related secondary tables you have to create foreign key with on delete cascade or on update cascade Amish Shah http://shahamishm.blogspot.com |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
There is no CASCADE clause in the DELETE statement syntax. Also, there
is no DELETE TABLE. The correct syntax to delete from a table is (assuming Servers is the table name): DELETE FROM Servers; If you have FOREIGN KEY constraints with ON DELETE CASCADE then deletes will be cascaded. -- Plamen Ratchev http://www.SQLStudio.com |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
CASCADE is not a valid keyword in a DELETE statement in SQL Server...
[ WITH <common_table_expression> [ ,...n ] ] DELETE [ TOP ( expression ) [ PERCENT ] ] [ FROM ] { <object> | rowset_function_limited [ WITH ( <table_hint_limited> [ ...n ] ) ] } [ <OUTPUT Clause> ] [ FROM <table_source> [ ,...n ] ] [ WHERE { <search_condition> | { [ CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name } ] } } ] [ OPTION ( <Query Hint> [ ,...n ] ) ] [; ] <object> ::= { [ server_name.database_name.schema_name. | database_name. [ schema_name ] . | schema_name. ] table_or_view_name } -Eric Isaacs |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
my bad I ment to say
ALTER TABLE DataCenter DROP COLUMN Servers CASCADE; I am unable to execute it only if I remove the CASCADE, from the statement thaks BL "Eric Isaacs" wrote: > CASCADE is not a valid keyword in a DELETE statement in SQL Server... > > [ WITH <common_table_expression> [ ,...n ] ] > DELETE > [ TOP ( expression ) [ PERCENT ] ] > [ FROM ] > { <object> | rowset_function_limited > [ WITH ( <table_hint_limited> [ ...n ] ) ] > } > [ <OUTPUT Clause> ] > [ FROM <table_source> [ ,...n ] ] > [ WHERE { <search_condition> > | { [ CURRENT OF > { { [ GLOBAL ] cursor_name } > | cursor_variable_name > } > ] > } > } > ] > [ OPTION ( <Query Hint> [ ,...n ] ) ] > [; ] > > <object> ::= > { > [ server_name.database_name.schema_name. > | database_name. [ schema_name ] . > | schema_name. > ] > table_or_view_name > } > > -Eric Isaacs > |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
There's no CASCADE for ALTER TABLE ... DROP COLUMN either.
I guess you just have to realize that each product has its own dialect and consult the documentation in case you experience any type of strangeness with one command not working on one system... -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi "Big Lebowski" <BigLebowski@discussions.microsoft.com> wrote in message news:8641A31D-9104-47DE-A3EE-C6FAA3DBB6CF@microsoft.com... > my bad I ment to say > > ALTER TABLE DataCenter > DROP COLUMN Servers CASCADE; > > I am unable to execute it only if I remove the CASCADE, from the statement > > thaks > > BL > > "Eric Isaacs" wrote: > >> CASCADE is not a valid keyword in a DELETE statement in SQL Server... >> >> [ WITH <common_table_expression> [ ,...n ] ] >> DELETE >> [ TOP ( expression ) [ PERCENT ] ] >> [ FROM ] >> { <object> | rowset_function_limited >> [ WITH ( <table_hint_limited> [ ...n ] ) ] >> } >> [ <OUTPUT Clause> ] >> [ FROM <table_source> [ ,...n ] ] >> [ WHERE { <search_condition> >> | { [ CURRENT OF >> { { [ GLOBAL ] cursor_name } >> | cursor_variable_name >> } >> ] >> } >> } >> ] >> [ OPTION ( <Query Hint> [ ,...n ] ) ] >> [; ] >> >> <object> ::= >> { >> [ server_name.database_name.schema_name. >> | database_name. [ schema_name ] . >> | schema_name. >> ] >> table_or_view_name >> } >> >> -Eric Isaacs >> |
|
![]() |
| Outils de la discussion | |
|
|