locked
How to Find the database and the table name a WebPart is connected to? 2007 RRS feed

  • Question

  • In my SharePoint 2007; I have a WebPart that displays read data in 3 columns. I need to either add another column to this webpart or find the table name where it is getting the data from so I can run a query in SQL Server Management console. 
    Wednesday, October 31, 2012 2:07 PM

Answers

  • Hey Shavaan,

     

    I would suggest setting up a SQL profiler trace to monitor the traffic between the sharepoint server and the SQL box. Just to help try and clarify some of the confusion, the web part that you currently have could be doing 2 different things. Like Entang Ming has suggested, the web part could be pulling the content that is showing on another one of your sharepoint sites. The other scenario is the web part could be pulling information from a sql table but usually this requires that you configure a BCS connection to do so. Getting a profiler trace, should help focus your efforts to find the exact table that is being called when you load the page. I would also recommend setting up a filter on the profile trace to only show traffic on the content database that is associated with the web application that you are working with.

    Another option is to enable Developer Dashboard on the web application. This will allow you to see the query made to sql while rendering the page. I have attached a screen shot below to give you a better idea.

    A 3rd option is to enable VerboseEx which will log the sql queries in the ULS logs. This is very data intensive so make sure you disable it afterwards. You can start ULS viewer and just record the session while you load the page to minimize the log size. I hope these methods can help you find your answer.


    Monday, November 5, 2012 6:27 PM

All replies

  • Hi,

    I understand that you want to  find out the table name which is connected to a web part. What kind of web part are you talking about?

    If you are using data view web parts, you can add a column to the web part by editing the web part in SharePoint designer. If you are using custom web parts, you need to check the data source for the web part by contacting the web part createor.

    Thanks,

    Entan Ming

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contacttnmff@microsoft.com.


    Entan Ming

    TechNet Community Support

    Thursday, November 1, 2012 5:49 AM
    Moderator
  • Its a Survey ListView web part.

    When I go to Site Settings -> Edit Page  and select 'edit' from the dropdown for 'Modify Shared Web Part'; I do not see a place where I can add a new column and also do not see database/table information.

    Thursday, November 1, 2012 2:02 PM
  • Hi,

    The Survey list webpart pulls data from the Survey list in the site. Techincally, for any list/library webpart in order to add/delete columns, you would be able to do it by editing the view (in the "Modify shared web part", you will see the link right below the current view drop-down). But for surveys, there is nothing to add/edit coulmuns for a view, hence you will not be seeing that.

    Thursday, November 1, 2012 2:27 PM
  • I was able to figure out how to add new column to the list but still not been able to figure out where it is getting the data from.
    Thursday, November 1, 2012 7:31 PM
  • Hi,

    Going directly to SQL server database is not supported by Microsoft. You shouldn’t operate on the tables directly. The columns and lists information are not stored in the same table  in SQL. All the lists information are stored in AllLists table. The items are stored along with user. In order to get all the information about a list, you need to join multiple tables(Which is absolutely not supported).

    So if you want to modify a list or a web part, it is recommended to add through user interface.

    Thanks,

    Entan Ming

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contacttnmff@microsoft.com.


    Entan Ming

    TechNet Community Support

    Friday, November 2, 2012 7:59 AM
    Moderator
  • I just need to know how to find the database and the table it is connected to.
    Friday, November 2, 2012 1:11 PM
  • Hey Shavaan,

     

    I would suggest setting up a SQL profiler trace to monitor the traffic between the sharepoint server and the SQL box. Just to help try and clarify some of the confusion, the web part that you currently have could be doing 2 different things. Like Entang Ming has suggested, the web part could be pulling the content that is showing on another one of your sharepoint sites. The other scenario is the web part could be pulling information from a sql table but usually this requires that you configure a BCS connection to do so. Getting a profiler trace, should help focus your efforts to find the exact table that is being called when you load the page. I would also recommend setting up a filter on the profile trace to only show traffic on the content database that is associated with the web application that you are working with.

    Another option is to enable Developer Dashboard on the web application. This will allow you to see the query made to sql while rendering the page. I have attached a screen shot below to give you a better idea.

    A 3rd option is to enable VerboseEx which will log the sql queries in the ULS logs. This is very data intensive so make sure you disable it afterwards. You can start ULS viewer and just record the session while you load the page to minimize the log size. I hope these methods can help you find your answer.


    Monday, November 5, 2012 6:27 PM