How can a SharePoint SQL connection be set to query by the current login name?
I have a SQL table that needs to be queried by the login name. So, using SharePoint designer I successfully created a database connection, but I can't use the properties exposed by Profile nor Session as input parameters because they are not supported (A dialog pops up with a message indicating this)
How else can I query a SQL da开发者_Python百科tasource by using the current login?
-Edit
To create the data connection, proceed as follows
- Open the data source library
- Expand database connections and click on connect to a database
- Enter the database settings
- Select "specify custom Select, Update, Insert, and Delete"
- Click on Edit Command
- Add a parameter and select Profile and enter UserName as the property name
An error will follow stating that this is not supported.
Unfortunately, you don't give many details but I think you're looking for the LOGON_USER Server Variable: Data View / Data Form: Parameters You Don’t Know About.
精彩评论