473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

information_schema.key_column_usage system table

12
How do you change the order of key columns in a primary key and view the difference between two tables that have the same name?

For example, table x has a primary key called pk_x. PK_x contains two key columns x and y in the order 1 and 2 now I want to change it so that columns x and y are 2 and 1. How do I do that?
Jan 4 '08 #1
2 2247
ck9663
2,878 Expert 2GB
i have not fully research about this, but i don't think it matters what the sequence of primary keys is. i think sql server's query optimization can intelligently handle your query as long as you have index on the most frequently searched keys/columns. it's also recommended that if the table will only have one index, make it clustered.

-- CK
Jan 6 '08 #2
parkc
12
Thank you for the response however, I am wanting to see if the order in which primary key columns have changed from one database to another. Therefore, it is important to know how to change the ordinal position for testing purposes.
Jan 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Pachydermitis | last post by:
Hi I need to see all the indexes in a database. The ID has dbo rights to the database, but not to the master. I can't see anything in INFORMATION_SCHEMA.CHECK_CONSTRAINTS or...
3
by: Tina Harris | last post by:
I ran the following query in Query Analyzer for a 7 column table. SELECT c.name,c.colid FROM syscolumns c WHERE c.id=925962375 ORDER BY c.colid The results were: I_CSD 1 X_STE_XML 2...
3
by: Dave Sisk | last post by:
Hi Folks: I'm a little new to SQLServer, so please pardon my ignorance! I've found the INFORMATION_SCHEMA views for TABLES, COLUMNS, and TABLE_CONSTRAINTS. I'm looking for the views that will...
0
by: Mark Johnson | last post by:
Is it possible that "information_schema.schemata" does not allways work correctly in MSDE Sql-Server. I have built an Explorer that will find the Servers (MSDE and SQL-Server 2000) and then...
1
by: HSalim | last post by:
Hello: Does DB2 support the information_schema views into meta data? if not, what is the equivalent? Thanks HS
14
by: mike.griffin | last post by:
This is part of the Columns View, if you add a numeric field to your table and don't provide any Length or Precision then : numeric_precision is returned as 65535 numeric_scale is returned as...
0
by: BB | last post by:
Hi There, just moved over from SQL Server to mySQL and finding my way about. In SQL Server there was a way of retrieving (and setting) metaproperties for columns and tables. The closest I see to...
1
by: Shrek | last post by:
if I select character_maximum_length from INFORMATION_SCHEMA.COLUMNS if returns -1 on columns that are defined as varchar(max) is this normal???
2
by: amit2781 | last post by:
Hi, I have created 4 tables in 'amit' database and then I deleted them. Still I able to get information about the table_schema for the table deleted. After drop table when I fire a query for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.