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
 can insert statement works in case when function

Author  Topic 

damuchinni
Starting Member

29 Posts

Posted - 2007-11-05 : 00:32:54
Hi

Im beginer in sql,Please guide

can insert statement works fine in case when function

for example

case when condition1=true then (first insert statement based on some condition) when condition2=true then (second insert statement based on some other condition)
end

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-05 : 00:39:52
use IF ... ELSE statement


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

damuchinni
Starting Member

29 Posts

Posted - 2007-11-05 : 00:42:04
if else statement is nothing but case when rite

my question is that "insert statement works fine in if else "
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-11-05 : 01:31:09
quote:
Originally posted by damuchinni

if else statement is nothing but case when rite

my question is that "insert statement works fine in if else "


No. Test and see

Madhivanan

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

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-05 : 01:59:43
quote:
Originally posted by damuchinni

if else statement is nothing but case when rite

my question is that "insert statement works fine in if else "



Yes. It works very fine.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-11-05 : 03:48:09
moved from script library

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -