Creating Functions

Discussion in 'Databases' started by PGScannell, May 27, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I just created a function in my database, however I don't seem to have permissions to run it.

    What do I do??

    Thanks in advance,
    Jerry
     
  2. Correction to: Creating Functions

    My function references the view: sys.dm_exec_connections
    which for some reason is off-limits to me even though it shows up as a system view.

    Here is the code I am trying to execute. If someone knows what we need to do to allow me access to the view, let me know:

    CREATE FUNCTION [dbo].[GetCurrentIP] ()
    RETURNS varchar(255)
    AS
    BEGIN
    DECLARE @IP_Address varchar(255);

    SELECT @IP_Address = client_net_address
    FROM sys.dm_exec_connections
    WHERE Session_id = @@SPID;

    Return @IP_Address;
    END


    Thanks in advance,
    Jerry
     
  3. dmitri

    dmitri DiscountASP.NET Staff

    Querying Dynamic Management Views is not allowed in our shared hosting environment for the security reason.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page