Thursday, March 22, 2012
Changing the collation
I am pursuing for a statement or function which allow me change the
collation at database level.
Thanks in advance and regards,
Enrichi enric,
I think you can change collation on database level using "alter database
collate command "
ALTER DATABASE database
{ ADD FILE < filespec > [ ,...n ] [ TO FILEGROUP filegroup_name ]
| ADD LOG FILE < filespec > [ ,...n ]
| REMOVE FILE logical_file_name
| ADD FILEGROUP filegroup_name
| REMOVE FILEGROUP filegroup_name
| MODIFY FILE < filespec >
| MODIFY NAME = new_dbname
| MODIFY FILEGROUP filegroup_name {filegroup_property | NAME =
new_filegroup_name }
| SET < optionspec > [ ,...n ] [ WITH < termination > ]
| COLLATE < collation_name >
}
thanks,
Jose de Jesus Jr. Mcp,Mcdba
MCP #2324787
"Enric" wrote:
> Dear gurus,
> I am pursuing for a statement or function which allow me change the
> collation at database level.
> Thanks in advance and regards,
> Enric|||Yes, but that will not change collation for the existing tables. For that, y
ou need to do ALTER
TABLE ... ALTER COLUMN for each table and each column in the database. And i
t also require you to
drop indexes (and probably a few more things). Not fun...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jose G. de Jesus Jr MCP, MCDBA" <Email me> wrote in message
news:2CA8C84A-C24A-4F58-8860-4C3F3D454037@.microsoft.com...
> hi enric,
> I think you can change collation on database level using "alter database
> collate command "
>
> ALTER DATABASE database
> { ADD FILE < filespec > [ ,...n ] [ TO FILEGROUP filegroup_name ]
> | ADD LOG FILE < filespec > [ ,...n ]
> | REMOVE FILE logical_file_name
> | ADD FILEGROUP filegroup_name
> | REMOVE FILEGROUP filegroup_name
> | MODIFY FILE < filespec >
> | MODIFY NAME = new_dbname
> | MODIFY FILEGROUP filegroup_name {filegroup_property | NAME =
> new_filegroup_name }
> | SET < optionspec > [ ,...n ] [ WITH < termination > ]
> | COLLATE < collation_name >
> }
> --
> thanks,
> --
> Jose de Jesus Jr. Mcp,Mcdba
> MCP #2324787
>
> "Enric" wrote:
>
Thursday, March 8, 2012
changing records in tables
I was just wondering... Is there any built-in function in MS SQL, which will
allow me to do rows' "capitalisation"?
Lets say that in database.table.name I've got:
"FOO BAR LTD.", which I want to change to "Foo Bar Ltd."
"Foo bar LTD.", which I want to be "Foo Bar Ltd.".
Is there any way of doing this or do I have to read it from database, change
in some script, and then insert it back into the table?
Hope it's all clear ;-)
Thank you,
MartinMartin Lukasik (marcin@.milea.pl.i.hate.this.spam) writes:
Quote:
Originally Posted by
I was just wondering... Is there any built-in function in MS SQL, which
will allow me to do rows' "capitalisation"?
Lets say that in database.table.name I've got:
"FOO BAR LTD.", which I want to change to "Foo Bar Ltd."
"Foo bar LTD.", which I want to be "Foo Bar Ltd.".
Is there any way of doing this or do I have to read it from database,
change in some script, and then insert it back into the table?
No, there is no built in for this. You could write your own scalar
UDF for this.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi There,
Search for "Camel Case" in Google
With Warm Regards
Jatinder Singh
http://jatindersingh.blogspot.com