• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3643
  • Last Modified:

SQL Server Update/Replace Command

I am a very new user to SQL Sever and I am trying to change all of the NULL fields in a table to a "_".  Can someone direct me how to accomplish this.  I even need the basics like "create a stored procedure..." or "add a user defined function.."  Besides creating tables and viewing tables I know very little about SQL.  Thanks.
0
toddpotter
Asked:
toddpotter
  • 4
  • 2
  • 2
1 Solution
 
Patrick MatthewsCommented:
Hi toddpotter,

This ought to do it:

UPDATE YourTable
SET YourColumn = '_'
WHERE YourColumn IS NULL

Regards,

Patrick
0
 
toddpotterAuthor Commented:
Do I do this through Enterprise Manager?
0
 
Patrick MatthewsCommented:
toddpotter,

Query Analyzer

Regards,

Patrick
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
ptjcbCommented:
toddpotter - you should avoid using Enterprise Manager to run queries. It is a good tool to manage databases, but it will sometimes fail to return results (time outs) or inconsistent results. To run queries, Query Analyzer is your friend. This link is a good example of the differences between the two tools.
0
 
ptjcbCommented:
Sorry - here is the link

http://www.aspfaq.com/show.asp?id=2455
0
 
Patrick MatthewsCommented:
toddpotter,

With no disrespect intended toward ptjcb, why didn't you select my answer?

Patrick
0
 
toddpotterAuthor Commented:
Honestly, I thought that I did but I selected ptjcb's reply by mistake.

toddpotter
0
 
Patrick MatthewsCommented:
Thank you, Nata.

Regards,

Patrick
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now