PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > SQl Express Question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
SQl Express Question

Réponse
 
LinkBack Outils de la discussion
Vieux 11/09/2008, 12h41   #1
Ekrem Önsoy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQl Express Question

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
>>


  Réponse avec citation
Vieux 11/09/2008, 18h07   #2
Big Lebowski
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SQl Express Question

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
  Réponse avec citation
Vieux 11/09/2008, 18h23   #3
amish
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQl Express Question

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

  Réponse avec citation
Vieux 11/09/2008, 18h25   #4
Plamen Ratchev
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQl Express Question

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
  Réponse avec citation
Vieux 11/09/2008, 18h27   #5
Eric Isaacs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQl Express Question

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
  Réponse avec citation
Vieux 11/09/2008, 19h20   #6
Big Lebowski
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQl Express Question

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
>

  Réponse avec citation
Vieux 11/09/2008, 19h26   #7
Tibor Karaszi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SQl Express Question

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
>>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h24.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13066 seconds with 15 queries