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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How do I make this query actually update the DB?

Author  Topic 

Mamoru
Starting Member

2 Posts

Posted - 2008-10-08 : 16:24:30
Hello,

I've been poking around with this for about an hour now, and between searches on Google for how-to querys and my books I've reached a point where I'm lost.

I'm trying to convert all text in a table to Proper Case. (All lower case, first letter of each word Caps.) I've got a working function already made, but I'm not really sure what to do with it here.

Select dbo.properCase(Contactstreet)
From BASE10..Contacts


I execute that query and the results look good. About 130 addresses get spit out on the bottom window, and I'm happy with the output.

This is probably embarrassingly nubish but I don't know how to make it actually make the changes to the DB. Every variation of an UPDATE statement I've tried returns incorrect syntax errors.


I'm currently using MS SQL Server 2005.

Thank you.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-08 : 16:25:59
UPDATE BASE10..Contacts
SET ContactStreet = dbo.properCase(ContactStreet)

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Mamoru
Starting Member

2 Posts

Posted - 2008-10-09 : 11:02:23
Aah... OK!

Thank you, Tara!
Go to Top of Page
   

- Advertisement -