473,385 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing Temp Table Values into a UDF

This one is interesting...

Is there any way to pass a joined parameter into a UDF as I'm attempting below?

I have a temp table that I'm trying to create:

create table #t3
( bmkPerson int primary key,
LangCode nchar(5),
SName varchar(1000)
)
insert into #t3
select t2.bmkPerson, t2.LangCode,
select SName from SName_trans_udf(t2.LangCode)
from #t2 t2
Thanks in advance,

Renae
hi*******@yahoo.com
Jul 20 '05 #1
1 1918
Renae (hi*******@yahoo.com) writes:
Is there any way to pass a joined parameter into a UDF as I'm attempting
below?

I have a temp table that I'm trying to create:

create table #t3
( bmkPerson int primary key,
LangCode nchar(5),
SName varchar(1000)
)
insert into #t3
select t2.bmkPerson, t2.LangCode,
select SName from SName_trans_udf(t2.LangCode)
from #t2 t2


No, you cannot pass a column value to a table-valued UDF. And when you
think of it it is logical: what result would you get? For each column
you get a whole table back. A scalar UDF works fine, because it's a
scalar value you need here.

SQL 2005 however does permit you to pass a column to a table-valued
UDF, but there is a special syntax for this. (Which I have not explored
yet, so I cannot give any examples.)
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Berend | last post by:
I am trying to pass multi values into a where clause with an in clause in a store procedure to use in a Crystal report. This can change depending on the user. Maybe there is another way to pass...
1
by: Jim | last post by:
For some reason the compiler is telling me that I must declarethe variable @costcenter_tmp on lines 74 and 98...but if i put a select statement in ther (for testing) before the loop I get data back...
1
by: droope | last post by:
I am trying to create a proc with a parm @whereclause that will have a value passed in of one to many policy ids. The parm coming into the proc looks like this, ('000000000108', '000000000106',...
21
by: Boris Popov | last post by:
Hello pgsql-general, I'm trying to implement a table with rows that are automatically deleted when the session that inserted them disconnects, sort of like our own alternative to...
7
by: John Baker | last post by:
Hi: I would like to know how to create a temp DB to store the data in a table while I do something else with the table. Specifically, how do I create the temp remove the temp I want to be...
5
by: Timothy Perrigo | last post by:
This bug? feature? caused a bit of havoc for us yesterday...A reproducible example follows. Essentially, if you have a table with a primary key called "id", and you create a temp table (via a...
3
by: delram | last post by:
I'm trying to get user selections (using checkboxes) on one JSP page(A.jsp) and pass them on to another page. So I have one page with a list of dynamically populated items like this 1 2 ...
0
by: nico3334 | last post by:
I am creating a report that pulls values from a SQL table in visual basic. I have 3 main procedures. The Main procedure PrintInitialize CALLS 2 other procedures during its coding: GetTempData...
0
by: Mark C. Stock | last post by:
"Mark C. Stock" <mcstockX@Xenquery .comwrote in message news:... | | "Berend" <Berend.Brinkhuis@evatone.comwrote in message | news:bdd9ac20.0401271301.22cdb65e@posting.google.com... | | I am...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.