Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jayram11
Yak Posting Veteran
97 Posts |
Posted - 2010-12-16 : 09:34:35
|
| Hihere is my update statement for what i wantupdate mytableset DESCRIPTION = convert(varchar(500), upper(substring(DESCRIPTION,1,1))+ lower(substring(DESCRIPTION,2,499)))how can i make a function for this so that i can do this assuming the function name is Case?update mytableset DESCRIPTION = dbo.Case(city),county = dbo.Case(County)thanks |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2010-12-16 : 09:41:43
|
| [code]CREATE FUNCTION dbo.ProperCase(@string varchar(500))RETURNS varchar(500) ASBEGIN RETURN STUFF(LOWER(@string),1,1,UPPER(LEFT(@string,1)))ENDGO[/code]Do not name the function CASE, it's a SQL statement. |
 |
|
|
jayram11
Yak Posting Veteran
97 Posts |
Posted - 2010-12-16 : 09:56:25
|
| Thankx |
 |
|
|
|
|
|