Hi,guys!
I have a table below:
CREATE TABLE rsccategory
(
categoryid NUMERIC(2) IDENTITY(1,1),
categoryname VARCHAR(20) NOT NULL,
PRIMARY KEY(categoryid)
)
Then I do:
INSERT rsccategory(cat egoryname) VALUES('url')
INSERT rsccategory(cat egoryname) VALUES('documen t')
INSERT rsccategory(cat egoryname) VALUES('book')
INSERT rsccategory(cat egoryname) VALUES('softwar e')
INSERT rsccategory(cat egoryname) VALUES('casus')
INSERT rsccategory(cat egoryname) VALUES('project ')
INSERT rsccategory(cat egoryname) VALUES('disert' )
Then SELECT * FROM rsccategory in ,I can get a recordeset with the
'categoryid' in order(1,2,3,4,5 ,6,7)
But If I change the table definition this way:
categoryname VARCHAR(20) NOT NULL UNIQUE,
The select result is in this order (3,5,7,2,6,4,1) ,and 'categoryname '
in alphabetic.
Q:why the recordset's order is not the same as the first time since
'categoryid' is clustered indexed.
If I change the table definition again:
categoryname VARCHAR(20) NOT NULL UNIQUE CLUSTERED
the result is the same as the first time.
Q:'categoryname ' is clustered indexed this time,why isn't in alphabetic
order?
I am a newbie in ms-sqlserver,or actually in database,and I do have
sought for the answer for some time,but more confused,Thanks for your
kind help in advance! 2 2742
I assume the last post was a mistake or a late delivery from a news server, as you've got several
replies to your question. If you have question on any of the replies, please ask along with the
reply (and not just post the question again).
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsof t.public.sqlser ver
"Rhett Liu" <li**********@m ail.biti.edu.cn > wrote in message news:bi******** **@mail.cn99.co m... Hi,guys!
I have a table below: CREATE TABLE rsccategory ( categoryid NUMERIC(2) IDENTITY(1,1), categoryname VARCHAR(20) NOT NULL, PRIMARY KEY(categoryid) ) Then I do: INSERT rsccategory(cat egoryname) VALUES('url') INSERT rsccategory(cat egoryname) VALUES('documen t') INSERT rsccategory(cat egoryname) VALUES('book') INSERT rsccategory(cat egoryname) VALUES('softwar e') INSERT rsccategory(cat egoryname) VALUES('casus') INSERT rsccategory(cat egoryname) VALUES('project ') INSERT rsccategory(cat egoryname) VALUES('disert' ) Then SELECT * FROM rsccategory in ,I can get a recordeset with the 'categoryid' in order(1,2,3,4,5 ,6,7) But If I change the table definition this way: categoryname VARCHAR(20) NOT NULL UNIQUE, The select result is in this order (3,5,7,2,6,4,1) ,and 'categoryname ' in alphabetic. Q:why the recordset's order is not the same as the first time since 'categoryid' is clustered indexed.
If I change the table definition again: categoryname VARCHAR(20) NOT NULL UNIQUE CLUSTERED the result is the same as the first time. Q:'categoryname ' is clustered indexed this time,why isn't in alphabetic order?
I am a newbie in ms-sqlserver,or actually in database,and I do have sought for the answer for some time,but more confused,Thanks for your kind help in advance!
Tibor Karaszi дµÀ: I assume the last post was a mistake or a late delivery from a news server, as you've got several replies to your question. If you have question on any of the replies, please ask along with the reply (and not just post the question again).
late delivery,
you are right,
And you are so kind!Wishes! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Grahammer |
last post by:
For some reason I am getting an error when trying to open a recordset on an
Access database on my Win2K3 machine from my INDEX.ASP page, but the same
code accesses the database fine when coming from the GLOBAL.ASA page. I'm
using a DSN to connect to the database.
The error I'm getting is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
Data source name not found and no
default driver specified
/index.asp, line 14
|
by: Rob Meade |
last post by:
Lo all,
Ok - this is what I was aiming to do, and then I thought - naahhh, that cant
be right!
query database
results to recordset
results to array using GetRows
update values in one column in array
<BOING>
|
by: Tom |
last post by:
I want to open a recordset object on an .asp page. When I open the
recordset I would like to use a stored procedure that expects a parameter to
be passed for the stored procedure. I will then use the recordset to loop
thru the recordset, update values from the recordset and then update the
database by passing parmeters to another stored procedure. I would like to
use the recordset object but can it be used to pass a parameter to a stored...
|
by: Tlm |
last post by:
Hello All,
I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also
has a subform embedded in it (SubFrmC) The form's recordsource is based on a
table (TblA). SubFrmB's recordsource is also based on a table (TblB).
SubFrmC's recordsource is also based on a table (TblC).
There is a one-to-many relationship between TblA (one) and TblB (many).
|
by: Dom Boyce |
last post by:
Hi
First up, I am using MS Access 2002.
I have a database which records analyst rating changes for a list of
companies on a daily basis. Unfortunately, the database has been set
up (by my predecessor, I hasten to add) so that each day it creates a
copy of the record for each company, changes the date to today's date,
and prompts the user for any changes of ratings on that day. The
resulting data table grows by approx 600 records per...
| |
by: Gerry Abbott |
last post by:
Hi all,
I having some confusing effects with recordsets in a recent project.
I created several recordsets, each set with the same number of records, and
related with an index value.
I create a table and add the index value and a value/s from each recordset
in turn, into a temporary table, which I used to create a report. I created
this with DAO objects, and it worked fine. I use iteration, and the
..movenext command to get the next...
|
by: Henry Su |
last post by:
Hello All,
I am looking to whip a recordset out of thin air through a series of
database record manipulation (so there is no physical equivalence to
any database entities such as a table or compounded query) and then
bind that standalone recordset to a form to display the result of such
operations.
I could seem to find a good way of doing it, as I try to change the
recordsource property of the form with no success.
|
by: Ray Holtz |
last post by:
I have a database in Access 2003 (Access2000 file format). There are
two tables that are being used: Employees and Items. It is linked by
the Employee field so that one employee can have many items.
I have a VB6 application that is tied into this database using an
ADODB.Connection and uses two ADODB.Recordsets: rsEmployees and rsItems.
I can pull data from the DB into the app with both recordsets. But I
can only change data in rsItems...
|
by: solar |
last post by:
I am creating a new recordset in 2 tables, orders and order
details.Obviously i have to open the recordset
for two tables.Shall i open the recordset for the table order details
and when shall i open it ?
My function shown below does not create a new recordset in the second
table,only in the table orders:
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |