Showing posts with label version. Show all posts
Showing posts with label version. Show all posts

Monday, March 26, 2012

No duplicate record from joined table

Hi,
I have 2 tables on DB2 version 6

Tab_A
----
id name
1 shop1
2 shop2

Tab_B
--------
id_tab_a keyword
1 book
1 bookstore
1 handbook
2 restaurant

I need to write a SQL query that find who have 'book' as keyword on Tab_B, but with no duplicated record. If i write:

Select distinct id, name left join Tab_B on id=id_tab_a where
keyword like '%book%'

obtain 3 "duplicated" records.

Any ideas?
Thanks,
JhonOriginally posted by fartman
Select distinct id, name left join Tab_B on id=id_tab_a where
keyword like '%book%'


You need to group this puppy

select id,name from tab_a
left join tab_b on id=id_tab_a
group by id,name

Best of luck
-Chris
Come read my SQL tutorial at http://www.bitesizeinc.net/index.php/sql.html|||HI, the following query will help you

select id,name from tab_a
left join tab_b on id=id_tab_a where keyword like '%book%'
group by id,name;

Originally posted by christodd
You need to group this puppy

select id,name from tab_a
left join tab_b on id=id_tab_a
group by id,name

Best of luck
-Chris
Come read my SQL tutorial at http://www.bitesizeinc.net/index.php/sql.html|||problem solved !!!
Thank you.

Jhonny

Originally posted by neelamchalam
HI, the following query will help you

select id,name from tab_a
left join tab_b on id=id_tab_a where keyword like '%book%'
group by id,name;

No default entries in SQL Server 2000 Service Manager Options

ver: SQL-DMO Version: 8.00.760

I have the option to automatically start SQL Server on startup, but
when it does start up, the SQL Server Service Manager does not have
the green arrow indicating that it is active. When I double-click it
to display the SQL Server Service Manager, it shows the name of the
server, but no services in the drop-down box.

When I start Enterprise Manager I see an instance of MSDE where
someone installed an MSDE application. That is active. But I have to
"connect" to the localhost. The instance name is the name of the MSDE
application. I would like it to connect to the localhost on startup.

Any ideas on how to correct this problem?

Thanks,

RBollinger"R Bolling" <robboll@.hotmail.com> wrote in message
news:6e776aa9.0406192206.1722bcb8@.posting.google.c om...
> ver: SQL-DMO Version: 8.00.760
> I have the option to automatically start SQL Server on startup, but
> when it does start up, the SQL Server Service Manager does not have
> the green arrow indicating that it is active. When I double-click it
> to display the SQL Server Service Manager, it shows the name of the
> server, but no services in the drop-down box.
> When I start Enterprise Manager I see an instance of MSDE where
> someone installed an MSDE application. That is active. But I have to
> "connect" to the localhost. The instance name is the name of the MSDE
> application. I would like it to connect to the localhost on startup.
> Any ideas on how to correct this problem?
> Thanks,
> RBollinger

Check this article:

http://support.microsoft.com/defaul...132&Product=sql

By default, MSDE 2000 SP3a does not allow network connections - check the
installation guide for the DISABLENETWORKPROTOCOLS parameter.

Simon|||Simon, Rob,

I am having the same problem with MSDE2000A (See MSDE 2000 Rel A
doesn't talk) - that includes MSDE 2000 SP3.

The articel that Rob mentioned states that the lack of recognition by
the Service Manager occurs only if network protocol is disabled.
However, I installed the MSDE2000A:
--once with DISABLENETWORKPROTOCOLS =0 (should permit network access)
--and once with this parameter removed which shoudl cause it to
default to disable network protocols. In both cases, the sqlserver
seemed to use TCP/IP. Yet the Service Manager still did not show the
instance.

I'm stumped. I earlier installed a unnamed instance of MSDE 2000 from
an MS Office 2000 CD, The SQL Service Manager worked fine in that
installation. I can't understand why the MSDE 2000A doesn't.

On Sun, 20 Jun 2004 17:06:07 +0200, "Simon Hayes" <sql@.hayes.ch>
wrote:

>Check this article:
>http://support.microsoft.com/defaul...132&Product=sql
>By default, MSDE 2000 SP3a does not allow network connections - check the
>installation guide for the DISABLENETWORKPROTOCOLS parameter.
>Simon

Monday, March 19, 2012

Nice feature for next SQL server version

Wouldn't it be nice if SQL build statistics which automatically would help
the system create indexes at runtime?
It defenitely would help lazy programmers :)I would add some statistics to help us know whether indexes are used or not (so we can drop the
indexes not being used). Sounds like a case for sqlwish@.microsoft.com. :-)
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
news:%23$i%23RbCtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> Wouldn't it be nice if SQL build statistics which automatically would help
> the system create indexes at runtime?
> It defenitely would help lazy programmers :)
>|||I take it you're aware of the Index Tuning Wizard which semi-automates the
process of identifying useful indexes and creating them.
--
David Portas
--
Please reply only to the newsgroup
--
"Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
news:%23$i%23RbCtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> Wouldn't it be nice if SQL build statistics which automatically would help
> the system create indexes at runtime?
> It defenitely would help lazy programmers :)
>|||How often have you actually gotten something useful out of the Index
Tuning Wizard? I try it from time to time when I'm stumped and 99% of the
time it ends up either not being able to do anything with the query or
recommends a gigantic composite index that slows performance... Very
annoying.
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:88WdnexFd47lWFmiRVn-sQ@.giganews.com...
> I take it you're aware of the Index Tuning Wizard which semi-automates the
> process of identifying useful indexes and creating them.
> --
> David Portas
> --
> Please reply only to the newsgroup|||> How often have you actually gotten something useful out of the Index
> Tuning Wizard?
Errr.. never. I've hardly ever used it. I expect it can give useful results
if supplied with a suitable Profiler trace but I expect most full-time
administrators and designers prefer to do this stuff for themselves based on
business requirements and their own research.
I don't think generating indexes at "runtime" could offer anything better.
Creating indexes without the opportunity for review by the
administrator/designer sounds pretty dangerous to me - if that's what the OP
was suggesting.
--
David Portas
--
Please reply only to the newsgroup
--|||Yeah! Something like a usage counter for each index would be great.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@.cornerstone.se>
wrote in message news:%23gTl40CtDHA.684@.TK2MSFTNGP09.phx.gbl...
> I would add some statistics to help us know whether indexes are used or
not (so we can drop the
> indexes not being used). Sounds like a case for sqlwish@.microsoft.com. :-)
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
> news:%23$i%23RbCtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> > Wouldn't it be nice if SQL build statistics which automatically would
help
> > the system create indexes at runtime?
> > It defenitely would help lazy programmers :)
> >
>|||"Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
news:%23$i%23RbCtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> Wouldn't it be nice if SQL build statistics which automatically would help
> the system create indexes at runtime?
I'd absolutely hate it. Well building a table of suggested indexes might be
nice, but making the change automagically would introduce more problems than
it was worth IMO.
> It defenitely would help lazy programmers :)
Niall Litchfield
Oracle DBA
Audit Commission UK|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:88WdnexFd47lWFmiRVn-sQ@.giganews.com...
> I take it you're aware of the Index Tuning Wizard which semi-automates the
> process of identifying useful indexes and creating them.
I do not agree quite.
I'd use it personally on projects, but the problem is I DO NOT manage the
SQL server, so I should instruct the DBADMIN to optimize or start an
optimization session. Of course, I include indexes at design but I might
forget some of them and more, I have some sort of SQL stored procedures,
which can sort and filter on ANY column. So if the -client- uses a lot of
queries of a specific type, SQL Server should decide at a certain defined
point, to add the index.
It would be unwise of me to add indexes for all possible combinations on
deployment.
> --
> David Portas
> --
> Please reply only to the newsgroup
> --
> "Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
> news:%23$i%23RbCtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> > Wouldn't it be nice if SQL build statistics which automatically would
help
> > the system create indexes at runtime?
> > It defenitely would help lazy programmers :)
> >
>|||"Niall Litchfield" <n-litchfield@.audit-commission.gov.uk> wrote in message
news:3fc5ee5a$0$9383$ed9e5944@.reading.news.pipex.net...
> "Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
> news:%23$i%23RbCtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> > Wouldn't it be nice if SQL build statistics which automatically would
help
> > the system create indexes at runtime?
> I'd absolutely hate it. Well building a table of suggested indexes might
be
> nice, but making the change automagically would introduce more problems
than
> it was worth IMO.
Allrighty,
in case we can define withhold parameters for auto-indexing and such it
would be no problem. The designer still has to have control over it but the
designer should not be too dependend on the dbadmin for helping or
co-operating on optimizing (and vice-versa)|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:tPGdne5sW-tVTVmiRVn-tA@.giganews.com...
> > How often have you actually gotten something useful out of the Index
> > Tuning Wizard?
> Errr.. never. I've hardly ever used it. I expect it can give useful
results
> if supplied with a suitable Profiler trace but I expect most full-time
> administrators and designers prefer to do this stuff for themselves based
on
> business requirements and their own research.
> I don't think generating indexes at "runtime" could offer anything better.
> Creating indexes without the opportunity for review by the
> administrator/designer sounds pretty dangerous to me - if that's what the
OP
> was suggesting.
Again, I do not suppose that SQL blindly will do that, I suggest a feature
that can be enabled per table, so if a table consists of 20 columns,
potentially, it could create 20 or more (if more columns are combined)
indexes SQL should decide at some points whether or not to create one.
> --
> David Portas
> --
> Please reply only to the newsgroup
> --
>|||"Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
news:eOIchwxvDHA.2180@.TK2MSFTNGP09.phx.gbl...
> "Niall Litchfield" <n-litchfield@.audit-commission.gov.uk> wrote in message
> news:3fc5ee5a$0$9383$ed9e5944@.reading.news.pipex.net...
> > "Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in
message
> > news:%23$i%23RbCtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> > > Wouldn't it be nice if SQL build statistics which automatically would
> help
> > > the system create indexes at runtime?
> >
> > I'd absolutely hate it. Well building a table of suggested indexes might
> be
> > nice, but making the change automagically would introduce more problems
> than
> > it was worth IMO.
> Allrighty,
> in case we can define withhold parameters for auto-indexing and such it
> would be no problem. The designer still has to have control over it but
the
> designer should not be too dependend on the dbadmin for helping or
> co-operating on optimizing (and vice-versa)
You seem to be suggesting that the fewer times the dba and the system
designer have to speak the better. I'd have though the polar opposite were
true. design and admin are tasks that are inextricably linked.
Niall Litchfield
Oracle DBA
Audit Commission UK|||"Niall Litchfield" <n-litchfield@.audit-commission.gov.uk> wrote in message
news:3fd87eb4$0$9385$ed9e5944@.reading.news.pipex.net...
> "Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
> news:eOIchwxvDHA.2180@.TK2MSFTNGP09.phx.gbl...
> > in case we can define withhold parameters for auto-indexing and such it
> > would be no problem. The designer still has to have control over it but
> the
> > designer should not be too dependend on the dbadmin for helping or
> > co-operating on optimizing (and vice-versa)
> You seem to be suggesting that the fewer times the dba and the system
> designer have to speak the better. I'd have though the polar opposite were
> true. design and admin are tasks that are inextricably linked.
I absolutely do not say that there is a **one fits all* way of working. In
some cases you are right. In other cases, you don't want to have long talks
with the dbadmin that you even don't know, you give him a list of options
(db size, backup needs, etc) but you don't want to beg to get him or her
optimize *your app* if he has no budget for it and you have no priviliges to
start a tracelog.
> --
> Niall Litchfield
> Oracle DBA
> Audit Commission UK
>|||"Niall Litchfield" <n-litchfield@.audit-commission.gov.uk> wrote in message
news:3fd87eb4$0$9385$ed9e5944@.reading.news.pipex.net...
> "Egbert Nierop (MVP for IIS)" <egbert_nierop@.nospam.com> wrote in message
> news:eOIchwxvDHA.2180@.TK2MSFTNGP09.phx.gbl...
> You seem to be suggesting that the fewer times the dba and the system
> designer have to speak the better. I'd have though the polar opposite were
> true. design and admin are tasks that are inextricably linked.
ps; I'd like to stress again my original point. I have an app (CRM like)
where you *cannot* optimize everything on forehand! The app can only be
optimized in combination of user statistics, so if the user likes to search
on postalcode only or on his own favorite fields, SQL server should decide
for that environment, to add a new index. My app is that flexible that the
user can sort and search on any column. You don't want to add indexes for
any column do you? :)

Monday, March 12, 2012

Next Version of SQL Server ?

Anyone know a (proposed) release date of the next version of SQL Server ?Second half of this year. You won't get a more specific date this early.
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Liz" <liz@.tiredofspam.com> wrote in message
news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
quote:

> Anyone know a (proposed) release date of the next version of SQL Server ?
>
|||"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:uDPFb#16DHA.3896@.TK2MSFTNGP11.phx.gbl...
quote:

> Second half of this year. You won't get a more specific date this early.

Thanks, Aaron
quote:

> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Liz" <liz@.tiredofspam.com> wrote in message
> news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
?[QUOTE]
>

Next Version of SQL Server ?

Anyone know a (proposed) release date of the next version of SQL Server ?Second half of this year. You won't get a more specific date this early.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Liz" <liz@.tiredofspam.com> wrote in message
news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
> Anyone know a (proposed) release date of the next version of SQL Server ?
>|||"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:uDPFb#16DHA.3896@.TK2MSFTNGP11.phx.gbl...
> Second half of this year. You won't get a more specific date this early.
Thanks, Aaron
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Liz" <liz@.tiredofspam.com> wrote in message
> news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
> > Anyone know a (proposed) release date of the next version of SQL Server
?
> >
> >
>

Next version of SQL Server

Does anyone know when the next version of SQL Server is to be released?
2005.
"JAY S." <anonymous@.discussions.microsoft.com> wrote in message
news:62FE8FA8-1D48-4BA6-9508-7E8BFF649CE1@.microsoft.com...
> Does anyone know when the next version of SQL Server is to be released?
|||MS has announced the next versioin of SQL Server will be named 'SQL Server
2005'. MS has said that they currently anticipate it shipping in the first
1/2 of calendar year 2005.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"JAY S." <anonymous@.discussions.microsoft.com> wrote in message
news:62FE8FA8-1D48-4BA6-9508-7E8BFF649CE1@.microsoft.com...
> Does anyone know when the next version of SQL Server is to be released?

Next version of SQL Server

Does anyone know when the next version of SQL Server is to be released?2005.
"JAY S." <anonymous@.discussions.microsoft.com> wrote in message
news:62FE8FA8-1D48-4BA6-9508-7E8BFF649CE1@.microsoft.com...
> Does anyone know when the next version of SQL Server is to be released?|||MS has announced the next versioin of SQL Server will be named 'SQL Server
2005'. MS has said that they currently anticipate it shipping in the first
1/2 of calendar year 2005.
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"JAY S." <anonymous@.discussions.microsoft.com> wrote in message
news:62FE8FA8-1D48-4BA6-9508-7E8BFF649CE1@.microsoft.com...
> Does anyone know when the next version of SQL Server is to be released?

Next version of SQL Server

Does anyone know when the next version of SQL Server is to be released?2005.
"JAY S." <anonymous@.discussions.microsoft.com> wrote in message
news:62FE8FA8-1D48-4BA6-9508-7E8BFF649CE1@.microsoft.com...
> Does anyone know when the next version of SQL Server is to be released?|||MS has announced the next versioin of SQL Server will be named 'SQL Server
2005'. MS has said that they currently anticipate it shipping in the first
1/2 of calendar year 2005.
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"JAY S." <anonymous@.discussions.microsoft.com> wrote in message
news:62FE8FA8-1D48-4BA6-9508-7E8BFF649CE1@.microsoft.com...
> Does anyone know when the next version of SQL Server is to be released?

Next version of RS

When is the next version of RS going to be released
What changes have they made.There is an SP2 Beta for RS, however, the next release will be with SQL
Yukon (2005)
As for changes, you'll need to check the MS website out!
Immy
"Kathy" <joe@.soap.com> wrote in message
news:8IudneOHjfkbHp3fRVn-3Q@.is.co.za...
> When is the next version of RS going to be released
> What changes have they made.
>|||Next version of SQL will be late summer ( hopefully!)... However most of the
new features for RS should be in beta 3, expected soon... Watch for the beta
availability, and get an early start...
There are going to be some really, really nice, and much needed things in
the new RS... I can't wait..!
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Kathy" <joe@.soap.com> wrote in message
news:8IudneOHjfkbHp3fRVn-3Q@.is.co.za...
> When is the next version of RS going to be released
> What changes have they made.
>

Next Version of Reporting Services

Hi,
Does anyone know when Microsoft is releasing next version of Reporting
Service with all the issues resolved
PonnurangamSorry, I have seen no date yet for SP2. But if you really mean "next
version", the answer is the first half of 2005; it's in SQL Server 2005.
hth
Eric
Ponnurangam wrote:
> Hi,
> Does anyone know when Microsoft is releasing next version of Reporting
> Service with all the issues resolved
> Ponnurangam

Next version availability

Hello
I'd like to know if the next version of Reporting Services, scheduled for
release along with SQL Server 2005, will be available for previous versions
of SQL Server, specifically, SQL Server 2000?This is my understanding of how it will work. You have to have a license for
SQL Server 2005 in order to run RS 2005. But, the databases used by RS can
reside on a SQL Server 2000 database. If that is not the case I will be
screaming as loud as anyone else.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Matan Holtzer" <MatanHoltzer@.discussions.microsoft.com> wrote in message
news:5FF5E9D1-D69E-482F-BCA9-B171D29FB26B@.microsoft.com...
> Hello
> I'd like to know if the next version of Reporting Services, scheduled for
> release along with SQL Server 2005, will be available for previous
> versions
> of SQL Server, specifically, SQL Server 2000?|||Thanks Bruce
Along with your answer, I took the time and installed RS from SS2005 (latest
Beta) using SS2000 as the database, and it works - at least up to the point
of finishing the installation and initializing. I still have to wait for the
Beta 2 of VS2005 to fully test it.
- Matan -
"Bruce L-C [MVP]" wrote:
> This is my understanding of how it will work. You have to have a license for
> SQL Server 2005 in order to run RS 2005. But, the databases used by RS can
> reside on a SQL Server 2000 database. If that is not the case I will be
> screaming as loud as anyone else.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Matan Holtzer" <MatanHoltzer@.discussions.microsoft.com> wrote in message
> news:5FF5E9D1-D69E-482F-BCA9-B171D29FB26B@.microsoft.com...
> > Hello
> > I'd like to know if the next version of Reporting Services, scheduled for
> > release along with SQL Server 2005, will be available for previous
> > versions
> > of SQL Server, specifically, SQL Server 2000?
>
>

Friday, March 9, 2012

NEWSEQUENTIALID behavior changed from Apr CTP to June CTP

There may be a bug in the June CTP version of NEWSEQUENTIALID.

NEWSEQUENTIALID had very predictable behavior in the Apr CTP build. It incremented in obvious, clear, consistent amounts. Doing inserts right after another or having widely range time intervals between inserts made no difference.

With the June CTP build, things are not as predictable and do not appear to be sequential. The following output shows the guids that were created. The test plan inserted 10 rows, waited some varying interval of time, then inserted another 10 rows, etc. until all rows were inserted.

Waiting a period of time between inserts of 10 rows appeared to introduce gaps into the sequence. Additionally, the last group of 10 inserts appears to have guid values that fill in some of the gap left by the previous inserts.

30608b57-5dee-d911-83a8-0003ff3ba433 insert 10 rows
31608b57-5dee-d911-83a8-0003ff3ba433
...
39608b57-5dee-d911-83a8-0003ff3ba433 so far so good, wait before more inserts
80ab5672-5dee-d911-83a8-0003ff3ba433 insert 10 rows; notice a gap is left
...
89ab5672-5dee-d911-83a8-0003ff3ba433 minimal wait before next 10 inserts
8aab5672-5dee-d911-83a8-0003ff3ba433 insert 10 rows; no gap
...
93ab5672-5dee-d911-83a8-0003ff3ba433 minimal wait before next 10 inserts
94ab5672-5dee-d911-83a8-0003ff3ba433 insert 10 rows; no gap
...
9dab5672-5dee-d911-83a8-0003ff3ba433 wait before next 10 inserts
c0430490-5dee-d911-83a8-0003ff3ba433 insert 10 rows; notice a gap is left
...
c9430490-5dee-d911-83a8-0003ff3ba433 wait before next 10 inserts
a0143ddb-5dee-d911-83a8-0003ff3ba433 insert 10 rows; appears to be filling in a gap
...
a8143ddb-5dee-d911-83a8-0003ff3ba433

This looks like it could be a bug becuase NEWSEQUENTIALID() values are supposed to be allocated in strictly increasing order. Can you send me a repro? Thanks.

Eric
e h a n s@.microsoft.com|||

Code was sent to Eric Hanson by email. It is also shown below:

USE AdventureWorks
GO

CREATE TABLE dbo.SEQTEST(
[ID] [uniqueidentifier] NOT NULL DEFAULT NEWSEQUENTIALID(),
[Name] [nchar](50) COLLATE Latin1_General_CI_AI NULL,
CONSTRAINT [PK_SEQTEST] PRIMARY KEY CLUSTERED
)
GO

Make a console application using the following code. Run the console application several times.

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace NEWSEQUENTIALID
{
class Program
{
static void Main(string[] args)
{
Inserter lInsert = new Inserter();

for (int i = 0; i < 10; i++)
lInsert.InsertRow(String.Format("batch " + DateTime.Now.ToLongTimeString() + " insert number {0}", i));
}
}
public class Inserter
{
private static string _insertCommand =
"INSERT INTO SEQTEST (Name) OUTPUT INSERTED.ID Values(@.Name)";

public bool InsertRow(string Name)
{
SqlConnection lConnection = new SqlConnection("Data Source=localhost; Integrated Security=SSPI; Initial Catalog=AdventureWorks");
lConnection.Open();

SqlCommand lInsertCmd = new SqlCommand(_insertCommand, lConnection);
lInsertCmd.Parameters.AddWithValue("Name", Name);

IDataReader lResult = lInsertCmd.ExecuteReader();

while (lResult.Read())
{
Console.WriteLine("ID: {0} Name: {1}", lResult.GetGuid(0).ToString(), Name);
}

lConnection.Close();

return true;
}
}
}

|||It appears that although the behavior may have indeed changed from the April to June CTPs, everything is still working properly. It is probably not wise to try to infer guid sort order by visually inspecting the character representations of the guids. If someone could confirm this by explaining the character representation of and also the internal structures of guids, that would be great.

NEWSEQUENTIALID in the April CTP consistently produced results that were very obviously increasing by looking at the character representations of the guids. The character pattern was completely predictable.

NEWSEQUENTIALID in the June CTP generates results that actually do follow an ascending sort order in SQL as evidenced by ORDER BY. The difference in behavior is that the character representation of the guids does not obviously show the ascending sort when casually inspecting the characters.|||

NEWSEQUENTIALID is not meant to generate gap-less ranges. It's only guarantee is that it will generate strictly increasing values.

As for the part of your repro where you observed that the values did not appear to be increasing. We defined "increasing" in different terms than the character value you see. This is because SQL Server implements it's own comparison semantics on GUIDs.

If you read the first 4 bytes of your GUID value from right to left, you'll notice that they are in strictly increasing order.

If I copy paste your generated GUIDS, and reverse the first DWORD, we see:
578b6030-5dee-d911-83a8-0003ff3ba433 insert 10 rows
578b6031-5dee-d911-83a8-0003ff3ba433
...
578b6039-5dee-d911-83a8-0003ff3ba433 so far so good, wait before more inserts
7256ab80-5dee-d911-83a8-0003ff3ba433 insert 10 rows; notice a gap is left
...
7256ab89-5dee-d911-83a8-0003ff3ba433 minimal wait before next 10 inserts
7256ab8a-5dee-d911-83a8-0003ff3ba433 insert 10 rows; no gap
...
7256ab93-5dee-d911-83a8-0003ff3ba433 minimal wait before next 10 inserts
7256ab94-5dee-d911-83a8-0003ff3ba433 insert 10 rows; no gap
...
7256ab9d-5dee-d911-83a8-0003ff3ba433 wait before next 10 inserts
900443c0-5dee-d911-83a8-0003ff3ba433 insert 10 rows; notice a gap is left
...
900443c9-5dee-d911-83a8-0003ff3ba433 wait before next 10 inserts
db3d14a0-5dee-d911-83a8-0003ff3ba433 insert 10 rows; appears to be filling in a gap
...
db3d14a8-5dee-d911-83a8-0003ff3ba433

Which better describes how we define increasing.

I will check with documentation folks to see if it's possible to be clearer on this.

Let me know if you need more details,

Thanks
-Mat
mathh-at-microsoft-dot-com