Posted on January 30, 2010, 4:44 pm, by Rhys, under
DBA.
Just a quick post showing how to add a Postgres database server as a Linked Server in Microsoft SQL Server. Install the psqlODBC driver for Windows. Control Panel > Administrative Tools > Data Sources (ODBC). Click the "System DSN" tab and click the Add button. Choose "PostreSQL ANSI" and click Finish. Configure the data source by [...]
Posted on January 26, 2010, 9:04 pm, by Rhys, under
Powershell.
I really used to like apt-get when I used to run Linux as my home os a few years ago. Once you got the hang of it installing and managing software was easy. I’m obviously pleased to see PsFetch in development. This tool is the Windows Powershell take on apt-get which will allow you to [...]
Posted on January 25, 2010, 8:51 pm, by Rhys, under
Powershell.
I’m really into Powershell so I like trying out all the available tools. Somehow I’ve missed the release of the PowershellShellPack which has ten modules offering all kinds of additional functionality including file handling, operating system information, GUI and code generation. I followed the Channel 9 video and ran into a problem on the first [...]
Posted on January 24, 2010, 3:16 pm, by Rhys, under
DBA,
T-SQL.
I’ve blogged before about documenting databases. I’m very much a fan of extracting documentation from systems themselves so it’s as up-to-date as it can be. That’s probably why I’m such a big fan of Powershell a tool that excels at this task. This week I was thinking about how to get at the comments often [...]
Posted on January 20, 2010, 9:46 pm, by Rhys, under
Data.
Just a quick post about the British Governments launch of data.gov.uk offering free access to a large number of datasets. It’s good to see this data, that we as taxpayers have funded, available for free use. Hats off to The Guardian’s long running free our data campaign. The site is being officially launched by Sir [...]
Posted on January 19, 2010, 10:04 pm, by Rhys, under
SSIS.
I’ve been having a bit of a debate with some colleagues today about the Execute SQL Procedure Task in SSIS. Is it ok to enter raw SQL queries into this task or should everything be enclosed within a Stored Procedure? My view… For me, any day of the week, it should always be a proc. [...]
Posted on January 18, 2010, 9:08 pm, by Rhys, under
DBA,
T-SQL.
If you ever encounter this SQL Server error when selecting from a view then somebody has probably dropped columns from the base table. Here’s a quick run through of the problem. ?View Code TSQLCREATE TABLE dbo.Contact ( Id INTEGER IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, FirstName VARCHAR(50) NOT NULL, LastName VARCHAR(50) NOT NULL, DOB DATETIME [...]
Posted on January 16, 2010, 4:50 pm, by Rhys, under
Powershell.
One of the great things about Powershell is its ability to take advantage of the .Net platform. If Powershell can’t do it you bet there’s a .Net library that can. Not only is this great for extending your scripts but I also like to use Powershell to test some of my classes. Rather than fire [...]
Posted on January 15, 2010, 7:10 pm, by Rhys, under
Powershell.
I love Powershell. You can do some really cool things with just a few lines of code that you would struggle to do any other way. There’s quite a community around Powershelll providing a fair number of tools. Here’s a round-up of a few I have used. PowerGUI – http://powergui.org PowerGUI is a project supported [...]
Posted on January 14, 2010, 9:18 pm, by Rhys, under
DBA,
T-SQL.
Today I received the following SQL Server error which I had never encountered before. Msg 4429, Level 16, State 1, Line 1 View or function ‘Table_1′ contains a self-reference. Views or functions cannot reference themselves directly or indirectly. Msg 4413, Level 16, State 1, Line 1 Could not use view or function ‘Test.Table_1′ because of [...]