Link to home
Start Free TrialLog in
Avatar of toddpotter
toddpotter

asked on

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.
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Hi toddpotter,

This ought to do it:

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

Regards,

Patrick
Avatar of toddpotter
toddpotter

ASKER

Do I do this through Enterprise Manager?
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
toddpotter,

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

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

toddpotter
Thank you, Nata.

Regards,

Patrick