No,,,there is no  FK between Companies.CityID and Cities.CityID. Like I
said...I inherited a nasty mess.

On Sat, Jan 5, 2013 at 2:37 PM, Adrian Klaver <[email protected]>wrote:

> On 01/05/2013 12:21 PM, Carey Gagnon wrote:
>
>> Not sure what info you need Adrian. Will this do?
>>
>> CREATE TABLE [dbo].[Companies](
>>      [CompanyID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
>>      [CompanyName] [nvarchar](50) NOT NULL,
>>      [Address] [nvarchar](50) NOT NULL,
>>      [City] [nvarchar](50) NULL,
>>      [CityID] [int] NULL,
>>      [ProvinceState] [nvarchar](2) NULL,
>>      [Country] [nvarchar](50) NULL,
>>      [PostalZIP] [nvarchar](50) NULL,
>>      [Phone] [nvarchar](50) NULL,
>>      [Fax] [nvarchar](50) NULL,
>>      [Website] [nvarchar](50) NULL,
>>      [InactiveCompany] [bit] NOT NULL,
>>      [CompanyActivationDate] [datetime] NOT NULL,
>>      [CompanyInactivationDate] [datetime] NULL,
>>      [CompanyCreator] [nvarchar](50) NOT NULL,
>>      [ParentCompanyID] [int] NULL,
>>      [CompanyRating] [nvarchar](50) NULL,
>>   CONSTRAINT [PK_Companies] PRIMARY KEY CLUSTERED
>>
>
> There is no FK between Companies.CityID and Cities.CityID ?
>
>
>
>>
>> CREATE TABLE [dbo].[Cities](
>>      [CityID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
>>      [CityName] [nvarchar](64) NOT NULL,
>>      [ProvinceState] [nvarchar](2) NOT NULL,
>>   CONSTRAINT [PK_Cities] PRIMARY KEY CLUSTERED
>> ALTER TABLE [dbo].[Cities]  WITH CHECK ADD  CONSTRAINT
>> [FK_Cities_ProvinceState] FOREIGN KEY([ProvinceState])
>> REFERENCES [dbo].[ProvinceState] ([ProvinceState])
>>
>>
>> CREATE TABLE [dbo].[ProvinceState](
>>      [ProvinceState] [nvarchar](2) NOT NULL,
>>      [Country] [nvarchar](50) NOT NULL,
>>   CONSTRAINT [PK_ProvinceState] PRIMARY KEY CLUSTERED
>>
>> Carey
>>
>
>
>
> --
> Adrian Klaver
> [email protected]
>


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/CAMGTPFHPhhZCsr3=3BMdCr4Gmyfn2acu7XjuE=--xfzut4n...@mail.gmail.com

Reply via email to