SSRS – Configure for local network access

 
See next blog entry.
This entry was written when trying to use VS-TFS reports on Windows 7. This is not possible, so do not try. However configuration below does work over home network.
 
Found a TFS report cofiguration help website that said use Local System. This is for 2008 but still works
then on this page look for “To verify or correct the configuration of SQL Server Reporting Services”
 
On same page it says .. howeve the real reason in 2010 at least is because W7 does not support this.

Documents and Reports are Unavailable in Team Explorer

When you connect to Team Foundation Server using Team Explorer, the Documents and Reports nodes of a project may be unavailable. This is indicated by a red x on the nodes. This may indicate that the firewall on the computer that hosts Team Foundation Server does not have an exception configured for port 80. You must add this port to the exception list for your firewall application. For more information, see How to: Verify or Correct Port Assignments.

 
 

 
This works – other configurations may also work
Normal configuration
Service account = Local Service
Database credentials windows account
 
On other computer
Internet Explorer > Tools Internet Options > Security > Trusted Sites > Sites > http://nameofserver
 
On report server computer
Go to report manager url > Home > Folder settings > New Role Assignment > Include Content Manager

Understanding “login failed” (Error 18456) error messages in SQL Server

 
More human readable messages are stored in Log
 
Described here. 2005, but still works in 2008 R2
 
Viewing log

Repeat Header / Keep Header Visible in Tables in RS 2008 – Advanced Reporting Serv

 
Talking about Repeat Header / Keep Header Visible in Tables in RS 2008 – Robert Bruckner’s Advanced Reporting Serv
 
 

Recursive CTE – Bill of Materials – BOM View

 
Difficult but got there ! And worth it !
 
/*
Based on a table Product.Products and Product.BillOfMaterials.
*/
 
/*
SELECT * FROM Product.Products WHERE ID = 738
SELECT * FROM Product.vBillOfMaterials WHERE ProductAssemblyID = 738 ORDER BY BOMLevel
SELECT * FROM Product.vBillOfMaterialsName WHERE ProductAssemblyID = 738 ORDER BY BOMLevel
*/
 
CREATE VIEW [Product].[vBillOfMaterials]
 
AS
 
WITH BOM_cte 
AS
(
SELECT b.ProductID AS ProductAssemblyID, ID, ProductID, ComponentID, ItemNo, Quantity, LastUpdate, LastUpdateBy, AlternativeAccy, 0 AS BOMLevel 
FROM Product.BillOfMaterials b
UNION ALL
SELECT cte.ProductAssemblyID, b.ID, b.ProductID, b.ComponentID, b.ItemNo, b.Quantity, b.LastUpdate, b.LastUpdateBy, b.AlternativeAccy, BOMLevel + 1 AS BOMLevel
        FROM [BOM_cte] cte
            INNER JOIN [Product].[BillOfMaterials] b 
            ON b.ProductID = cte.[ComponentID]
)
SELECT BOM.* FROM BOM_cte BOM

SSRS Configuration

 
> Internet > Tools > Options > Security > Local Intranet > Sites > Advanced. Add address of local server.
 
For me only – see files in vs\projects\ssrs\configuration
 

Save (Not Permitted) Dialog Box. Tables will need to be dropped and re-created

 
SQL SSMS
Tools > Options > Designers > Tables and Database Designers
Check or Uncheck > Prevent saving changes that require table re-creation
 

SQL Server Profiler – “Not enough memory was available for trace”

 
Need to enable AWE on SQL Server which is an element of memory
Before doing this need to follow
"How to: Enable the Lock Pages in Memory Option (Windows)"
 
Then "Enabling AWE Memory for SQL Server"
 
The following is copied from there:
—————————————–
 
"Example

The following example shows how to activate AWE and configure a limit of 1 GB for min server memory and 6 GB for max server memory.
First, configure AWE:
Copy Code

sp_configure 'show advanced options', 1
RECONFIGURE
GO

sp_configure 'awe enabled', 1
RECONFIGURE
GO

After SQL Server restarts, the following message is written to the SQL Server error log: "Address Windowing Extensions enabled."
Next, configure memory:
Copy Code

sp_configure 'min server memory', 1024
RECONFIGURE
GO

sp_configure 'max server memory', 6144
RECONFIGURE
GO

 

SQL Database Mail – User security to allow facility

 
Security > Logins > Pick Login > Properties > User Mapping > msdb > tick on
Database role membership include DatabaseMailUserRole
 
msdb has more database role memberships. May be resolution to LinkedServer issue. 
 
PROBLEM
Procedure sp_send_dbmail, line 141 profile name is not valid
 
SOLVED
 
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
    @principal_name = 'ApplicationUser',
    @profile_name = 'AdventureWorks2008R2 Administrator Profile',
    @is_default = 1 ;
 
 

Padding Numbers Leading Zeros Using Transact-SQL

 
From
 
Use Str function which converts numeric data to a string.
 
SELECT replace(str(1,5),’ ‘,’0’)        — Outputs ‘00001’
SELECT replace(str(123,5),’ ‘,’0’) — Outputs ‘00123’
SELECT replace(str(12345,5),’ ‘,’0’)    — Outputs ‘12345’
SELECT replace(str(123456,5),’ ‘,’0’)   — Outputs ‘*****’
 
there is a third argument to str function which is no of decimals to keep
 
 
 

SQL Server Database Mail Stopped

 
 
 
USE msdb ;
GO
EXECUTE dbo.sysmail_start_sp ;
GO
 
To get it going again. Also possible to right-click on Management > Database Mail > View Database Mail Log