473,396 Members | 1,853 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,396 software developers and data experts.

Need help regarding index keys for MS7 and MS-2K

Hi,

My application needs to calculate the sort order of an index key
(whether the index key is descending or ascending). The user may
connect to MS7 or MS2K servers.

As far as I know, the descending indices are supported in version 8
i.e SQL 2000. In MS2K, I can get the index key information by SELECT
INDEXKEY_PROPERTY(table_ID , index_ID , key_ID , IsDescending) which
returns 1 if key is descending. But as this is only for MS2K, it will
fail and report error for above query in case connected to SQL server
7.

Now, in the application we avoided using server version dependent
code. So, can you please suggest me other way to do the same so that
the query should not produce an error if connected to MS7 server but
should work for MS-2000 server.

Regards,
Uday
Jul 20 '05 #1
1 1991
udayt (ud**@magicsoftware.com) writes:
My application needs to calculate the sort order of an index key
(whether the index key is descending or ascending). The user may
connect to MS7 or MS2K servers.

As far as I know, the descending indices are supported in version 8
i.e SQL 2000. In MS2K, I can get the index key information by SELECT
INDEXKEY_PROPERTY(table_ID , index_ID , key_ID , IsDescending) which
returns 1 if key is descending. But as this is only for MS2K, it will
fail and report error for above query in case connected to SQL server
7.

Now, in the application we avoided using server version dependent
code. So, can you please suggest me other way to do the same so that
the query should not produce an error if connected to MS7 server but
should work for MS-2000 server.


You might be able to find this in status column in some system table,
which if you are lucky are both on SQL7 and SQL2000. However, I would
discourage you from using this, as this column is guaranteed to be
undocumented. The INDEXKEY_PROPERTY function will work in Yukon too,
but there is no guarantee that that status column will.

Having server-version dependent code for this type of thing is perfectly
normal. I have a load tool in which I have no less than three different
versions of some queries against sysindexes - one each for SQL 6.5, SQL 7
and SQL 2000. Have yet to add one for Yukon.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Crew Reynolds | last post by:
I want to create a dictionary of note on/off timings and access it by the name of the object. The following code works for one row. a = "Hammer1" b = notes = {a:b} print notes >>> 45
3
by: Phil Schmidt | last post by:
I'm trying to make a custom entry widget, as in the code that follows. There are two problems I'm trying to fix: 1) I would like the widget to behave as myEntry.Escape() does now, except that it...
5
by: Olivier Crèvecoeur | last post by:
Hello, Excuse me for my poor english. I would kike know if create index on the foreign key it's necessary or if Oracle, are optimized for using foreign key whithout index. Best regards ...
3
by: Randell D. | last post by:
Folks, My internet access is intermitent until I get my own connection inside the next ten days - I say this so that I can thank in advance who ever gives a few seconds to read/answer my...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
15
by: rAinDeEr | last post by:
Suppose i have a table which holds thousands of records with the following structure CREATE TABLE "test "."T_CNTRY" ( "CNTRY_CDE" CHAR(2) NOT NULL , "CNTRY_NAME" VARCHAR(50) ) and i have...
6
by: routeslip | last post by:
I'm refering to an entry in an array by it's string key, as in foo. Is there a way to get the numeric index of that array without iterating through the entire array? What I need to do is find...
10
by: wackyphill | last post by:
After rebuilding an index, it still shows as the same amount of fragmentation. ANy ideas what's wrong? I'm determining which indexes to rebuild using the following query: SELECT...
21
by: Johan Tibell | last post by:
I would be grateful if someone had a minute or two to review my hash table implementation. It's not yet commented but hopefully it's short and idiomatic enough to be readable. Some of the code...
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.