RE: Can I write insert statement in functions?

RE: Can I write insert statement in functions?

 

  


No!! you cannot insert values into permanent tables using function.


Thanks
Ashish
DBA

-----Original Message-----
From: Sarwarao Chakka
[mailto:mssqldba-ezmlmshield-x16705923.[Email address protected]
Sent: Wednesday, May 30, 2007 6:40 PM
To: LazyDBA Discussion
Subject: Can I write insert statement in functions?


Can I write insert query in Function like following query?

CREATE FUNCTION myProc1(@ID Int,@name varchar(20),@salary
money,@start_date datetime)
RETURNS Table
AS
RETURN
(
insert into employ(ID, name, salary, start_date) values
(@ID,@name,@salary,@start_date)
)
GO


Thanks and Regards ,


Sarwarao Chakka
Aspire Systems || India
Tel:+91 -44-67404000
www.aspiresys.com






This e-mail message and any attachments are for the sole use of the
intended recipient(s) and may contain proprietary, confidential, trade
secret or privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited and may be a violation of law.
If you are not the intended recipient, please contact the sender by
reply e-mail and destroy all copies of the original message.


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html

*********************************************************************************************************************************************************************
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient,any disclosure,copying, use, or distribution of the information included in this message and any attachments is
prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
*********************************************************************************************************************************************************************

MS Sql Server LazyDBA home page