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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 simple select len question

Author  Topic 

chedderslam
Posting Yak Master

223 Posts

Posted - 2009-02-19 : 11:50:54
I have an insert that I only want to run if a column for a record has length gt 0.

I have poked around google and here and can't find a solution that works.

Can anyone provide an example?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-19 : 11:55:39
[code]
insert into table
SELECT columns....
FROM table2
WHERE LEN(yourcolumn)>0
[/code]
Go to Top of Page

chedderslam
Posting Yak Master

223 Posts

Posted - 2009-02-19 : 12:11:43
Even better than the conditional logic I had planned. Thanks for the quick help.

Cheers!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-19 : 12:14:05
welcome
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-02-20 : 03:13:17
or

insert into table
SELECT columns....
FROM table2
WHERE yourcolumn>''


Madhivanan

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

- Advertisement -