Re: some error in table definition



On 10月31日, 上午11时00分, "Roy Harvey (SQL Server MVP)"
<roy_har...@xxxxxxxx> wrote:
On Tue, 30 Oct 2007 22:13:05 +0000 (UTC), Erland Sommarskog

<esq...@xxxxxxxxxxxxx> wrote:
When you get past that you will find that CLUSTERD is not the correct
spelling of the keyword CLUSTERED. And you might prefer to spell
ORIGIONAL as ORIGINAL, and if REPLYD is supposed to be the past tense
of REPLY then you might want REPLYED.
Any particular reason he might want precisely that spelling? Do you
happen to know that REPLYED is preferred over REPLIED in China? :-)

I have no idea about what is preferred, except in English, but it
appeared that the names might be intended to be in English. Which is
why I said "might" and "perhaps".

I once wrote an entire forecasting system, misspelling forecast as
forcast. I ended up fixing report headings when the users noticed,
but left all the variables and field names alone. The poor guy who
took over when I left knew how to spell it though and it drove him
nuts.

Roy Harvey
Beacon Falls, CT

if exists(select * from dbo.sysobjects where id =
object_id(N'BBSItems')
and OBJECTPROPERTY(id,N'IsUserTable')=1)
drop table BBSItems
GO

CREATE TABLE BBSItems(
ITEM_ID int IDENTITY(1,1) NOT NULL,
ITEM_TITLE nvarchar(30) COLLATE Chinese_PRC_CS_AS NOT NULL,
ITEM_CONTENT nvarchar(3000) COLLATE Chinese_PRC_CS_AS NOT NULL,
COMPOSE_DATE smalldatetime NOT NULL,
MODIFY_DATE smalldatetime NULL,
IS_ORIGIONAL bit NOT NULL
CONSTRAINT DF_BBSItem_IS_ORIGIONAL DEFAULT(0),
AUTHOR nvarchar(15) COLLATE Chinese_PRC_CS_AS NOT NULL,
FATHER_ID int NULL,
REPLYD_TIMES smallint NOT NULL
CONSTRAINT DF_BBSItem_REPLYD_TIMES DEFAULT(0),
BROWSED_TIMES smallint NOT NULL
CONSTRAINT DF_BBSItem_BROWSED_TIMES DEFAULT(0),
LATEST_REPLICATION_ID int NULL,
CONSTRAINT PK_BBSItems PRIMARY KEY CLUSTERED
(
ITEM_ID
) ON PRIMARY,
CONSTRAINT FK_BBSItem_BBSItem1 FOREIGN KEY
(
LATEST_REPLICATION_ID
)REFERENCES BBSItems(
ITEM_ID),
CONSTRAINT FK_BBSItem_UserInfo FOREIGN KEY
(
AUTHOR
)REFERENCES userinfo(nickname)
)
ON PRIMARY
GO

wrong in row 20 near keyword primary

.



Relevant Pages

  • Re: some error in table definition
    ... Roy Harvey ... And you might prefer to spell ... Any particular reason he might want precisely that spelling? ... CONSTRAINT DF_BBSItem_IS_ORIGIONAL DEFAULT, ...
    (comp.databases.ms-sqlserver)
  • Re: some error in table definition
    ... And you might prefer to spell ... Any particular reason he might want precisely that spelling? ... CONSTRAINT DF_BBSItem_IS_ORIGIONAL DEFAULT, ... CONSTRAINT FK_BBSItem_BBSItem1 FOREIGN KEY ...
    (comp.databases.ms-sqlserver)
  • Re: New to SQL server
    ... [CONSTRAINT constraint_name] ... | [FOREIGN KEY] ... Is the name of the database in which the table is created. ... REFERENCES permission on the type is ...
    (microsoft.public.access.adp.sqlserver)
  • Problem merging two queries
    ... CONSTRAINT PRIMARY KEY CLUSTERED ... REFERENCES ( ... CONSTRAINT FOREIGN KEY ...
    (microsoft.public.sqlserver.programming)
  • Re: Selecting data from one table and putting into another
    ... here is the ddl for a good> portion of this, so if the name ever changed there would be a big problem> since the name is a foreign key reference to a parent table... ... > ALTER TABLE.WITH NOCHECK ADD> ... > CONSTRAINT PRIMARY KEY CLUSTERED> ... >) ON DELETE CASCADE ON UPDATE CASCADE> ...
    (microsoft.public.sqlserver.programming)