September 2, 2009 at 8:19 am
Hello everyone
i m a beginner in sql i want to know that
how to insert a table column as the parameter of a user defined function.
thanks
September 2, 2009 at 8:25 am
Can you please show us what you are trying to do, what code have you written so far?
September 2, 2009 at 11:50 pm
i have just created a table with a two columns name serialno and value.
now i want to create function which can use each value of this column for the calculation.
in sql
CREATE TABLE table1
( serialno int(),
value int() ,
)
September 3, 2009 at 2:58 am
Hi,
Are you looking for some thing like given below
CREATE Function udf_usetablecolumn (@serialno int, @value INT) RETURNS int AS
Begin
DECLARE
@RetValue varchar(1000)
SET @RetValue = @serialno+@value
Return @RetValue
END
and after creation
Select dbo.udf_usetablecolum(serialno,value)
September 3, 2009 at 3:02 am
Hi , please try to keep your related issues to one thread
http://www.sqlservercentral.com/Forums/Topic781966-324-1.aspx#bm781978
September 3, 2009 at 3:10 am
Thanks man
i will try to keep my self on one thread
September 3, 2009 at 3:41 am
Hi,
did Srikanth Anumalasetty's reply answer your question?
--------------------------------------------------------------------------------------
[highlight]Recommended Articles on How to help us help you and[/highlight]
[highlight]solve commonly asked questions[/highlight]
Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
Managing Transaction Logs by Gail Shaw[/url]
How to post Performance problems by Gail Shaw[/url]
Help, my database is corrupt. Now what? by Gail Shaw[/url]
September 4, 2009 at 1:25 am
I think he need third column as computed column.
like if the value column has value '10'
then he need some computation on value '10' and save it to third column.
example:
CREATE TABLE [dbo].[test](
[id] [int] NOT NULL,
[value] [int] NOT NULL,
[value*10] AS ([value]*(10)) ----third computed column
) ON [PRIMARY]
September 4, 2009 at 1:27 am
sorry this one is not required by them.......i misunderstand
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply