How to get the user profile using SQL stored procedure

15 pts.
Tags:
SQL
Stored Procedures
Does anyone know how to get the user profile using SQL stored procedure?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Try this search. USER_ID() function
sql user_id function iseries In Google.
See the Red book mentioned. Good luck.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • stephenronald

    You could start with something like this:

    SELECT 
        OBJECT_NAME(st.objectid,st.dbid) AS ObjectName,
        cp.usecounts AS ExecutionCount,
        st.TEXT AS QueryText,
        qp.query_plan AS QueryPlan
    FROM 
        sys.dm_exec_cached_plans AS cp
        CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp
        CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) AS st
    WHERE 
        cp.objtype = 'Proc'
        AND OBJECT_NAME(st.objectid,st.dbid) = 'YourStoredProcedure';
    
    415 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: