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
 Nulls

Author  Topic 

inzane
Starting Member

6 Posts

Posted - 2007-05-21 : 09:12:39
Hi i am new to SQL, and i have a data base thats got NULLS in it
is there a query i can run, which can take the NULL value out ?
anything will be greatly appreciated.

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-05-21 : 09:14:08
What do you mean by "take NULL out" ?

Dinakar Nethi
SQL Server MVP
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

inzane
Starting Member

6 Posts

Posted - 2007-05-21 : 09:18:14
i have this database that have NULLS in them, there is this query i am running and its giving me this error message

invalid varient type conversion,

the manufacture of the software is telling me that i have NUlls and thats doing this and in order for them to take this nulls table or value out they want to charge me $$$$$$
so i was wondering if i can run a query to take care of this,
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-21 : 09:18:24
Do you mean you want to find rows where value for particular field is NULL?

SELECT * FROM TABLE WHERE FIELD IS NULL


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

inzane
Starting Member

6 Posts

Posted - 2007-05-21 : 09:26:24
this is what i am getting

Invalid variant type conversion

/MAINPAGE AttEntWebClient.MainPage [MainPage [MainPageDefaultMode TAttHTMLSupervisorPage.RenderContent [SpreadsheetScheduling [BuildGroupScheduleGrid [BuildScheduleGrid [RenderDaysSchedules [Invalid variant type conversion]]]]]]]]
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-05-21 : 09:43:47
You need to tell us what you are doing...do you know T-SQL?

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

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

inzane
Starting Member

6 Posts

Posted - 2007-05-21 : 09:54:30
i don't know t-sql,
all i was trying to find out how to get rid of the NULLS from the database, i am not trying to do something special,
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-21 : 10:03:55
Are you using SQL Server 2000?

Madhivanan

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

inzane
Starting Member

6 Posts

Posted - 2007-05-21 : 10:37:48
yes sql 2000
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-05-21 : 10:59:14
OK, so what do you want to replace nulls with?

And you are going to need to use T-SQL most likely



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

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-21 : 11:25:05
quote:
Originally posted by inzane

this is what i am getting

Invalid variant type conversion

/MAINPAGE AttEntWebClient.MainPage [MainPage [MainPageDefaultMode TAttHTMLSupervisorPage.RenderContent [SpreadsheetScheduling [BuildGroupScheduleGrid [BuildScheduleGrid [RenderDaysSchedules [Invalid variant type conversion]]]]]]]]

Post the query you used

Madhivanan

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

inzane
Starting Member

6 Posts

Posted - 2007-05-21 : 11:25:08
Thanks everyone for your replies

well i want to replace NULLS with 1
but before i do that i want to find out where the NULLS are in the database!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-21 : 11:26:34
<<
where the NULLS are in the database!
>>

Is that table?

Where Col is NULL

Seems you need to Learn SQL

http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

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

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-05-21 : 11:28:25
Null already represents the absence of a value. If you try to "remove" a Null, you run the risk of ripping a hole in the space-time continuum. Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light. Total protonic reversal. This is guaranteed to piss off your project manager.

e4 d5 xd5 Nf6
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-05-21 : 11:32:08
quote:
Originally posted by blindman

Null already represents the absence of a value. If you try to "remove" a Null, you run the risk of ripping a hole in the space-time continuum. Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light. Total protonic reversal. This is guaranteed to piss off your project manager.

e4 d5 xd5 Nf6



you funny

SELECT * FROM INFORMATION_SCHEMA.Columns
WHERE IS_NULLABLE = 'YES'




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

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -