Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
wsilage
Yak Posting Veteran
82 Posts |
Posted - 2015-02-06 : 07:50:35
|
I have a question Right now we have 2 tables one table is called Regions and within that table we have thisID Name221 0221_ms224 0224_tu226 0226_arOur other table has this and the name of that table is called Regionstates.ID Name221 AZ224 LA226 CTNow they want to change the names of the users that get the IDs from the first table to.ID Name224 0221_ms226 0224_tu221 0226_arMy questions is and I never delt with Primary key clustered before. If I change the above, will that affect anyting? Also I was thinking of making the names a little more genericI was thinking of labeling them.ID Name224 Region1226 Region2221 Region3Would this mess up my table? Like I said I have never used clusters before see sampleThis is the Region States tableCREATE TABLE [dbo].[RegionStates]( [RegionID] [smallint] NOT NULL, [State] [char](2) NOT NULL, CONSTRAINT [PK_RegionStates] PRIMARY KEY CLUSTERED ( [RegionID] ASC, [State] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOSET ANSI_PADDING OFFGOALTER TABLE [dbo].[RegionStates] WITH CHECK ADD CONSTRAINT [FK_RegionStates_Regions] FOREIGN KEY([RegionID])REFERENCES [dbo].[Regions] ([ID])GOALTER TABLE [dbo].[RegionStates] CHECK CONSTRAINT [FK_RegionStates_Regions]GOALTER TABLE [dbo].[RegionStates] WITH CHECK ADD CONSTRAINT [FK_RegionStates_USStates] FOREIGN KEY([State])REFERENCES [dbo].[USStates] ([StateCode])GOALTER TABLE [dbo].[RegionStates] CHECK CONSTRAINT [FK_RegionStates_USStates]GOThis is the Region tableCREATE TABLE [dbo].[RegionsTEST]( [ID] [smallint] NOT NULL, [Name] [varchar](50) NOT NULL, CONSTRAINT [PK_Regions] PRIMARY KEY CLUSTERED ( [ID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOSET ANSI_PADDING OFFGO |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2015-02-06 : 08:21:42
|
You wanted to update the data based on your requirement.. thats it right?So no need to worry about CLUSTERED PRIMARY KEYs....--Chandu |
|
|
wsilage
Yak Posting Veteran
82 Posts |
Posted - 2015-02-06 : 08:43:45
|
quote: Originally posted by bandi You wanted to update the data based on your requirement.. thats it right?So no need to worry about CLUSTERED PRIMARY KEYs....--Chandu
Yes I want to update the base table which. Thanks so much! |
|
|
|
|
|
|
|