Questions tagged [scalar-function]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
50 views

Part of parallel execution plan has serial portion

I have a big linq to sql query which runs in parallel mode. It is returning results in 8 seconds and it is pretty good. I noticed in the execution plan that the extreme right part(from where execution ...
5
votes
1answer
267 views

Why do user defined scalar functions require the schema?

When creating a user defined table function, or a user defined procedure, you can call the function or procedure as named. However, a user defined scalar function requires that you call it with the ...
0
votes
1answer
39 views

Error trying a manual's example in DB2 11.1.4.4

When trying this example from the DB2 11.1 manual: VALUES (JSON_VALUE('{"id":"987"}', 'strict $.id' RETURNING INTEGER)); I get this error: SQL0171N The statement was not processed because the ...
2
votes
2answers
65 views

Generic type functions in T-SQL

Consider the following function CREATE FUNCTION dbo.SafeDivide ( @a numeric, @b numeric ) RETURNS numeric AS BEGIN RETURN CASE WHEN @b = 0 THEN 0 ...
1
vote
1answer
53 views

Should I write a scalar function or a setof returning function for an INSERT/UPDATE/DELETE which can return at most one row?

I want to embed certain INSERT, UPDATE or DELETE statements into a function, to enhance re-usability. These functions have in common that the are manipulating a single row (if it exists). An example ...
9
votes
1answer
211 views

Apparently, my CLR assembly function is causing deadlocks?

Our application needs to work equally well with an Oracle database or a Microsoft SQL Server database. To facilitate this, we created a handful of UDFs to homogenize our query syntax. For example, SQL ...
10
votes
3answers
314 views

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

One of my query in was running in serial execution mode after a release and i noticed that two new functions were used in a view which is referenced in the LINQ to SQL Query generated from the ...
1
vote
1answer
68 views

Logic of Assigning values to variables in Scalar-valued Functions

I am currently working on updating old scalar valued functions with the hope of making them more efficient or changing them into Inline TVFs. While troubleshooting my rewrites I came across some ...
8
votes
1answer
1k views

Is it Possible to Overload SQL Server Functions?

Is it possible to overload a sql server function? Either a scalar, like ltrim, or an aggregate function, like count? Even if this was a really, really, bad idea. Is it possible? Somewhat of a ...