Showing posts with label order. Show all posts
Showing posts with label order. Show all posts

Wednesday, March 7, 2012

Check all CPU's are used

We added a new CPU to our 1 CPU box making it a 2 CPU box.
In order to check that Sql is using both CPU's, I'm going
to load 2 bcp files simultaneously. I'll check the task
manager to monitor that CPU usage increases for both CPU's.
Is there a better way to show my sysadmin that both CPU's
are being used ? He refuses to believe that SQL will
recognize both CPU's without a reconfiguration.
TIA,
JackIn Enterprise Manager, right-click the server name, select properties and
click the processor tab. Check the CPUs you want to use. You may need to
stop and restart the services...can't remember.
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:64f501c3e69d$d53d1570$a301280a@.phx.gbl...
quote:

> We added a new CPU to our 1 CPU box making it a 2 CPU box.
> In order to check that Sql is using both CPU's, I'm going
> to load 2 bcp files simultaneously. I'll check the task
> manager to monitor that CPU usage increases for both CPU's.
> Is there a better way to show my sysadmin that both CPU's
> are being used ? He refuses to believe that SQL will
> recognize both CPU's without a reconfiguration.
> TIA,
> Jack
|||Hi,
No need to do a configuration change to use the second CPU.
How to check is.
1. Use the Performance monitor from Control panel ...Admin tools
2. From the conter, u have to select Processor and select the 2 CPUs
seperately.
3. Now you run your SQL server batch processes.
This will give you a picture of CPU usage.
Thanks
Hari
MCDBA
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:64f501c3e69d$d53d1570$a301280a@.phx.gbl...
quote:

> We added a new CPU to our 1 CPU box making it a 2 CPU box.
> In order to check that Sql is using both CPU's, I'm going
> to load 2 bcp files simultaneously. I'll check the task
> manager to monitor that CPU usage increases for both CPU's.
> Is there a better way to show my sysadmin that both CPU's
> are being used ? He refuses to believe that SQL will
> recognize both CPU's without a reconfiguration.
> TIA,
> Jack

Check all CPU's are used

We added a new CPU to our 1 CPU box making it a 2 CPU box.
In order to check that Sql is using both CPU's, I'm going
to load 2 bcp files simultaneously. I'll check the task
manager to monitor that CPU usage increases for both CPU's.
Is there a better way to show my sysadmin that both CPU's
are being used ? He refuses to believe that SQL will
recognize both CPU's without a reconfiguration.
TIA,
JackIn Enterprise Manager, right-click the server name, select properties and
click the processor tab. Check the CPUs you want to use. You may need to
stop and restart the services...can't remember.
--
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:64f501c3e69d$d53d1570$a301280a@.phx.gbl...
> We added a new CPU to our 1 CPU box making it a 2 CPU box.
> In order to check that Sql is using both CPU's, I'm going
> to load 2 bcp files simultaneously. I'll check the task
> manager to monitor that CPU usage increases for both CPU's.
> Is there a better way to show my sysadmin that both CPU's
> are being used ? He refuses to believe that SQL will
> recognize both CPU's without a reconfiguration.
> TIA,
> Jack|||Hi,
No need to do a configuration change to use the second CPU.
How to check is.
1. Use the Performance monitor from Control panel ...Admin tools
2. From the conter, u have to select Processor and select the 2 CPUs
seperately.
3. Now you run your SQL server batch processes.
This will give you a picture of CPU usage.
Thanks
Hari
MCDBA
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:64f501c3e69d$d53d1570$a301280a@.phx.gbl...
> We added a new CPU to our 1 CPU box making it a 2 CPU box.
> In order to check that Sql is using both CPU's, I'm going
> to load 2 bcp files simultaneously. I'll check the task
> manager to monitor that CPU usage increases for both CPU's.
> Is there a better way to show my sysadmin that both CPU's
> are being used ? He refuses to believe that SQL will
> recognize both CPU's without a reconfiguration.
> TIA,
> Jack

Friday, February 24, 2012

Chart Legend Sorting

I have a chart where I need to sort the legend so the colors appear in the
same order as the colors on the chart. It appears the order the legend
labels appear in is fairly random. To get around this we have added a custom
image below the chart with the colors and label order we need to have,
however this does cause some other issues. Is there a method to what order
the legend labels will appear?
ThanksYou might try something along these lines:
http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx.
--
Michael
"Monte" wrote:
> I have a chart where I need to sort the legend so the colors appear in the
> same order as the colors on the chart. It appears the order the legend
> labels appear in is fairly random. To get around this we have added a custom
> image below the chart with the colors and label order we need to have,
> however this does cause some other issues. Is there a method to what order
> the legend labels will appear?
> Thanks

Thursday, February 16, 2012

Charging back

Hi,
Is there any automated method to measure reporting services usage (report
duration) per report in order to be used for charging back report owners in
an enterprise and shared reporting services environment?
We have SQL Server RS 2000 SP2 on an shared report/ SQL server and need to
find a method to charge back our customers.
ThanksAlex,
All your reporting services report processing statistics are stored in the
Report Server database in the ExecutionLog table. It details execution
times, user ID, etc for each report run. You will have to tie the report ID
to the ItemID in the Catalogue to get you report names to see which reports
are being run by who.
Reporting services cleans the executionlog table out every couple of months,
so if you wish to keep a permanent record of all reports run then you will
have to periodically export the table contents to another table/database.
Hoep this helps
Ray
"Alex" wrote:
> Hi,
> Is there any automated method to measure reporting services usage (report
> duration) per report in order to be used for charging back report owners in
> an enterprise and shared reporting services environment?
> We have SQL Server RS 2000 SP2 on an shared report/ SQL server and need to
> find a method to charge back our customers.
> Thanks
>
>|||Hi Ray,
Thanks for the info. It works great.
Alex
"Ray Seppala" <Ray.Seppala@.defence.gov.au.(Donotspam)> wrote in message
news:81AD2BFF-FDED-4B78-BA08-FFCC11C4A3F1@.microsoft.com...
> Alex,
> All your reporting services report processing statistics are stored in the
> Report Server database in the ExecutionLog table. It details execution
> times, user ID, etc for each report run. You will have to tie the report
> ID
> to the ItemID in the Catalogue to get you report names to see which
> reports
> are being run by who.
> Reporting services cleans the executionlog table out every couple of
> months,
> so if you wish to keep a permanent record of all reports run then you will
> have to periodically export the table contents to another table/database.
> Hoep this helps
> Ray
> "Alex" wrote:
>> Hi,
>> Is there any automated method to measure reporting services usage (report
>> duration) per report in order to be used for charging back report owners
>> in
>> an enterprise and shared reporting services environment?
>> We have SQL Server RS 2000 SP2 on an shared report/ SQL server and need
>> to
>> find a method to charge back our customers.
>> Thanks
>>|||Ray,
I beleive the start and end time are from when user clicks on run button
until they actually see the report. This time will include the time while
Reporting server was waiting for data from database server. This will not be
fair to include the wait time in charge back and charge customers for it.
Is there anyway to get the actual time Reporting server was busy processing
the report only?
Thanks
"Ray Seppala" <Ray.Seppala@.defence.gov.au.(Donotspam)> wrote in message
news:81AD2BFF-FDED-4B78-BA08-FFCC11C4A3F1@.microsoft.com...
> Alex,
> All your reporting services report processing statistics are stored in the
> ver
> Report Server database in the ExecutionLog table. It details execution
> times, user ID, etc for each report run. You will have to tie the report
> ID
> to the ItemID in the Catalogue to get you report names to see which
> reports
> are being run by who.
> Reporting services cleans the executionlog table out every couple of
> months,
> so if you wish to keep a permanent record of all reports run then you will
> have to periodically export the table contents to another table/database.
> Hoep this helps
> Ray
> "Alex" wrote:
>> Hi,
>> Is there any automated method to measure reporting services usage (report
>> duration) per report in order to be used for charging back report owners
>> in
>> an enterprise and shared reporting services environment?
>> We have SQL Server RS 2000 SP2 on an shared report/ SQL server and need
>> to
>> find a method to charge back our customers.
>> Thanks
>>|||Alex,
There is a bit in BOL about the execution data you can get from RS. Try
this link;
ms-help://MS.RSBOL80.1033/rsadmin/htm/arp_rslogfiles_v1_88gy.htm
Chris
Ray Seppala wrote:
> Alex,
> All your reporting services report processing statistics are stored
> in the Report Server database in the ExecutionLog table. It details
> execution times, user ID, etc for each report run. You will have to
> tie the report ID to the ItemID in the Catalogue to get you report
> names to see which reports are being run by who.
> Reporting services cleans the executionlog table out every couple of
> months, so if you wish to keep a permanent record of all reports run
> then you will have to periodically export the table contents to
> another table/database.
> Hoep this helps
> Ray
> "Alex" wrote:
> > Hi,
> >
> > Is there any automated method to measure reporting services usage
> > (report duration) per report in order to be used for charging back
> > report owners in an enterprise and shared reporting services
> > environment?
> >
> > We have SQL Server RS 2000 SP2 on an shared report/ SQL server and
> > need to find a method to charge back our customers.
> >
> > Thanks
> >
> >
> >

Tuesday, February 14, 2012

character sets, sort order, collations

Just trying to determine character set and sort order for a couple servers.
I see that the output for sp_helpsort has changed, such that it used to be
more helpful than it is now. I guess it changed at some point. On a SQL 7
system, I can easily get the charset and sortorder (below), as well as a
listing of the characters in order.
Character Set = 1, iso_1
ISO 8859-1 (Latin-1) - Western European 8-bit character set.
Sort Order = 52, nocase_iso
Case-insensitive dictionary sort order for use with several We
stern-European languages including English, French, and German
. Uses the ISO 8859-1 character set.
Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
charset_num=1 sort_order_num=52
But on some SQL 2000 systems, sp_helpsort returns:
Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
width-insensitive
And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
nocase_iso when such descriptive output isn't provided any more?
Dale.these might be of help:
http://msdn.microsoft.com/library/en-us/instsql/in_collation_3oa6.asp
select *
from ::fn_helpcollations()
-oj
<Dale Kerr> wrote in message news:%23GKAhQovFHA.3152@.TK2MSFTNGP12.phx.gbl...
> Just trying to determine character set and sort order for a couple
> servers. I see that the output for sp_helpsort has changed, such that it
> used to be more helpful than it is now. I guess it changed at some point.
> On a SQL 7 system, I can easily get the charset and sortorder (below), as
> well as a listing of the characters in order.
> Character Set = 1, iso_1
> ISO 8859-1 (Latin-1) - Western European 8-bit character set.
> Sort Order = 52, nocase_iso
> Case-insensitive dictionary sort order for use with several We
> stern-European languages including English, French, and German
> . Uses the ISO 8859-1 character set.
> Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
> charset_num=1 sort_order_num=52
> But on some SQL 2000 systems, sp_helpsort returns:
> Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
> width-insensitive
> And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
> How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
> nocase_iso when such descriptive output isn't provided any more?
> Dale.
>|||Cheers, I'll see if I can get my head around it.
"oj" <nospam_ojngo@.home.com> wrote in message
news:O4k18covFHA.2880@.TK2MSFTNGP12.phx.gbl...
> these might be of help:
> http://msdn.microsoft.com/library/en-us/instsql/in_collation_3oa6.asp
> select *
> from ::fn_helpcollations()

character sets, sort order, collations

Just trying to determine character set and sort order for a couple servers.
I see that the output for sp_helpsort has changed, such that it used to be
more helpful than it is now. I guess it changed at some point. On a SQL 7
system, I can easily get the charset and sortorder (below), as well as a
listing of the characters in order.
Character Set = 1, iso_1
ISO 8859-1 (Latin-1) - Western European 8-bit character set.
Sort Order = 52, nocase_iso
Case-insensitive dictionary sort order for use with several We
stern-European languages including English, French, and German
. Uses the ISO 8859-1 character set.
Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
charset_num=1 sort_order_num=52
But on some SQL 2000 systems, sp_helpsort returns:
Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
width-insensitive
And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
nocase_iso when such descriptive output isn't provided any more?
Dale.these might be of help:
http://msdn.microsoft.com/library/e...lation_3oa6.asp
select *
from ::fn_helpcollations()
-oj
<Dale Kerr> wrote in message news:%23GKAhQovFHA.3152@.TK2MSFTNGP12.phx.gbl...
> Just trying to determine character set and sort order for a couple
> servers. I see that the output for sp_helpsort has changed, such that it
> used to be more helpful than it is now. I guess it changed at some point.
> On a SQL 7 system, I can easily get the charset and sortorder (below), as
> well as a listing of the characters in order.
> Character Set = 1, iso_1
> ISO 8859-1 (Latin-1) - Western European 8-bit character set.
> Sort Order = 52, nocase_iso
> Case-insensitive dictionary sort order for use with several We
> stern-European languages including English, French, and German
> . Uses the ISO 8859-1 character set.
> Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
> charset_num=1 sort_order_num=52
> But on some SQL 2000 systems, sp_helpsort returns:
> Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
> width-insensitive
> And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
> How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
> nocase_iso when such descriptive output isn't provided any more?
> Dale.
>|||Cheers, I'll see if I can get my head around it.
"oj" <nospam_ojngo@.home.com> wrote in message
news:O4k18covFHA.2880@.TK2MSFTNGP12.phx.gbl...
> these might be of help:
> http://msdn.microsoft.com/library/e...lation_3oa6.asp
> select *
> from ::fn_helpcollations()

character sets, sort order, collations

Just trying to determine character set and sort order for a couple servers.
I see that the output for sp_helpsort has changed, such that it used to be
more helpful than it is now. I guess it changed at some point. On a SQL 7
system, I can easily get the charset and sortorder (below), as well as a
listing of the characters in order.
Character Set = 1, iso_1
ISO 8859-1 (Latin-1) - Western European 8-bit character set.
Sort Order = 52, nocase_iso
Case-insensitive dictionary sort order for use with several We
stern-European languages including English, French, and German
. Uses the ISO 8859-1 character set.
Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
charset_num=1 sort_order_num=52
But on some SQL 2000 systems, sp_helpsort returns:
Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
width-insensitive
And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
nocase_iso when such descriptive output isn't provided any more?
Dale.
these might be of help:
http://msdn.microsoft.com/library/en...ation_3oa6.asp
select *
from ::fn_helpcollations()
-oj
<Dale Kerr> wrote in message news:%23GKAhQovFHA.3152@.TK2MSFTNGP12.phx.gbl...
> Just trying to determine character set and sort order for a couple
> servers. I see that the output for sp_helpsort has changed, such that it
> used to be more helpful than it is now. I guess it changed at some point.
> On a SQL 7 system, I can easily get the charset and sortorder (below), as
> well as a listing of the characters in order.
> Character Set = 1, iso_1
> ISO 8859-1 (Latin-1) - Western European 8-bit character set.
> Sort Order = 52, nocase_iso
> Case-insensitive dictionary sort order for use with several We
> stern-European languages including English, French, and German
> . Uses the ISO 8859-1 character set.
> Alternatively, EXEC sp_serverinfo 18: charset=iso_1 sort_order=nocase_iso
> charset_num=1 sort_order_num=52
> But on some SQL 2000 systems, sp_helpsort returns:
> Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
> width-insensitive
> And EXEC sp_server_info 18: charset=iso_1 collation=Latin1_General_CI_AS
> How do I confirm that newer systems are 72 - nocase_1252 rather than 52 -
> nocase_iso when such descriptive output isn't provided any more?
> Dale.
>
|||Cheers, I'll see if I can get my head around it.
"oj" <nospam_ojngo@.home.com> wrote in message
news:O4k18covFHA.2880@.TK2MSFTNGP12.phx.gbl...
> these might be of help:
> http://msdn.microsoft.com/library/en...ation_3oa6.asp
> select *
> from ::fn_helpcollations()

Character set, Sort Order, Unicode Collation

Please, a command/script to see how I installed my Sql
Server (Character set, Sort Order, Unicode Collation), I
was looking for them at Knowledge Base, but couldn't find
anything.
ThanksThis should do it:
select serverproperty('collation')
Regards,
Paul Ibison|||Hi,
Add on , Execute the below procedure to get the charecter set and sort
order. This procedure will work for all versions.
sp_helpsort
--
Thanks
Hari
MCDBA
"Robert Duval" <r.duval@.discussions.microsoft.com> wrote in message
news:1ddf001c45512$bfedc6e0$a601280a@.phx.gbl...
> Please, a command/script to see how I installed my Sql
> Server (Character set, Sort Order, Unicode Collation), I
> was looking for them at Knowledge Base, but couldn't find
> anything.
> Thanks

Character set, Sort Order, Unicode Collation

Please, a command/script to see how I installed my Sql
Server (Character set, Sort Order, Unicode Collation), I
was looking for them at Knowledge Base, but couldn't find
anything.
ThanksHi,
Add on , Execute the below procedure to get the charecter set and sort
order. This procedure will work for all versions.
sp_helpsort
Thanks
Hari
MCDBA
"Robert Duval" <r.duval@.discussions.microsoft.com> wrote in message
news:1ddf001c45512$bfedc6e0$a601280a@.phx
.gbl...
> Please, a command/script to see how I installed my Sql
> Server (Character set, Sort Order, Unicode Collation), I
> was looking for them at Knowledge Base, but couldn't find
> anything.
> Thanks

Character set, Sort Order, Unicode Collation

Please, a command/script to see how I installed my Sql
Server (Character set, Sort Order, Unicode Collation), I
was looking for them at Knowledge Base, but couldn't find
anything.
Thanks
Hi,
Add on , Execute the below procedure to get the charecter set and sort
order. This procedure will work for all versions.
sp_helpsort
Thanks
Hari
MCDBA
"Robert Duval" <r.duval@.discussions.microsoft.com> wrote in message
news:1ddf001c45512$bfedc6e0$a601280a@.phx.gbl...
> Please, a command/script to see how I installed my Sql
> Server (Character set, Sort Order, Unicode Collation), I
> was looking for them at Knowledge Base, but couldn't find
> anything.
> Thanks

Character greater than 'z'

I've searched and have not found any good answers to this. Maybe there
isn't one...
I need to have a string that when sorted with an ORDER BY, it comes after
the letter 'z'.
The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
I know it is best to not rely on this and use some sort of surrogate field
to order the rows, but I cannot do that in this case - the data is being
used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
SharePoint will sort one of it's lists by the BDC column value, but it sorts
only by the values in that column.
In ASCII, I could use the tilde (~), but SQL is putting the tilde first in
the results.
Is there any character I could put at the beginning of the string so it
would fall out last in the query results?
(Remember, it is SharePoint generating the query, so I cannot change the SQL
it uses. I only control the values in the column.)
I assume the column is char or varchar? If so, you can use the value
CHAR(208), for example,
Set NoCount ON
Create Table #FooBar(Foo varchar(10))
Insert #FooBar (Foo) Values ('A')
Insert #FooBar (Foo) Values (Char(208))
Insert #FooBar (Foo) Values ('z')
Select Foo, Ascii(Foo)
From #FooBar
Order By Foo
go
Drop Table #FooBar
You can find all the characters which will sort after 'z' with the following
code
Set NoCount ON
Create Table #FooBar(Foo varchar(10))
Insert #FooBar (Foo) Values ('A')
Insert #FooBar (Foo) Values ('z')
Declare @.i int
Set @.i = 1
While @.i < 256
Begin
Insert #FooBar (Foo) Values (Char(@.i))
Set @.i = @.i + 1
End
Select Foo, Ascii(Foo)
From #FooBar
Where Foo > 'z'
Order By Foo
go
Drop Table #FooBar
Tom
"JD" <yazoo@.newsgroup.nospam> wrote in message
news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
> I've searched and have not found any good answers to this. Maybe there
> isn't one...
> I need to have a string that when sorted with an ORDER BY, it comes after
> the letter 'z'.
> The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
> I know it is best to not rely on this and use some sort of surrogate field
> to order the rows, but I cannot do that in this case - the data is being
> used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
> SharePoint will sort one of it's lists by the BDC column value, but it
> sorts only by the values in that column.
> In ASCII, I could use the tilde (~), but SQL is putting the tilde first in
> the results.
> Is there any character I could put at the beginning of the string so it
> would fall out last in the query results?
> (Remember, it is SharePoint generating the query, so I cannot change the
> SQL it uses. I only control the values in the column.)
>
|||JD
select * from #FooBar order by case when foo ='z' then 1 else 2 end
"JD" <yazoo@.newsgroup.nospam> wrote in message
news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
> I've searched and have not found any good answers to this. Maybe there
> isn't one...
> I need to have a string that when sorted with an ORDER BY, it comes after
> the letter 'z'.
> The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
> I know it is best to not rely on this and use some sort of surrogate field
> to order the rows, but I cannot do that in this case - the data is being
> used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
> SharePoint will sort one of it's lists by the BDC column value, but it
> sorts only by the values in that column.
> In ASCII, I could use the tilde (~), but SQL is putting the tilde first in
> the results.
> Is there any character I could put at the beginning of the string so it
> would fall out last in the query results?
> (Remember, it is SharePoint generating the query, so I cannot change the
> SQL it uses. I only control the values in the column.)
>
|||As I said, I cannot change the query, since Sharepoint is doing the query.
I can only affect the data in the column.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uVGG%2305nIHA.4328@.TK2MSFTNGP03.phx.gbl...
> JD
> select * from #FooBar order by case when foo ='z' then 1 else 2 end
>
> "JD" <yazoo@.newsgroup.nospam> wrote in message
> news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
>
|||Thanks - it is nvarchar, so I made a few changes to your example and found a
series of Unicode characters that sort after 'z':
set nocount on
create table #FooBar(Foo nvarchar(10))
insert #FooBar (Foo) values ('A')
declare @.i int
set @.i = 900
while (@.i < 1200)
begin
insert #FooBar (Foo) values (nchar(@.i))
set @.i = @.i + 1
end
insert #FooBar (Foo) values ('z')
select Foo, unicode(Foo)
from #FooBar
where Foo > 'z'
order by Foo
drop table #FooBar
"Tom Cooper" <tomcooper@.comcast.no.spam.please.net> wrote in message
news:O6sC0c3nIHA.4832@.TK2MSFTNGP06.phx.gbl...
>I assume the column is char or varchar? If so, you can use the value
>CHAR(208), for example,
> Set NoCount ON
> Create Table #FooBar(Foo varchar(10))
> Insert #FooBar (Foo) Values ('A')
> Insert #FooBar (Foo) Values (Char(208))
> Insert #FooBar (Foo) Values ('z')
> Select Foo, Ascii(Foo)
> From #FooBar
> Order By Foo
> go
> Drop Table #FooBar
> You can find all the characters which will sort after 'z' with the
> following code
> Set NoCount ON
> Create Table #FooBar(Foo varchar(10))
> Insert #FooBar (Foo) Values ('A')
> Insert #FooBar (Foo) Values ('z')
> Declare @.i int
> Set @.i = 1
> While @.i < 256
> Begin
> Insert #FooBar (Foo) Values (Char(@.i))
> Set @.i = @.i + 1
> End
> Select Foo, Ascii(Foo)
> From #FooBar
> Where Foo > 'z'
> Order By Foo
> go
> Drop Table #FooBar
> Tom
> "JD" <yazoo@.newsgroup.nospam> wrote in message
> news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
>

Character greater than 'z'

I've searched and have not found any good answers to this. Maybe there
isn't one...
I need to have a string that when sorted with an ORDER BY, it comes after
the letter 'z'.
The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
I know it is best to not rely on this and use some sort of surrogate field
to order the rows, but I cannot do that in this case - the data is being
used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
SharePoint will sort one of it's lists by the BDC column value, but it sorts
only by the values in that column.
In ASCII, I could use the tilde (~), but SQL is putting the tilde first in
the results.
Is there any character I could put at the beginning of the string so it
would fall out last in the query results?
(Remember, it is SharePoint generating the query, so I cannot change the SQL
it uses. I only control the values in the column.)I assume the column is char or varchar? If so, you can use the value
CHAR(208), for example,
Set NoCount ON
Create Table #FooBar(Foo varchar(10))
Insert #FooBar (Foo) Values ('A')
Insert #FooBar (Foo) Values (Char(208))
Insert #FooBar (Foo) Values ('z')
Select Foo, Ascii(Foo)
From #FooBar
Order By Foo
go
Drop Table #FooBar
You can find all the characters which will sort after 'z' with the following
code
Set NoCount ON
Create Table #FooBar(Foo varchar(10))
Insert #FooBar (Foo) Values ('A')
Insert #FooBar (Foo) Values ('z')
Declare @.i int
Set @.i = 1
While @.i < 256
Begin
Insert #FooBar (Foo) Values (Char(@.i))
Set @.i = @.i + 1
End
Select Foo, Ascii(Foo)
From #FooBar
Where Foo > 'z'
Order By Foo
go
Drop Table #FooBar
Tom
"JD" <yazoo@.newsgroup.nospam> wrote in message
news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
> I've searched and have not found any good answers to this. Maybe there
> isn't one...
> I need to have a string that when sorted with an ORDER BY, it comes after
> the letter 'z'.
> The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
> I know it is best to not rely on this and use some sort of surrogate field
> to order the rows, but I cannot do that in this case - the data is being
> used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
> SharePoint will sort one of it's lists by the BDC column value, but it
> sorts only by the values in that column.
> In ASCII, I could use the tilde (~), but SQL is putting the tilde first in
> the results.
> Is there any character I could put at the beginning of the string so it
> would fall out last in the query results?
> (Remember, it is SharePoint generating the query, so I cannot change the
> SQL it uses. I only control the values in the column.)
>|||JD
select * from #FooBar order by case when foo ='z' then 1 else 2 end
"JD" <yazoo@.newsgroup.nospam> wrote in message
news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
> I've searched and have not found any good answers to this. Maybe there
> isn't one...
> I need to have a string that when sorted with an ORDER BY, it comes after
> the letter 'z'.
> The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
> I know it is best to not rely on this and use some sort of surrogate field
> to order the rows, but I cannot do that in this case - the data is being
> used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
> SharePoint will sort one of it's lists by the BDC column value, but it
> sorts only by the values in that column.
> In ASCII, I could use the tilde (~), but SQL is putting the tilde first in
> the results.
> Is there any character I could put at the beginning of the string so it
> would fall out last in the query results?
> (Remember, it is SharePoint generating the query, so I cannot change the
> SQL it uses. I only control the values in the column.)
>|||As I said, I cannot change the query, since Sharepoint is doing the query.
I can only affect the data in the column.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uVGG%2305nIHA.4328@.TK2MSFTNGP03.phx.gbl...
> JD
> select * from #FooBar order by case when foo ='z' then 1 else 2 end
>
> "JD" <yazoo@.newsgroup.nospam> wrote in message
> news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
>> I've searched and have not found any good answers to this. Maybe there
>> isn't one...
>> I need to have a string that when sorted with an ORDER BY, it comes after
>> the letter 'z'.
>> The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
>> I know it is best to not rely on this and use some sort of surrogate
>> field to order the rows, but I cannot do that in this case - the data is
>> being used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
>> SharePoint will sort one of it's lists by the BDC column value, but it
>> sorts only by the values in that column.
>> In ASCII, I could use the tilde (~), but SQL is putting the tilde first
>> in the results.
>> Is there any character I could put at the beginning of the string so it
>> would fall out last in the query results?
>> (Remember, it is SharePoint generating the query, so I cannot change the
>> SQL it uses. I only control the values in the column.)
>>
>|||Thanks - it is nvarchar, so I made a few changes to your example and found a
series of Unicode characters that sort after 'z':
set nocount on
create table #FooBar(Foo nvarchar(10))
insert #FooBar (Foo) values ('A')
declare @.i int
set @.i = 900
while (@.i < 1200)
begin
insert #FooBar (Foo) values (nchar(@.i))
set @.i = @.i + 1
end
insert #FooBar (Foo) values ('z')
select Foo, unicode(Foo)
from #FooBar
where Foo > 'z'
order by Foo
drop table #FooBar
"Tom Cooper" <tomcooper@.comcast.no.spam.please.net> wrote in message
news:O6sC0c3nIHA.4832@.TK2MSFTNGP06.phx.gbl...
>I assume the column is char or varchar? If so, you can use the value
>CHAR(208), for example,
> Set NoCount ON
> Create Table #FooBar(Foo varchar(10))
> Insert #FooBar (Foo) Values ('A')
> Insert #FooBar (Foo) Values (Char(208))
> Insert #FooBar (Foo) Values ('z')
> Select Foo, Ascii(Foo)
> From #FooBar
> Order By Foo
> go
> Drop Table #FooBar
> You can find all the characters which will sort after 'z' with the
> following code
> Set NoCount ON
> Create Table #FooBar(Foo varchar(10))
> Insert #FooBar (Foo) Values ('A')
> Insert #FooBar (Foo) Values ('z')
> Declare @.i int
> Set @.i = 1
> While @.i < 256
> Begin
> Insert #FooBar (Foo) Values (Char(@.i))
> Set @.i = @.i + 1
> End
> Select Foo, Ascii(Foo)
> From #FooBar
> Where Foo > 'z'
> Order By Foo
> go
> Drop Table #FooBar
> Tom
> "JD" <yazoo@.newsgroup.nospam> wrote in message
> news:%23uiqZB3nIHA.3556@.TK2MSFTNGP04.phx.gbl...
>> I've searched and have not found any good answers to this. Maybe there
>> isn't one...
>> I need to have a string that when sorted with an ORDER BY, it comes after
>> the letter 'z'.
>> The database is created with the collation SQL_Latin1_General_CP1_CI_AS.
>> I know it is best to not rely on this and use some sort of surrogate
>> field to order the rows, but I cannot do that in this case - the data is
>> being used by SharePoint (MOSS) in a Business Data Catalog (BDC) column.
>> SharePoint will sort one of it's lists by the BDC column value, but it
>> sorts only by the values in that column.
>> In ASCII, I could use the tilde (~), but SQL is putting the tilde first
>> in the results.
>> Is there any character I could put at the beginning of the string so it
>> would fall out last in the query results?
>> (Remember, it is SharePoint generating the query, so I cannot change the
>> SQL it uses. I only control the values in the column.)
>>
>

Friday, February 10, 2012

Chaning login name

There have been some major changes here at work, and in order to keep up we
need to change some of the Group names in Active directory. Will the
changes that are made in Active Directory cascade down into SQL Server?
What is the protocol for this type of change?
Thanks,
DrewNo. On 2005, you can rename a login (to reflect the name change) using ALTER LOGIN.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
news:OQx$0ftqIHA.5096@.TK2MSFTNGP02.phx.gbl...
> There have been some major changes here at work, and in order to keep up we need to change some of
> the Group names in Active directory. Will the changes that are made in Active Directory cascade
> down into SQL Server? What is the protocol for this type of change?
> Thanks,
> Drew
>|||What is the protocol for SQL Server 2000?
Thanks,
Drew
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:C42BDB9F-51A2-424C-8C25-58B905FB94E4@.microsoft.com...
> No. On 2005, you can rename a login (to reflect the name change) using
> ALTER LOGIN.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
> news:OQx$0ftqIHA.5096@.TK2MSFTNGP02.phx.gbl...
>> There have been some major changes here at work, and in order to keep up
>> we need to change some of the Group names in Active directory. Will the
>> changes that are made in Active Directory cascade down into SQL Server?
>> What is the protocol for this type of change?
>> Thanks,
>> Drew
>|||You can't change the name for a login in 2000. You'd have to delete and re-create the login...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
news:%234%233Q7tqIHA.2292@.TK2MSFTNGP03.phx.gbl...
> What is the protocol for SQL Server 2000?
> Thanks,
> Drew
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:C42BDB9F-51A2-424C-8C25-58B905FB94E4@.microsoft.com...
>> No. On 2005, you can rename a login (to reflect the name change) using ALTER LOGIN.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
>> news:OQx$0ftqIHA.5096@.TK2MSFTNGP02.phx.gbl...
>> There have been some major changes here at work, and in order to keep up we need to change some
>> of the Group names in Active directory. Will the changes that are made in Active Directory
>> cascade down into SQL Server? What is the protocol for this type of change?
>> Thanks,
>> Drew
>>
>