I forgot to check the keys and constraints box in enterprise manager
"generate sql script".....this is what it looks like now:
Iam assuming that the rows will retain integrity....is this a correct
assumption?
Thank you
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[SkinnerSaw_Thickness]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[SkinnerSaw_Thickness]
GO
CREATE TABLE [dbo].[SkinnerSaw_Thickness] (
[Counter] [bigint] IDENTITY (1, 1) NOT NULL ,
[Date] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Time] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[BlankID] [int] NOT NULL ,
[TargetThickness] [real] NOT NULL ,
[MaxThickness] [real] NOT NULL ,
[MinThickness] [real] NOT NULL ,
[ActualPanelThickness] [real] NOT NULL ,
[TopReading1] [real] NOT NULL ,
[TopReading2] [real] NOT NULL ,
[TopReading3] [real] NOT NULL ,
[TopReading4] [real] NOT NULL ,
[TopReading5] [real] NOT NULL ,
[TopReading6] [real] NOT NULL ,
[TopReading7] [real] NOT NULL ,
[TopReading8] [real] NOT NULL ,
[TopReading9] [real] NOT NULL ,
[TopReading10] [real] NOT NULL ,
[BottomReading1] [real] NOT NULL ,
[BottomReading2] [real] NOT NULL ,
[BottomReading3] [real] NOT NULL ,
[BottomReading4] [real] NOT NULL ,
[BottomReading5] [real] NOT NULL ,
[BottomReading6] [real] NOT NULL ,
[BottomReading7] [real] NOT NULL ,
[BottomReading8] [real] NOT NULL ,
[BottomReading9] [real] NOT NULL ,
[BottomReading10] [real] NOT NULL ,
[Blow] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[BlowDetectorOn] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SkinnerSaw_Thickness] WITH NOCHECK ADD
CONSTRAINT [PK_SkinnerSaw_Thickness] PRIMARY KEY CLUSTERED
(
[Counter]
) ON [PRIMARY]
GO
[quoted text, click to view] "David Portas" wrote:
> "ktm400" <ktm400@discussions.microsoft.com> wrote in message
> news:0BB41251-B5C7-4725-B0EB-2E5CC1DFDA18@microsoft.com...
> >I am very new to sql and would like somebody to tell me if the following
> > table will maintain its integrity ....by this I mean if somebody other
> > than
> > the database owner or someone who has permission to write data to the
> > table.
> > Thanks for any help
> >
> > if exists (select * from dbo.sysobjects where id =
> > object_id(N'[dbo].[SkinnerSaw_Thickness]') and OBJECTPROPERTY(id,
> > N'IsUserTable') = 1)
> > drop table [dbo].[SkinnerSaw_Thickness]
> > GO
> >
> > CREATE TABLE [dbo].[SkinnerSaw_Thickness] (
> > [Counter] [bigint] IDENTITY (1, 1) NOT NULL ,
> > [Date] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> > [Time] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> > [BlankID] [int] NOT NULL ,
> > [TargetThickness] [real] NOT NULL ,
> > [MaxThickness] [real] NOT NULL ,
> > [MinThickness] [real] NOT NULL ,
> > [ActualPanelThickness] [real] NOT NULL ,
> > [TopReading1] [real] NOT NULL ,
> > [TopReading2] [real] NOT NULL ,
> > [TopReading3] [real] NOT NULL ,
> > [TopReading4] [real] NOT NULL ,
> > [TopReading5] [real] NOT NULL ,
> > [TopReading6] [real] NOT NULL ,
> > [TopReading7] [real] NOT NULL ,
> > [TopReading8] [real] NOT NULL ,
> > [TopReading9] [real] NOT NULL ,
> > [TopReading10] [real] NOT NULL ,
> > [BottomReading1] [real] NOT NULL ,
> > [BottomReading2] [real] NOT NULL ,
> > [BottomReading3] [real] NOT NULL ,
> > [BottomReading4] [real] NOT NULL ,
> > [BottomReading5] [real] NOT NULL ,
> > [BottomReading6] [real] NOT NULL ,
> > [BottomReading7] [real] NOT NULL ,
> > [BottomReading8] [real] NOT NULL ,
> > [BottomReading9] [real] NOT NULL ,
> > [BottomReading10] [real] NOT NULL ,
> > [Blow] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> > [BlowDetectorOn] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> > ) ON [PRIMARY]
> > GO
> >
> >
>
> No keys = no integrity. Since you didn't post any I have to assume that the
> answer is No. There are plenty of other problems here too:
>
> The numbered columns 1-10 look like what's usually called a Repeating Group.
> Repeating groups are a fundamentally bad design for lots of important
> reasons.
>
> "Counter", "Date" and "Time" are pretty useless column names. They tell us
> virtually nothing about the attributes in question. Names are important,
> don't neglect them.
>
> Why two CHAR columns for date and time? Why not DATETIME?
>
> Do you know the difference between exact and inexact numeric datatypes and
> are you sure you want to use inexact numerics for all the Readings?
>
> Why BIGINT for the IDENTITY column? Do you expect 10^19 rows! Chances are
> INTEGER will be more than sufficient.
>
> Hopefully this has given you some things to think about and lookup in the
> documentation. Unfortunately newsgroups aren't the place for design
> tutorials. Logical design requires more knowledge of the concepts you are
> modelling than can be adequately conveyed in an online discussion.
>
> --
> David Portas
> SQL Server MVP
> --
>
>