Skip to content


SSMS SQL Server Management Studio Refresh Schema

Refreshing the intelli-sense (Intellisense) for the current connection to a given database can be a bug bare

There is nothing more frustrating than making additions, or changes in design to tables/views and having the management studio intellisense not pick-up the changes once you have made them. This is because the SSMS schema refresh doesn't occur real-time not does it update local schema changes to those successfully committed to the db while you work, it occurs on close and open of the IDE.

The easiest way to refresh the schema on any connection (also note each new window is a separate connection and as such you need to refresh each window)

You can either

1) Go to Edit -> IntelliSense -> Refresh Local Cache and
OR
2) Hit Ctrl+Shift+R

Hope this helps those with the same issue

Posted in Annoyances, SQL.


SQL 2008 SSRS Web Service access from .NET

When you try to access a report server web service to execute code you get an error similar to, where the scheme or header varies a tiny bit

The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was 'Negotiate,NTLM

Basically my situation is that we have a MS 2008 Server running SSRS outside of our domain in the DMZ. However we need to execute code on a domain machine that will connect and run over 100 reports on the SSRS Server, then dump them on a share in our domain in excel format.

To get around the negotiation problem you need to make sure the SSRS server is allowing connections configured using basic authentication

Find the file

rsreportserver.config

This is usually buried in the install folder

C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer

Then change the authentication to support your desired connection authentication type

 
	<Authentication>
		<AuthenticationTypes>
			<RSWindowsBasic/>
			<RSWindowsNegotiate/>
			<RSWindowsNTLM/>
		</AuthenticationTypes>

More info at MSDN
Once you have done that you should be good to connect.
Here is some sample code to get you started with connecting to your web service and pulling back a list of items

 
Imports System
Imports TestExecuteSSRS.SSRS1510
Imports System.IO
Imports System.Text
Imports System.Web.Services.Protocols
Imports System.Xml
Imports System.Xml.Serialization
 
Imports System.ServiceModel
Imports rs = TestExecuteSSRS.SSRS1510
 
Module module1
    Sub Main(ByVal args As String())
        'Dim service = New rs.ReportingService2010SoapClient()
        Dim binding = New BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly)
        Dim endpointUri = "http://<ipaddress>/reportserver/ReportService2010.asmx"
 
        'binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows
        'OR
        binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic
 
        Dim service = New rs.ReportingService2010SoapClient(binding, New EndpointAddress(endpointUri))
 
        'service.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation
        'OR
        service.ClientCredentials.UserName.UserName = "<machinename>\<username>"
        service.ClientCredentials.UserName.Password = "
<password>"
 
        ' Retrieve a list of reports.
        Dim reports As rs.CatalogItem() = Nothing
        service.ListChildren(New rs.TrustedUserHeader(), "/<Target Folder>", True, reports)
 
        For Each report As CatalogItem In reports
            Console.WriteLine("{0} ({1}) : {2}", report.Name, report.Path, report.TypeName)
 
            If report.TypeName = "Report" Then
                'run the report and save it as excel 
 
            End If
        Next
    End Sub
End Module
 

Posted in .NET, Annoyances, Configuration, SQL.


SQL Server Auto Backup Database Script

This Script Is what I use on all my database servers, its never failed and is extremely useful.

Just change the @PATH and the @BaseLine days as you see fit, paste the code into a job and run it everyday at midnight or what ever time your backups tends to run.

 
/*
Written by	: Andre Pageot
Date		: 06/06/2012
Description	:
		This procedure will backup all databases in a SQL server with the exception of reportserver
		Each database will have its checkpoint marked and transactio log truncated before the backup occurs
		Each Database will be on a 5 day rolling backup. Baseline on @BaseLineDay (Monday) and differential throughout the week
		Monday's baseline will delete all previous backups in the rolling set,
		so be sure to have them in another location if you need to revert
		The rolling set will backup for two weeks rolling, two baselines and each baseline will contain a weeks worth of differentials
			Mon Tues Wed Thurs	Frid
			B1	D1	 D2	 D3	D4--Base line 1 with differentials throughout the week
			B2	D1	 D2	 D3	D4--Base line 2 with differentials throughout the week
			B1	D1	 D2	 D3	D4--Overwrite baseline one
			B2	D1	 D2	 D3	D4--Overwrite baseline 2
		--This stragtey allows a 2 week rolling backup
*/
 
DECLARE @name VARCHAR(50) -- database name
DECLARE @PATH VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDay VARCHAR(20) -- used for file name
DECLARE @BaseLineDay VARCHAR(10)
DECLARE @SQL VARCHAR(MAX) --the backup script to execute
DECLARE @BaseLineNumber VARCHAR(1) --Which baseline we are working with
 
SET @PATH = 'E:\SQL\BAK\'
SET @BaseLineDay = 'Monday'
if(DATEPART(wk, GETDATE())  % 2) = 0
	BEGIN
		--print 'even'
		SET @BaseLineNumber = 2
	END
ELSE
	BEGIN
		--print 'odd'
		SET @BaseLineNumber = 1
	END
 
SELECT @fileDay = (SELECT DATENAME (DW,GETDATE()) as Day)
 
DECLARE db_cursor CURSOR FOR
	SELECT  name = D.Name--QUOTENAME(D.name)
	FROM    sys.databases D
	WHERE   (
			   NOT D.database_id BETWEEN 1 AND 4       -- master, tempdb, model, and msdb
			AND NOT  D.name LIKE 'ReportServer%'        -- Report Server
			AND NOT  D.is_distributor = 1                -- Replication
			)
	AND     D.source_database_id IS NULL        -- not a snapshot
	AND     D.state_desc = N'ONLINE'            -- is online
	AND     D.user_access_desc = N'MULTI_USER'  -- open for all users
	AND     D.is_read_only = 0;
 
	OPEN db_cursor
		FETCH NEXT FROM db_cursor INTO @name  
 
			WHILE @@FETCH_STATUS = 0
			BEGIN
				SET @fileName = @path + @name + '_SET_' + @BaseLineNumber + '.BAK'
 
				SET @SQL = 'USE ' + @name 
 
				SET @SQL = @SQL + '
				CHECKPOINT	--forces the dirty pages in memory to be commited to the transaction log file'
 
				SET @SQL = @SQL + '
				DBCC SHRINKDATABASE (' + @name + '); --new way to truncate the log file (commit all transactions to the mdf)
 
				--perform our backup depending on what day it is (Fridays have a new baseline)
				IF (''' + @fileDay + ''' = ''' + @BaseLineDay + ''')
					BEGIN
						BACKUP DATABASE ' + @name + ' TO DISK = ''' + @fileName + ''' WITH INIT
					END
				ELSE
					BEGIN
						BACKUP DATABASE ' + @name + ' TO DISK = ''' + @fileName + ''' WITH DIFFERENTIAL
					END
					'
					PRINT @SQL
					EXEC (@SQL)
				   --SET @fileName = @path + @name + '_' + @fileDay + '.BAK'
				   --DBCC SHRINKDATABASE (@name, TRUNCATEONLY);
				   --BACKUP DATABASE @name TO DISK = @fileName  WITH INIT
 
				FETCH NEXT FROM db_cursor INTO @name
			END  
 
	CLOSE db_cursor
	DEALLOCATE db_cursor
 

Posted in Uncategorized.


TFS 2010 Windows sharepoint Services Search

You type a search in the text box and hit search, you are then greated with

"Your search cannot be completed because this site is not assigned to an indexer. Contact your administrator for more information."

You have TFS 2010 installed and everything is working, apart from the Search Services in the sharepoint portals

You try to manually start the service in the windows services console but it fails

You have followed microsoft instructions to enable and start the service but you cannot see the search service in central administration > Operations > services on server

Easily Fixed

You just need to do a repair of your WSS 3 install through programs and features. there is a catch though. When you try to perform a repair you recieve another error

"Microsoft Windows SharePoint Services 3.0 1033 Lang Pack - Error 1706th An installation package for the product Microsoft Windows SharePoint Services 3.0 1033 Lang Pack can not be found. Try the installation again using a valid copy of the installation package 'wssmui.msi'."

From Microsoft Download the Service Pack for Windows SharePoint Services Language Pack from here 64bit or here 32bit and install.

Now perform your repair.

Now browse to Central administration > operations > services on server and you will see as if by magic the search service is now available to configure. Click the start.

Configure Windows SharePoint Services Search Service Settings on server

Service Account: can be a local account \ or can be a domain account \
Content Access Account: can also be a local or domain account
Search Database: this is created automatically

NOTE- I suggest Using the account that you configured for the TFS to use when you were installing TFS 2010, this is because it needs full access to the SQL server and should NOT need to be an admin on the machine or domain. If you use the same account it also keep maintenance easy

Final Step - Add Search to an application database

  • goto central administration > application management > manage > content databases
  • Select the application database (on a fresh TFS instal it should be "WSS_Content")
  • Search Server - select the only item in the drop down list (should be the server name)

Posted in Uncategorized.


TFS 2010 Installation guide & post install tweaks

If you need a good guide to install TFS 2010 then you need to download the guide from this location

http://www.benday.com/downloads/tfs2010beta2installguide/BenDay_TeamFoundationServer2010beta2_InstallationGuide_alpha.pdf

Once you have followed the parts you need to, you might want to do as I did and make a few changes.

I also needed to do a few extra bits to have the functionality I required delivered to the server and TFS clients

  • Visual Studio 2010 and MSSQLMS (Microsoft SQL Server Management Studio) need to connect to TFS
  • VS 2010 must also compile and debug javascript/jquery in the background as much as it does for the .NET object model
  • I want to get the most out of my dev team so I am also going to install a couple of VS2010 extensions to make them work faster and more efficiently
  • The TFS 2010 server is going to have some handy Administration tools installed
  • TFS will also have Team Explorer 2010 installed and TFS 2010 service Pack
  • Use a FQDN for connectivity rather than machine name to access TFS requires loopback be disabled http://support.microsoft.com/kb/896861

So to begin with lets list the software and the download locations

loopback cure

HKLM\SYSTEM\CurrentControlSet\Control\Lsa\

add a REG_DWORD named "DisableLoopbackCheck"" and set it to decimal value 1

or

HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0

add a REG_MULTI_SZ and enter each domain name on new lines to allow loopback on only those domains

Changing Sharepoint URLs

http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/b1aab77a-6914-49a8-951c-792e899440e4/

http://social.msdn.microsoft.com/Forums/pl-PL/tfsgeneral/thread/2efb31f8-10ed-400b-8e22-4368a24e7640

Posted in Uncategorized.


unable to download web platform product list

Unable to download the Web Platform product list from . Check your network connection and try again. If the problem persists, report the issue on the Web Platform Installer forum at: http://go.microsoft.com/fwlink/?LinkId=145244.

Applies to Web platform installer 3 on server 2008

Verify you can browse to http://www.microsoft.com/web/webpi/3.0/WebProductList.xml

If you can then add the following registry key

HKLM\SOFTWARE|Microsoft\WebPlatformInstaller

Add string value (reg_sz) named "ProductXmlLocation"

Value http://www.microsoft.com/web/webpi/3.0/WebProductList.xml

Re run the Web Platform Installer and all should be well

Posted in Annoyances, Infrastructure.


Outlook 2010 Archive Now

How to manually force outlook 2010 to auto archive now

File >> clean up tools >> auto archive

I wasted about 20 minutes trying to find it.

Posted in Annoyances.


The Terminal server has exceeded its maximum number of allowed connections

Using Terminal Services "mstsc" you see a message

"The Terminal server has exceeded its maximum number of connections"

Try using "mstsc /admin"

Login as usual

Posted in Uncategorized.


IIS The tracking (workstation) service is not running

An annoying error when you try to start a website

"The tracking (workstation) service is not running"

Easily resolved
at the command line "net start httpfilter"

now iisreset

Everything should be back to normal

Posted in Uncategorized.


Steve Jobs Apple founder & CEO born 24-2-1955 died 5-10-2011

Steve Jobs

I am writing this post to show my admiration and respect to one of the worlds most amazing humans to have ever lived.

His life long efforts and achievements are far reaching and profoundly impressive, he has proved to the world one man can make a difference.

Steve passed away peacefully surrounded by family on 5th October 2011

http://www.telegraph.co.uk/technology/steve-jobs/8809997/Steve-Jobs-dies-live-blog.html

His has left an imprint on mankind that will never be forgotten and will always be remembered until the end of time.

http://www.msnbc.msn.com/id/44794300/ns/business-us_business/t/apple-says-co-founder-steve-jobs-has-died/?gt1=43001

http://en.wikipedia.org/wiki/Steve_Jobs

He was an inspiration to millions

http://www.facebook.com/l.php?u=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DD1R-jKKp3NA&h=HAQAy6KDTAQDRKRboPfqRq2tAJRznrf0o2gkaifkcfHX01g

He stuck to his word and never faltered when challenged

http://www.youtube.com/watch?v=a20s-blv3b4

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: you have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains." Steve Jobs Interview with Business Week, 1998

He was a true visionary

"The most compelling reason for most people to buy a computer for the home will be to link it to a nationwide communications network. We're just in the beginning stages of what will be a truly remarkable breakthrough for most people - as remarkable as the telephone."
Steve Jobs Interview with Playboy magazine, 1985 - the man was a true visionary

Steve Jobs was a one off; a man who had total belief in his own abilities and a shortage of patience for anyone who failed to agree with him.
His great gifts were an ability to second guess the market and an eye for well designed and innovative products that everyone would buy.
"You can't just ask customers what they want and then try to give that to them," he once said. "By the time you get it built, they'll want something new."

Where it all began

http://www.bbc.co.uk/news/business-14659843

"Steve was among the greatest of American innovators - brave enough to think differently, bold enough to believe he could change the world, and talented enough to do it.
"By building one of the planet's most successful companies from his garage, he exemplified the spirit of American ingenuity....
"By making computers personal and putting the internet in our pockets, he made the information revolution not only accessible, but intuitive and fun.
"The world has lost a visionary. And there may be no greater tribute to Steve's success than the fact that much of the world learned of his passing on a device he invented."
The US President Barrack Obama

“Steve and I first met nearly 30 years ago, and have been colleagues, competitors and friends over the course of more than half our lives, The world rarely sees someone who has had the profound impact Steve has had, the effects of which will be felt for many generations to come. For those of us lucky enough to get to work with him, it’s been an insanely great honor. I will miss Steve immensely.”
Bill Gates, Microsoft co-founder

"He always seemed to be able to say in very few words what you actually should have been thinking before you thought it."
Larry Page, chief executive, Google

Steve Jobs, he is apple, a visionary who saw the power of digital technology to change the way we live
http://www.bbc.co.uk/news/technology-15194056

Forbes
http://www.forbes.com/sites/mobiledia/2011/10/06/bill-gates-mark-zuckerberg-pay-tribute-to-steve-jobs/

"3 Apples changed the World, 1st one seduced Eve, 2nd fell on Newton and the 3rd was offered to the World half bitten by Steve Jobs."

A life in computers
http://www.telegraph.co.uk/technology/steve-jobs/8725655/Steve-Jobs-A-life-in-computers.html

Although I never knew you I feel privileged to have shared this short period in time with you Steve

May you Rest In Peace

Here's to the crazy ones
http://www.youtube.com/watch?feature=player_embedded&v=8rwsuXHA7RA

Posted in Uncategorized.