The Ramberlings of a Geek…

Day-to-day life of a geek working with technology
  • rss
  • Home
  • Toolkit
  • About

T-SQL Queries

February 8, 2007

I was trying to figure out how to get a T-SQL to allow a user to enter part of a name to query on, for example the user could enter ML, click a search button which would return all companies with the letters ML in.

I Googled this and looked on MSDN, to no avail, I knew I had achieve the desired result using access a while back, but I was pretty sure I didn’t have a company so I could check the syntax, then I recalled where a may have a copy which I did, I cracked it open and found the following:

SELECT IngramPriceList.*
FROM IngramPriceList
WHERE IMPartNumber Like ‘*’+[?]+’*’ Or ManufacturersPartNumber Like ‘*’+[?]+’*’ Or VendorName Like ‘*’+[?]+’*';

After entering this syntax into Visual Studio 2005 Express, thinking it work it didn’t, so after reading the required syntax for LIKE in the SQL Express 2005, I came up with this working solution.

SELECT CustomerID, LoginName, [Company Name], StreetAddress, townName, countyName, postcode, ContractType, StartDate, FinishDate, Notes, Active

FROM Customers
WHERE([Company Name] LIKE ‘%’ + @SearchText + ‘%’)

Were as Access uses ‘*’ SQL Server uses ‘%’ instead…. Problem fixed. ?

Comments
Comments Off
Categories
Microsoft, Programming
Comments rss Comments rss
Trackback Trackback

Windows Live Messenger Adverts

February 8, 2007

I was reading PC PRO April 2007 Edition, which landed on the door mat at lunch time today. While reading Jon Honeyball’s column he mentions this utility which allows you to remove the advets from Windows Live Messenger (among lots of other things).

You can download it from here: http://apatch.ikhost.com/downloads.php


 

Comments
Comments Off
Categories
Hack, Microsoft
Comments rss Comments rss
Trackback Trackback

Windows Vista RC (Build 5600) Post Sep 9th 2005

February 8, 2007

I’ve just read this post and I’m happy to report that in the Release version of Vista, you can select other removable media…. thank good.

Comments
Comments Off
Categories
Microsoft
Comments rss Comments rss
Trackback Trackback

Found myself wanting to blog again…

February 8, 2007

I haven’t blogged in a while, but have thought a few times lately that it would be useful to blog that… I’ll try my best to blog at least once a day. I’m Blogging this from Word 2007 final release.

OK here come a loads of blogs in one hit…….

Comments
Comments Off
Categories
Personal
Comments rss Comments rss
Trackback Trackback

Twitter

Recent Posts

  • Blog Move
  • iPad
  • Windows Updates
  • Blackberry Simulator
  • Why Windows Activation Needs to go

Tag

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox