开发者

TSql Lookup function

开发者 https://www.devze.com 2022-12-29 21:15 出处:网络
I have a bunch of dimension tables that have unique ID and Name fields.I need a T-SQL function that returns an ID when p开发者_C百科assed a table name and a value for the name field.

I have a bunch of dimension tables that have unique ID and Name fields. I need a T-SQL function that returns an ID when p开发者_C百科assed a table name and a value for the name field.

I'm guessing the function would build a little query then execute it? Performance isn't an issue since this is a one time ETL thing.


Sounds like you want a scalar user defined function There's a lot of other ways to do it though, and udf's certainly can have some perfomance issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消