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
 removing *

Author  Topic 

sgraves
Starting Member

29 Posts

Posted - 2005-08-18 : 10:42:46
Hi! I am trying to remove an "*" I used to transfer a file from Excel to SQL. I put the "*" in the NULL values so that I would not get an error. Now that I have the file in SQL, I need to remove the :*" from some columns in my table. How can I select all of those in a column and delete them without deleting each individual one. Any ideas?

Thanks for your help.

Scott

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-18 : 10:46:02
If that column of the table has * then use update

Update yourtable set starColumn=''

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-08-18 : 10:48:30
Have a look at this

http://weblogs.sqlteam.com/brettk/archive/2005/02/08/4144.aspx



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

sgraves
Starting Member

29 Posts

Posted - 2005-08-18 : 11:20:33
I have no clue on how to do either of what you suggested. Can you give me some steps. I am new to SQL.

Thanks guys for your help.

Scott
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-08-18 : 11:25:28
Scott...can you cut and paste?

Just cut and paste all of the code in that link

Goto Query Analyzer and paste the code there...then just run it to see what it does.

You don't have to do anything else.



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

mmarovic
Aged Yak Warrior

518 Posts

Posted - 2005-08-18 : 11:34:24
What do you want to have instead of "*"?
update table
set column = <new value>
where column = '*'
Is it what you are looking for?
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-08-18 : 16:50:54
quote:
Originally posted by mmarovic

What do you want to have instead of "*"?
update table
set column = <new value>
where column = '*'
Is it what you are looking for?



Problem is, they don't know what tables or what columns...

The link I gave hime will scan the entire database



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -