Monday 11 November 2019

Reinstall SQL Server Reporting Services 2016 in SharePoint Server 2016

Reinstall SQL Reporting involves 3 step, first I removed service application and proxy in SharePoint.


Then uninstall SQL Reporting service in Add or remove program. Here's the step to uninstall SQL Reporting:
  1. Open Add or remove program, then select Microsoft SQL Server 2016.
  2. Click Uninstall.
  3. Click Remove from the form that show up.
  4. When the wizard show up, select <<Remove shared features only>> under instances to remove features from.
  5. Click Next.
  6. Select both Reporting Services.
  7. Click Next.
  8. Click Remove.
  9. Click Close when done.
  10. Restart the server to complete the uninstall.
Install SQL Reporting Service again. Here's the step:
  1. Insert SQL Server 2016 installation disk.
  2. Run setup.exe.
  3. Click New SQL Server stand-alone installation or add features to an existing installation.
  4. Click Next on screen Microsoft Update.
  5. Make sure everything green/yellow and then click Next.
  6. Select Add features to an existing of SQL Server 2016 and then click Next.
  7. Select both Reporting Services option and click Next.
  8. Click Next.
  9. Click Install.
  10. Click Close.
We're going to activate this SSRS in SharePoint, make sure that this server SharePoint role is Custom.
Run the following PowerShell script:
Install-SPRSService
Install-SPRSServiceProxy
get-spserviceinstance -all |where {$_.TypeName -like "SQL Server Reporting*"} | Start-SPServiceInstance
A successful install won't show any message, in my case above the service SQL Server Reporting has already started so it showed a warning.
Next we're going to create Application Service for this SSRS. Go to Central Admin > Manage Services Application >  Click New > Select SQL Server Reporting Services Service Application.
Enter Name, select Application Pool (I used existing), make sure Web Application Association is selected to the web you want to associate with this service.
Click OK. After it has completed.

ref:
  • https://docs.microsoft.com/en-us/sql/sql-server/install/uninstall-reporting-services?view=sql-server-ver15
  • https://docs.microsoft.com/en-us/sql/reporting-services/install-windows/install-or-uninstall-the-reporting-services-add-in-for-sharepoint?view=sql-server-2016
  • https://docs.microsoft.com/en-us/sql/reporting-services/install-windows/install-the-first-report-server-in-sharepoint-mode?view=sql-server-2016

Wednesday 24 April 2019

SQL Index for or

Let's say you have this query

select id from msEmployee where createdby='me' or createdbyemployeeid=2

index can't be used with or statement, so how do we modify the query so it will be using the index? There is one way to make use index for or statement. We need to separate the or query into its own syntax and join it together using union or union all (faster). So for query above we separate those two or into this query.

select id from msEmployee where CreatedBy='me'
union
select if from msEmployee where createdbyemployeeid=2

to measure your query performance you can use syntax set statistics on (before execute) and  set statistics off (after execute)

this is the result comparing between union, union all or just or statement (notice that union and union all doesn't seem to be that different however union all will perform faster because it won't force distinct the result)

this was the index definition for that table


ref:
  1. https://stackoverflow.com/questions/751838/create-an-index-on-sql-view-with-union-operators-will-it-really-improve-perform
  2. https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37adc0b7-e8f3-4fd4-bb0f-8e65d9e13a94/how-to-measure-the-performance-of-query-has-improved-after-index?forum=sqldatabaseengine

Friday 4 January 2019

a list, survey, discussion board, or document library with the specified title already exists in this web site

This was shown when I was about to activate "SharePoint Server Publishing Infrastructure" in "Site Collection Features". I was pretty sure this happened because I was trying to import a list from another site to this and it failed mid way. Some of the items from those sites had already imported (also from publishing site) and it failed my attempt to activate publishing feature. How do we fix this? Simple by deleting that list/library. There is a catch however, that list wont show up in the "Site Content" menu.
We can use "SharePoint Designer 2013" to remove that list/library. This is what I did to remove that list/library:
  1. Open up SharePoint Designer 2013
  2. Click on All Files
  3. Look for files/folder in the list which correspond to that name (example from picture Suggested Content Browser Locations)
  4. If you couldn't find the name maybe it didn't have space in the name or it might have different name.
  5. In my example picture above the name was not found in the list. So I searched the internet and figuring it out what it is. The name was PublishedLinks and it was a folder.
  6. After you figure it out, delete it and try reactivated it again.

Update: I faced another error and this time there was no information about the name of the list that already exist. Since this was a new site, I solved this by delete the web application and recreate it again (also delete the content DB). This was the screen when that error showed.