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.
| Author |
Topic |
|
SKP
Starting Member
34 Posts |
Posted - 2006-03-27 : 09:57:05
|
| Hi!I have a situation where my data from the column is not null, but it is blank, is there any T-Sql function to check whether a data is blank or not. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-03-27 : 09:59:13
|
is it a string column ? blank as in empty string ?use yourstringcolumn = '' KHChoice is an illusion, created between those with power, and those without.Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-03-27 : 09:59:35
|
| where col = ''instead ofwhere col is null==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-03-27 : 10:14:59
|
or we use this function for checking the emptystring .. CREATE FUNCTION IsEmptyVarChar (@CheckVariable Varchar(8000))RETURNS varchar(8000) AS BEGIN IF LEN(LTRIM(RTRIM(@CheckVariable)))= 0 BEGIN SET @CheckVariable = NULLENDRETURN @CheckVariable END Where Dbo.IsEmptyVarChar(Col) Is Null -- These means its empty If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
SKP
Starting Member
34 Posts |
Posted - 2006-03-27 : 10:39:35
|
| Thanks Chirag,Your function did my job , I wrote similar function, but i was not using trim and checking the length as 0, I was checking ISNULL or ' '.Obviously ' ' didn't work. But your code is good, thanks.Thanks to all of you who replied. Appreciate your valuable time. |
 |
|
|
|
|
|
|
|