Showing posts with label case. Show all posts
Showing posts with label case. Show all posts

Friday, March 30, 2012

how to make the contets of tables, case sensitive?

hi

the contents of sql server tables, aren't case sensitive.
and datas in them , are the same , whether they contains normal or caps letter.
for example Test = test=teST , and sql can't recogize the difference between them.

how can i make it sensitive?

thank u for your attention

Case-sensitivity is controlled by the collation that's being used by the server in the context of the query you're executing. I believe you can set the collation at the server, database or column level in SQL Server 2005. For more information, see the "Working with Collations" topic in Books Online.

Also, please post relational database engine questions to the SQL Database Engine forum (http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=93) where you're likely to get more prompt and accurate replies.

Raman Iyer
SQL Server Data Mining

sql

how to make the contents of tables, case sensitive?

hi

the contents of sql server tables, aren't case sensitive.
and datas in them , are the same , whether they contains normal or caps letter.
for example Test = test=teST , and sql can't recogize the difference between them.

how can i make it sensitive?

thank u for your attention

Case-sensitivity is controlled by the collation that's being used by the server in the context of the query you're executing. I believe you can set the collation at the server, database or column level in SQL Server 2005. For more information, see the "Working with Collations" topic in Books Online.

Also, please post relational database engine questions to the SQL Database Engine forum (http://forums.microsoft.com/msdn/ShowForum.aspx?ForumID=93) where you're likely to get more prompt and accurate replies.

Raman Iyer
SQL Server Data Mining

how to make the contents of sqlserver tables, case sensitive?

hi

the contents of sql server tables, aren't case sensitive.
and datas in them , are the same , whether they contains normal or caps letter.
for example Test = test=teST , and sql can't recogize the difference between them.

how can i make it sensitive?

thank u for your attention

Hi,
you may create a database with a case sesitive Collation and this will make the whole database case sestive including table names i.e.
select * from SYSOBJECTS will give you an error

Wednesday, March 28, 2012

How to make proper foreign keys in EM? And how to create tables using SQL statem

Hi!

I wonder how to make right foreign keys in Enterprise Manager. I use diagram but in this case I get 'rigid' keys, so I can't delete records. But I want it to set NULL on removing records.

And is it possible to create tables by writing SQl statements in EM? I tried but the new table didn't appear :(.Use Query Analyzer and you will know what are you doing (GUI does not show what it does).sql

how to make password field case sensitive in sql server 2005

Hi,

SELECT UserID, UserName, Password, PublisherID, Currency
FROM [User]
WHERE (Password = 'Anitha') I am using the above mentioned it is working but int the password field i had given it as anitha. Now the querry is retriving the record for anitha, it shouldnot happen. The querry should retrive the record of anitha only for where condition anitha and not for Anitha or ANITHA etc..

Thanks

Vishwanath

Convert the password field and password value to varbinary and compare if they are equal.

Here is the code:

select

*from userswhere UserName='Nilesh'Andcast(passwordasvarbinary(20))=cast(N'password'asvarbinary(20))

The usename is not case sensitive but password is.

|||

hi Vishwanath,

its good practise to store passwords in encoded/encrypted format. what i do is use a custom encryption function which uses our own logic to encrypt each character and store it.

to add what Nilesh has mentioned read this linkhttp://vyaskn.tripod.com/case_sensitive_search_in_sql_server.htm

Hope it helps.

regards,

Satish.

|||

Hi satish,

now its working fine, but when i choose the collation property from that password field and changed it to bin format then at that it gave some warning message saying that some of the data will be lost, but when i choose yes i couldnt experience any such loss of data. Everything is working fine..

Thnaks

Vishwanath

|||

ohk sounds cool.

please mark the post which helped you as answered, it will give credit to answerer and post will be resolved.

thanks,

satish.

Monday, March 26, 2012

how to make column lowercase

I have a table that contains names that are all in upper case, this column is called in many different areas of my web app. I wanted to make the names all lowercase, or with the leading character only capitalized.
How can I make a column within a SQL table lowercase at the SQL server end and not the programming side?

thanks,
Frank


UPDATE
TableName
SET
FieldName = LCASE(FieldName)

For all future entries, you create a trigger that will execute on insert.|||If you are talking about the data to be converted in lowercase, then following is the syntax:

select lower(column_name) from table_name

To convert first letter in Capital, you could write your own function, using UPPER, LOWER, SUBSTRING and CHARINDEX.
You can use CHARINDEX to find the spaces, then UPPER the character following each space.|||How can I do this automatically in the Formula field of the Table Design.

thanks

how to make all Updates\ Inserts in the database Upper case?

I have a Sql server 2000 database which is already in production. The client
now want all the data entered from the application to be stored in Upper
case, irrespective of how the case typed it in the application. Is there any
system Database option in the database which when set to On would save all
the data being stored to UPPER CASE.
thanks
Sameer
> I have a Sql server 2000 database which is already in production. The
client
> now want all the data entered from the application to be stored in Upper
> case, irrespective of how the case typed it in the application.
Does the client really care how it is STORED? You could easily create views
for all the relevant tables which perform UPPER() on varchar columns, and
this would be much easier than using triggers on all the tables to do the
convert on entry, IMHO.
http://www.aspfaq.com/
(Reverse address to reply.)
|||You can do this in several places. Edit your client side code, so that it
converts all the input data to upper case, and then passes to the database.
Another option is to edit your stored procedures, so that they convert the
input data to upper case, before inserting/updating tables.
Yet another option is to have a trigger that converts the data to upper
case, but not really recommended, because of performance implications.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"sameer" <sameer@.discussions.microsoft.com> wrote in message
news:B7CDA2D8-FEAF-4C1B-8E5A-EE8357F8D239@.microsoft.com...
I have a Sql server 2000 database which is already in production. The client
now want all the data entered from the application to be stored in Upper
case, irrespective of how the case typed it in the application. Is there any
system Database option in the database which when set to On would save all
the data being stored to UPPER CASE.
thanks
Sameer
|||thanks for your help Narayana .
I already did consider these 3 options but i am at a point where with the no
of the database table, stored procs and application, it would take me a long
time to do any kind of programming to implement any of these 3 options. And
that is why i was curious if there is any Option in the database like the
'case-sesitive' Coalition which when set to ON would convert all the data
being stored in the datase to Upper case. Again please let me know if there
is any option or any other way other than the once you have metioned which
when i set would force all the data comming in to Upper case.
thanks, waiting for you reply
sameer
"Narayana Vyas Kondreddi" wrote:

> You can do this in several places. Edit your client side code, so that it
> converts all the input data to upper case, and then passes to the database.
> Another option is to edit your stored procedures, so that they convert the
> input data to upper case, before inserting/updating tables.
> Yet another option is to have a trigger that converts the data to upper
> case, but not really recommended, because of performance implications.
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "sameer" <sameer@.discussions.microsoft.com> wrote in message
> news:B7CDA2D8-FEAF-4C1B-8E5A-EE8357F8D239@.microsoft.com...
> I have a Sql server 2000 database which is already in production. The client
> now want all the data entered from the application to be stored in Upper
> case, irrespective of how the case typed it in the application. Is there any
> system Database option in the database which when set to On would save all
> the data being stored to UPPER CASE.
> thanks
> Sameer
>
>
|||thanks for your help Aaron.
I already did consider this option but i am at a point where with the no of
the database table, stored procs and application, it would take me a long
time to do any kind of developement to implement any of these 3 options. And
that is why i was curious if there is any Option in the database like the
'case-sesitive' Coalition which when set to ON would convert all the data
being stored in the datase to Upper case. again, please let me know if there
is any such switch in the database.
thanks
sameer
"Aaron [SQL Server MVP]" wrote:

> client
> Does the client really care how it is STORED? You could easily create views
> for all the relevant tables which perform UPPER() on varchar columns, and
> this would be much easier than using triggers on all the tables to do the
> convert on entry, IMHO.
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
|||No, there are case-sensitive collations, but there is no global switch that
will force all data to upper case, sorry.
Tell the client if they really want this that there will be development time
involved.
http://www.aspfaq.com/
(Reverse address to reply.)
"sameer" <sameer@.discussions.microsoft.com> wrote in message
news:53744680-6679-4B86-A90B-51B80FEFA47F@.microsoft.com...
> thanks for your help Aaron.
> I already did consider this option but i am at a point where with the no
of
> the database table, stored procs and application, it would take me a long
> time to do any kind of developement to implement any of these 3 options.
And
> that is why i was curious if there is any Option in the database like the
> 'case-sesitive' Coalition which when set to ON would convert all the data
> being stored in the datase to Upper case. again, please let me know if
there[vbcol=seagreen]
> is any such switch in the database.
> thanks
> sameer
> "Aaron [SQL Server MVP]" wrote:
Upper[vbcol=seagreen]
views[vbcol=seagreen]
and[vbcol=seagreen]
the[vbcol=seagreen]