Dynamic tables from UDF in SQL Server -


How can I fix this problem?

  Go to SET ANSI_NULLS Go to set QUOTED_IDENTIFIER functions [DBO]. [GetDataById] () Get started as return INT @ quality NVARAR (500) DECLARE @JINT SET @ query = NEEEL * EXEC @ sp_executesql @ quality return @j list  

When I try to do this one: choose dbo.GetDataById ()

I get an error message:

only functions and Extended stored procedures can be executed from within a function.

From the itemprop = "text">

Erland Somersog, SQL Server MVP:

You can not use dynamic SQL from the defined function used in T-SQL. The reason for this is that you do not have permission to do anything in the UDF which can change the database status (as the UDF can be applied as part of a question). Since you can do anything with dynamic SQL, including updates, it is clear that dynamic SQL is not allowed.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -