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 |
|
compound
Starting Member
7 Posts |
Posted - 2006-06-16 : 14:21:51
|
| Is There a way to use Delete or Insert statements within a function. For exampleCREATE FUNCTION Compl_Rating(@Accnt varchar(16))RETURNS varchar(1000) AS BEGIN declare @result as varchar(1000) insert Compl_Report (Account) values (@Accnt)endreturn @resultENDThank you! |
|
|
SreenivasBora
Posting Yak Master
164 Posts |
Posted - 2006-06-16 : 16:44:54
|
| You cannot manuplate data on Base tables from Function. Why cant you use Triggers / Stored Proc?With RegardsBSR |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-19 : 05:09:36
|
| Use Stored Procedure to do DMLMadhivananFailing to plan is Planning to fail |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-19 : 05:27:16
|
| what exactly are you trying to do? why do you need an insert inside the function?--------------------keeping it simple... |
 |
|
|
gurusamy.senthil
Yak Posting Veteran
65 Posts |
Posted - 2006-06-19 : 06:19:27
|
| Don't make your DB complex.As maddy said better go for Stored procedures to do your DML.It is easier to use and handle errors in stored procedures |
 |
|
|
|
|
|