In this example we will use a SharePoint list as a data source in a SSRS report using SQL Server 2012 Report Builder.
Begin by adding a new data source to your report. Select Microsoft SharePoint List under the connection type dropdown. For the connection string you will want to enter the root URL for your site/subsite. For example, if the URL for our list is
http://technicaloverload.com/My-Test-List/, then you would enter
http://technicaloverload.com/ in the connection sting box.
Here are three easy ways to change the default database for a user in SQL Server.
Option 1: Execute the system stored procedure
EXEC sp_defaultdb @loginame='UserName', @defdb='NewDefaultDB'
Sometimes you may need to temporarily disable an index before performing an action. To do so in SQL Server you can use the ALTER INDEX statement.
To disable the index:
ALTER INDEX index_name ON tablename DISABLE
To enable it again you just need to rebuild:
ALTER INDEX index_name ON tablename REBUILD
While none of our own databases would have issues with duplicate records, sometimes we have to work on those that are not so well designed. Below are a few handy queries for sorting out duplicate records.
First, an example of our table with duplicates highlighted:
SELECT * FROM Parts