Showing posts with label standard. Show all posts
Showing posts with label standard. Show all posts

Sunday, March 25, 2012

case sensitive server - problems running scripts

I have just been given a new SQL Server 2000 box to look after in production. I just tried to run a standard t-sql script I use for setting up backup jobs and so on. However, it failed with a long list of errors - quite a surprise at first since I have run the same script on many other servers wihtout a hitch. On close examination, the problem appears to be that the new serer is setup with a server default collation... Latin1_General_BIN (I think a binary based collation makes this a case sensitive server).

This is quite an urgenet one since I have to get this wrapped up today. I don't think I can change the server's default collation without a lot of red-tape. Is there a quick way to run my scripts in a 'case insenstive' context within Query Analyzer? If so, how?

Thanks in advance,

CliveWe have that problem all of the time with the PeopleSoft servers. They can only run with binary sort orders.

If you find a way to work around the case sensitivity, please let me know!

-PatP|||Ok, well thanks anyway. It seems a bit over the top for a server to be set to case senstive by default. Even the master database is case sensitive as a result. I can't see why the s/w vendor couldn't have left the default server collation alone and just been a bit more selective about what tables/columns actually needed a _BIN collation. Laziness I suppose.

Clive|||Binary sort order os a bit faster than case sensitive, as it bypasses all of the checks for 'A' = 'a'. That aside, you should probably go over the script and change the identifiers (table names, column names) to be the proper case (fortunately this is all lowercase for system tables), and change all of your variables to be the same case throughout. The variables can be doe with find/replace very easily. After that, you would have a new script that would work on Latin1_General_CI_AS, _BIN, and _CS_AS servers.

Since i have a couple of case sensitive servers around, I have had to write all of my own scripts to be able to handle case sensitivity. Even the ones that "should" only run on the case insensitive ones. It is a good habit to get into.|||All of our main production servers are Latin1_General_BIN_437 which is actually what yours probably is. This was recommended back in the old days when it was based on 6.5. Since they reworked the architecture, It doesn't really make any difference on speed. Since it's not the industry standard to use this, it's just a big pain. Anyway, I've learned to use all upper-case for my commands and lower-case for my objects. We have a program at work that will automagically convert all your code for you. I'll see if I can "share" it with you. Saves soooooooo much time.

Case Sensitive Columns

Setup: SQL Server 2000 Standard
I have a column that contains passwords that are made up of a mix of
uppercase and lowercase letters and numbers. They're supposed to be case
sensitive, but aren't. How can I change the column settings so that they are
case sensitive?
Thanks in advance.
John SteenIt appears your database default collation is case-insensitive. You can
change the collation for a specific column to a case-sensitive one with
ALTER TABLE:
CREATE TABLE MyTable
(
MyPassword varchar(10)
)
INSERT INTO MyTable VALUES('password')
--row found
SELECT *
FROM MyTable
WHERE MyPassword = 'PASSWORD'
ALTER TABLE MyTable
ALTER COLUMN MyPassword varchar(10)
COLLATE SQL_Latin1_General_CP1_CS_AS
--row not found
SELECT *
FROM MyTable
WHERE MyPassword = 'PASSWORD'
--row found
SELECT *
FROM MyTable
WHERE MyPassword = 'password'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"John Steen" <moderndads(nospam)@.hotmail.com> wrote in message
news:CE9A1A9F-36C1-4E9E-90AE-BD1092912E7E@.microsoft.com...
> Setup: SQL Server 2000 Standard
> I have a column that contains passwords that are made up of a mix of
> uppercase and lowercase letters and numbers. They're supposed to be case
> sensitive, but aren't. How can I change the column settings so that they
> are
> case sensitive?
> Thanks in advance.
> John Steen
>|||You can also change the collation on the fly with the collate clause in
any SQL experssion in a stattement :
SELECT ...
WHERE MyColumn = MyData COLLATE FrenchBIN
A +
Dan Guzman a écrit :
> It appears your database default collation is case-insensitive. You can
> change the collation for a specific column to a case-sensitive one with
> ALTER TABLE:
> CREATE TABLE MyTable
> (
> MyPassword varchar(10)
> )
> INSERT INTO MyTable VALUES('password')
> --row found
> SELECT *
> FROM MyTable
> WHERE MyPassword = 'PASSWORD'
> ALTER TABLE MyTable
> ALTER COLUMN MyPassword varchar(10)
> COLLATE SQL_Latin1_General_CP1_CS_AS
> --row not found
> SELECT *
> FROM MyTable
> WHERE MyPassword = 'PASSWORD'
> --row found
> SELECT *
> FROM MyTable
> WHERE MyPassword = 'password'
>
Frédéric BROUARD, MVP SQL Server, expert bases de données et langage SQL
Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
Audit, conseil, expertise, formation, modélisation, tuning, optimisation
********************* http://www.datasapiens.com ***********************|||> You can also change the collation on the fly with the collate clause in
> any SQL experssion in a stattement :
That's another method that to achieve the desired result but a consideration
is that the expression won't be sargable due to the different collations.
However, one can include criteria for both collations in the WHERE clause so
that indexes can be efficiently used. The example below shows how one can
use the technique. This might not be an issue in the OP's case since it is
likely that the actual WHERE clause also includes other indexed criteria
like UserID.
CREATE TABLE MyTable
(
MyPassword varchar(10)
)
GO
CREATE INDEX MyTable_Index1 ON MyTable(MyPassword)
GO
INSERT INTO MyTable VALUES('password')
GO
SET SHOWPLAN_ALL ON
GO
--index seek
SELECT *
FROM MyTable
WHERE MyPassword = 'PASSWORD'
GO
--index scan
SELECT *
FROM MyTable
WHERE MyPassword = 'PASSWORD' COLLATE French_BIN
GO
--index seek
SELECT *
FROM MyTable
WHERE MyPassword = 'PASSWORD' AND
MyPassword = 'PASSWORD' COLLATE French_BIN
GO
SET SHOWPLAN_ALL OFF
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
"SQLpro [MVP]" <brouardf@.club-internet.fr> wrote in message
news:ersWOBtMGHA.1192@.TK2MSFTNGP11.phx.gbl...
> You can also change the collation on the fly with the collate clause in
> any SQL experssion in a stattement :
>
> SELECT ...
> WHERE MyColumn = MyData COLLATE FrenchBIN
> A +
> Dan Guzman a écrit :
>> It appears your database default collation is case-insensitive. You can
>> change the collation for a specific column to a case-sensitive one with
>> ALTER TABLE:
>> CREATE TABLE MyTable
>> (
>> MyPassword varchar(10)
>> )
>> INSERT INTO MyTable VALUES('password')
>> --row found
>> SELECT *
>> FROM MyTable
>> WHERE MyPassword = 'PASSWORD'
>> ALTER TABLE MyTable
>> ALTER COLUMN MyPassword varchar(10)
>> COLLATE SQL_Latin1_General_CP1_CS_AS
>> --row not found
>> SELECT *
>> FROM MyTable
>> WHERE MyPassword = 'PASSWORD'
>> --row found
>> SELECT *
>> FROM MyTable
>> WHERE MyPassword = 'password'
>
> --
> Frédéric BROUARD, MVP SQL Server, expert bases de données et langage SQL
> Le site sur le langage SQL et les SGBDR : http://sqlpro.developpez.com
> Audit, conseil, expertise, formation, modélisation, tuning, optimisation
> ********************* http://www.datasapiens.com ***********************|||Thanks, guys, but I'm pretty weak when it comes to scripting. I'll muddle my
way through it that way if necessary, but is there a way to do this in
Enterprise Manager? Can I do this through the "Design Table" atributes?
Thanks,
John Steen
"John Steen" wrote:
> Setup: SQL Server 2000 Standard
> I have a column that contains passwords that are made up of a mix of
> uppercase and lowercase letters and numbers. They're supposed to be case
> sensitive, but aren't. How can I change the column settings so that they are
> case sensitive?
> Thanks in advance.
> John Steen
>|||On Thu, 16 Feb 2006 07:48:30 -0800, "John Steen"
<moderndads(nospam)@.hotmail.com> wrote:
>Thanks, guys, but I'm pretty weak when it comes to scripting. I'll muddle my
>way through it that way if necessary, but is there a way to do this in
>Enterprise Manager? Can I do this through the "Design Table" atributes?
Hi John,
Yes, you can. Click the column, go to the lower pane and change the
entry in the field "Colaltion". You can click the "..." button to the
right of this field to get an assisted dialog.
But you should learn how to write SQL for this - it gives you so much
more control! (And Enterprise Manager uses some REALLY inefficient ways
to make some changes...)
--
Hugo Kornelis, SQL Server MVP|||Thanks, Hugo. And you're right, I do need to learn to write more than simple
SQL scripts. And as soon as I find the time... :-/
John Steen
"Hugo Kornelis" wrote:
> On Thu, 16 Feb 2006 07:48:30 -0800, "John Steen"
> <moderndads(nospam)@.hotmail.com> wrote:
> >Thanks, guys, but I'm pretty weak when it comes to scripting. I'll muddle my
> >way through it that way if necessary, but is there a way to do this in
> >Enterprise Manager? Can I do this through the "Design Table" atributes?
> Hi John,
> Yes, you can. Click the column, go to the lower pane and change the
> entry in the field "Colaltion". You can click the "..." button to the
> right of this field to get an assisted dialog.
> But you should learn how to write SQL for this - it gives you so much
> more control! (And Enterprise Manager uses some REALLY inefficient ways
> to make some changes...)
> --
> Hugo Kornelis, SQL Server MVP
>

Sunday, February 12, 2012

Can't upgrade sql server 2000 from professional to standard edition.

Hello Members,
I by accident installed SQL server 2000 personal edition
on a Windows 2000 server. I want to upgrade it to
standard edition to allow for more threads and users.
When i put in the standard cd and get to the upgrade
screen, the option for upgrade is grade out and I can't
click it.
Does anybody know why this happens and what I can do to
upgrade to the standard edition.
Regards,
Bill Gianoukos.
PS.. please also feel free to email me responses to
billg@.otpas.com>--Original Message--
>Hello Members,
>
>I by accident installed SQL server 2000 personal edition
>on a Windows 2000 server. I want to upgrade it to
>standard edition to allow for more threads and users.
>When i put in the standard cd and get to the upgrade
>screen, the option for upgrade is grade out and I can't
>click it.
>Does anybody know why this happens and what I can do to
>upgrade to the standard edition.
>Regards,
>Bill Gianoukos.
>PS.. please also feel free to email me responses to
>billg@.otpas.com
>.
>
You can not easily upgrade, install new instance and
migrate database over.|||Hi,
Not sure what you meant by " You can not easily upgrade".It *is* possible to
upgrade pers edition to std edition.
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
<anonymous@.discussions.microsoft.com> wrote in message
news:c4d601c43864$cb6cd990$a301280a@.phx.gbl...
> >--Original Message--
> >Hello Members,
> >
> >
> >I by accident installed SQL server 2000 personal edition
> >on a Windows 2000 server. I want to upgrade it to
> >standard edition to allow for more threads and users.
> >When i put in the standard cd and get to the upgrade
> >screen, the option for upgrade is grade out and I can't
> >click it.
> >
> >Does anybody know why this happens and what I can do to
> >upgrade to the standard edition.
> >
> >Regards,
> >Bill Gianoukos.
> >
> >PS.. please also feel free to email me responses to
> >billg@.otpas.com
> >
> >.
> >
> You can not easily upgrade, install new instance and
> migrate database over.|||Bill,
I dont know why the upgrade option is grayed out in this case.Did you check
the log files for any hints/error messages?
--
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Bill Gianoukos" <anonymous@.discussions.microsoft.com> wrote in message
news:c20f01c4384c$ef1ece60$a601280a@.phx.gbl...
> Hello Members,
>
> I by accident installed SQL server 2000 personal edition
> on a Windows 2000 server. I want to upgrade it to
> standard edition to allow for more threads and users.
> When i put in the standard cd and get to the upgrade
> screen, the option for upgrade is grade out and I can't
> click it.
> Does anybody know why this happens and what I can do to
> upgrade to the standard edition.
> Regards,
> Bill Gianoukos.
> PS.. please also feel free to email me responses to
> billg@.otpas.com
>

Can't upgrade sql server 2000 from professional to standard edition.


>--Original Message--
>Hello Members,
>
>I by accident installed SQL server 2000 personal edition
>on a Windows 2000 server. I want to upgrade it to
>standard edition to allow for more threads and users.
>When i put in the standard cd and get to the upgrade
>screen, the option for upgrade is grade out and I can't
>click it.
>Does anybody know why this happens and what I can do to
>upgrade to the standard edition.
>Regards,
>Bill Gianoukos.
>PS.. please also feel free to email me responses to
>billg@.otpas.com
>.
>
You can not easily upgrade, install new instance and
migrate database over.Hi,
Not sure what you meant by " You can not easily upgrade".It *is* possible to
upgrade pers edition to std edition.
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
<anonymous@.discussions.microsoft.com> wrote in message
news:c4d601c43864$cb6cd990$a301280a@.phx.gbl...
>
> You can not easily upgrade, install new instance and
> migrate database over.

Can't upgrade sql server 2000 from professional to standard edition.

Hello Members,
I by accident installed SQL server 2000 personal edition
on a Windows 2000 server. I want to upgrade it to
standard edition to allow for more threads and users.
When i put in the standard cd and get to the upgrade
screen, the option for upgrade is grade out and I can't
click it.
Does anybody know why this happens and what I can do to
upgrade to the standard edition.
Regards,
Bill Gianoukos.
PS.. please also feel free to email me responses to
billg@.otpas.comBill,
I dont know why the upgrade option is grayed out in this case.Did you check
the log files for any hints/error messages?
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"Bill Gianoukos" <anonymous@.discussions.microsoft.com> wrote in message
news:c20f01c4384c$ef1ece60$a601280a@.phx.gbl...
> Hello Members,
>
> I by accident installed SQL server 2000 personal edition
> on a Windows 2000 server. I want to upgrade it to
> standard edition to allow for more threads and users.
> When i put in the standard cd and get to the upgrade
> screen, the option for upgrade is grade out and I can't
> click it.
> Does anybody know why this happens and what I can do to
> upgrade to the standard edition.
> Regards,
> Bill Gianoukos.
> PS.. please also feel free to email me responses to
> billg@.otpas.com
>

Can't upgrade sql server 2000 from professional to standard edition.

Hello Members,
I by accident installed SQL server 2000 personal edition
on a Windows 2000 server. I want to upgrade it to
standard edition to allow for more threads and users.
When i put in the standard cd and get to the upgrade
screen, the option for upgrade is grade out and I can't
click it.
Does anybody know why this happens and what I can do to
upgrade to the standard edition.
Regards,
Bill Gianoukos.
PS.. please also feel free to email me responses to
billg@.otpas.com
Bill,
I dont know why the upgrade option is grayed out in this case.Did you check
the log files for any hints/error messages?
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"Bill Gianoukos" <anonymous@.discussions.microsoft.com> wrote in message
news:c20f01c4384c$ef1ece60$a601280a@.phx.gbl...
> Hello Members,
>
> I by accident installed SQL server 2000 personal edition
> on a Windows 2000 server. I want to upgrade it to
> standard edition to allow for more threads and users.
> When i put in the standard cd and get to the upgrade
> screen, the option for upgrade is grade out and I can't
> click it.
> Does anybody know why this happens and what I can do to
> upgrade to the standard edition.
> Regards,
> Bill Gianoukos.
> PS.. please also feel free to email me responses to
> billg@.otpas.com
>

Can't upgrade sql server 2000 from professional to standard edition.


>--Original Message--
>Hello Members,
>
>I by accident installed SQL server 2000 personal edition
>on a Windows 2000 server. I want to upgrade it to
>standard edition to allow for more threads and users.
>When i put in the standard cd and get to the upgrade
>screen, the option for upgrade is grade out and I can't
>click it.
>Does anybody know why this happens and what I can do to
>upgrade to the standard edition.
>Regards,
>Bill Gianoukos.
>PS.. please also feel free to email me responses to
>billg@.otpas.com
>.
>
You can not easily upgrade, install new instance and
migrate database over.
Hi,
Not sure what you meant by " You can not easily upgrade".It *is* possible to
upgrade pers edition to std edition.
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
<anonymous@.discussions.microsoft.com> wrote in message
news:c4d601c43864$cb6cd990$a301280a@.phx.gbl...
> You can not easily upgrade, install new instance and
> migrate database over.