Jane Dallaway

Jane Dallaway

Jane Dallaway  //  Development manager, photographer, dog owner and snowboarder based in Brighton, UK
Email: jane @ dallaway.com
Also at:        

Maximum length of SQL Server 2005 objects seems to be 128 characters

I couldn't find the answer to the maximum length of the name of a view in SQL Server 2005 online today, although I did find someone's helfpul blog post about the maximum length of a column name in SQL Server 2005, so a quick experiment later using the following code:

CREATE VIEW [vw_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890]
AS
SELECT * FROM Address

Resulted in:
Msg 103, Level 15, State 4, Line 1
The identifier that starts with'vw_1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234567890.1234' is too long. Maximum length is 128.

Another experiment, this time for table creation

CREATE TABLE [1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890]
(
  [Id] [int] NOT NULL,
  [Line1] [varchar](50) NOT NULL,
  [Line2] [varchar](50) NULL,
  [City] [varchar](50) NOT NULL,
  CONSTRAINT [PK_Address] PRIMARY KEY CLUSTERED 
  ([Id] ASC) 
)ON [PRIMARY]

Resulted in:
Msg 103, Level 15, State 4, Line 1
The identifier that starts with '1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567890_1234567' is too long. Maximum length is 128.

Loading mentions Retweet
Filed under  //  Development   SQLServer2005  

Comments (0)

Changing the direction of results from a SQL Server ORDER BY clause

I have a stored procedure which returns me a list of items, and I want the directional order of them to change based on a parameter. I didn't want to resort to dynamic SQL, so I had a bit of a hunt around and found the excellent blog post Dynamic/Conditional Order By Clause in SQL Server/T-SQL.  Here's my result:

 

CREATE Procedure [dbo].[mp_GetItems]
(
 @OldestFirst BIT
)
AS
SELECT 
  Item.ID, Item.Description
FROM 
Items
ORDER BY 
  CASE WHEN @OldestFirst = 1 THEN CreatedDate END ASC,
  CASE WHEN @OldestFirst = 0 THEN CreatedDate END DESC

GO

which works a treat. The key is, as mentioned in the blog post

Ascending and Descending actions need to be grouped into separate CASE statements, separated with a comma

 

Loading mentions Retweet
Filed under  //  Development   SQL   SQLServer   SQLServer2005  

Comments (0)

25 Spectacular Examples of Washed Up Photography

25 Spectacular Examples of Washed Up Photography

The power of the sea has many times shown its amazing strength by polishing the rocks and making the sand look like a blanket of shining diamonds reflecting the sun rays in a million colors.

The stormy nights and days that sweep over the surface of the ocean are able to bring to the shore a spectacular opportunity for creating amazing shots.

Washed up photography is the chance to make immortal a perspective over the beauty of what the waves are pushing from the depths of the wild waters on to the sandy shore that is ready to embrace them and make them shine inside a memorable shot.

washed up Photography 1

( Photo by petervanallen )

washed up photography 2

( Photo by Osgoldcross )

washed up photography 3

( Photo by Brianmoc )

washed up photography 4

( Photo by Thierry Hennet )

washed up photography 5

( Photo by Dani℮l )

washed up photography 6

( Photo by » edouard )

washed up photography 7

( Photo by JWEral )

washed up photography 8

( Photo by noproblemnigel ☺ )

washed up photography 9

( Photo by acidsulfurik )

washed up photography 10

( Photo by macten )

washed up photography 11

( Photo by omnia_mutantur )

washed up photography 12

( Photo by rebranca46 )

washed up photography 13

( Photo by marcovdz )

washed up photography 14

( Photo by jwoodphoto )

washed up photography 15

( Photo by poolie )

washed up photography 16

( Photo by Lance & Cromwell )

washed up photography 17

( Photo by Hueystar )

washed up photography 18

( Photo by Alex::: )

washed up photography 19

( Photo by DX-Sniper )

washed up photography 20

( Photo by DJ Bass )

washed up photography 21

( Photo by DJ Bass )

washed up photography 22

( Photo by janusz l )

washed up photography 23

( Photo by Taiger808 )

washed up photography 24

( Photo by heshaaam )

washed up photography 25

( Photo by DJ Bass )


This collection appeals to me as I've been recently working on a project capturing photographs of items that are out of place which has included a few things found on the beach here in Brighton.

Loading mentions Retweet
Filed under  //  photography  

Comments (0)

Red Gate Software - Download Defensive Database Programming and SQL Prompt

Defensive Database Programming

By Alex Kuznetsov

The goal of Defensive Programming is to produce resilient code that responds gracefully to the unexpected.

To the SQL Server programmer, this means T-SQL code that behaves consistently and predictably in cases of unexpected usage, doesn't break under concurrent loads, and survives predictable changes to database schemas and settings.

Inside this book, you will find dozens of practical, defensive programming techniques that will improve the quality of your T-SQL code and increase its resilience and robustness.

Just the eBook please

 

Defensive SQL is something I've nattered about before and this morning FatherJack tweeted about his blog review of this free eBook, so I thought I'd better check it out. I haven't done much more than flick through the contents page, but at a glimpse it looks like it'll have some helpful hints and tips.

Loading mentions Retweet

Comments (0)

NVQ Update

After almost 2 months, I sat down with Dawn, my NVQ assessor again yesterday.  I'd had to postpone my planned meeting as I just wasn't finding the time to prepare the work necessary for unit B6 - Provide leadership in your area of responsibility during June so I ended up doing a few bits and pieces on holiday to have at least enough to show willing for this unit.  I'd emailed the work through prior to our meeting and was relieved to find out that I wasn't far off from having enough to close this module off as well.  So, only 2 to go.  Both are optional units, and after a lot of discussion the next one I'm going to tackle is  Unit D7 - Provide learning opportunities for colleagues which will be another personal statement covering both what I currently do within the Madgex environment, but also what I'd like to do given total free reign.  Learning has always been something I've been interested in, both from a personal perspective, but also from a team perspective so I'm really excited by this unit.

Whilst we were chatting, Dawn mentioned that the funding for this NVQ is part of the budget cuts from the new government, meaning that there won't be a new intake of managers using the Train to Gain scheme.  What a shame, but what a great opportunity I've had.

Loading mentions Retweet
Filed under  //  nvq  

Comments (0)

Could have been favourite upload of June

In June I uploaded 127 items to flickr.

I have now posted a complete year's worth of Favourite upload photos, so for this month I thought I'd post a "could have been favourite" upload of the month

This is a photograph I like, but it is also one that I can see plenty of "it would have been better if"s with. So, I like the interaction between the two golden figures, I like the expression on the guys face but I feel it would have better without the photographer (I think) in the background (the guy with the blue jacket and arms raised as if wielding a camera just behind the guys right arm). I also feel it would have been better to have been a little bit wider and got all of the guy's left hand and more of the ladies back into the shot.

This photograph was taken at the Margate Big Event on a cloudy and, later, rainy Sunday using my Nikon d80 and processed using Lightroom.

I'll probably return to the more usual format next month.

Loading mentions Retweet
Filed under  //  photo   photography   upload of the month  

Comments (0)

V-J Day in Times Square

Following on from my post the other week about Photographs that changed the world, a petapixel tweet yesterday made me aware that the nurse featured in V-J Day in Times Square, one of the photos on the 13 photographs that changed the world article, had died at age 91 at he home in LA.

The Alfred Eisentstaedt photograph is copyrighted and is now the property of the Getty Museum, so I'll have to make do with posting a photograph taking at the same time by US Navy photo journalist Victor Jorgensen which is entitled "Kissing the war goodbye".

File:Kissing the War Goodbye.jpg

The people featured in this iconic photograph weren't known at the time - it wasn't until 1970 that Edith Shain, the lady who has just died, wrote to the photographer, Alfred Eisentstaedt, and claimed to be the nurse.

A quick search on flickr shows just how many people have re-enacted this image.

Loading mentions Retweet
Filed under  //  photo history   photography  

Comments (0)

Fishing for leftovers by Mark J Davis

I was reading about the 2010 Photocrati Fund competition and this photo was featured amongst the selection of images they'd posted to show why Mark J Davis had won for his Fishing for Leftovers project. This photograph stopped me in my tracks. The colours, the atmosphere, the focus are all astounding and make this photograph, at least for me, incredible.

Loading mentions Retweet
Filed under  //  photography  

Comments (0)

TSQL: Escaping % in a SQL Like clause

Today I had cause to search a text field in a SQL Server 2005 database for the phrase %3 (I had some data being url encoded incorrectly) and this wasn't something I'd tried to do before so I had to find out how to escape the % sign.  A quick google and a re-read of the LIKE syntax, and I discovered that to escape the % I had to do something like

WHERE [Value] LIKE '%!%3%' ESCAPE '!'

After talking this through with a colleague, he asked me to try some other escape characters, and here's what we found out:

Attempting to use a string as an escape phrase, i.e.

WHERE [Value] like '%WORD%1%' ESCAPE 'WORD'

doesn't work, and fails with an error of

 

Msg 506, Level 16, State 1, Line 1

The invalid escape character "WORD" was specified in a LIKE predicate.

 

Attempting to use % as the escape character, gets it quite confused 

WHERE [Value] like '%%%1%' ESCAPE '%'

returns 0 rows, but no errors

 

Attempting to use ' as an escape character, which needs to be escaped itself 

 

WHERE [Value] like '%''%1%' ESCAPE ''''

returns the correct rows

Loading mentions Retweet
Filed under  //  nts   SQL   SQLServer2005  

Comments (0)

Me and my Olympus Trip 35

The lovely Seb took this photo of me taking photos with my newest acquisition - an Olympus Trip 35 (reconditioned by tripman) - at Natalie and Simon's wedding yesterday. It had a roll of FujiFilm NeoPan (black and white ISO 400) in it, but was only my 2nd film with this camera so my fingers are firmly crossed for good results.

Loading mentions Retweet
Filed under  //  olympus trip   photo   photography  

Comments (0)