Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

SQL 2000 DBA Toolkit Part 2 Expand / Collapse
Author
Message
Posted Wednesday, April 4, 2007 6:43 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, April 14, 2014 4:18 PM
Points: 1,276, Visits: 1,132

FYI to Everyone:

Steve has made the source code (VC++ 7.1 solution) for this project available in a ZIP file from http://www.sqlservercentral.com/products/mcoles/default.asp.

Compilation of some parts requires Boost Library source (in particular the Regular Expression extended procedures require Boost).  Boost source is available for free download at http://www.boost.org/.

If you do download and compile the source, I highly recommend downloading the latest Platform SDK from http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en.

I've also been asked several times about the license for this toolkit.  Here it is:

DBA Toolkit License

The DBA Toolkit is composed of my original source code, and/or other source code that the original authors have placed in the public domain.  Credit has been given throughout the source code to those original authors, and their original licensing agreements have been maintained in the source code where appropriate.

You are free to use this source code and binaries however you want, modify it however you like, and use it for any purpose you like, personal or commercial.  All I ask is two things:

1.  If you redistribute the source code, modified or unmodified, give me a shout out in the comments or something

2.  If you do something really cool and make big and/or useful improvements, consider sharing it with the rest of the world (this is not mandatory, but it is the nice thing to do).  I'm particularly interested in the improvements people make to the source, and always appreciate the feedback.

Obviously the Boost Library is covered by Boost's own licensing agreement which you will need to observe if you decide to use the portions of code that interface with it (the Regular Expression functionality).  And Microsoft has their own licensing agreements you might need to review when before distributing programs compiled using the Platform SDK.

Post #356116
Posted Friday, June 29, 2007 4:04 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, July 25, 2014 3:19 AM
Points: 577, Visits: 2,503

I've always greatly admired the DBA toolkit, and found the criticism of Mr Wooton very amusing. Well, I assume it was tongue-in-cheek. Even if it wasn't useful, it is great to illustrate that it can be done.

One point he's right about. SQL Server works very well in a Unix\J2EE environment thanks to its rather good JDBC driver.  Of course, the database server itself has to run on  Windows, but that is only a problem to the fanatics.




Best wishes,

Phil Factor
Simple Talk
Post #377735
Posted Monday, August 13, 2007 3:10 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 9, 2008 9:33 AM
Points: 2, Visits: 30

I recognize I'm a little late to the party, but...

Has anyone tried to use these xp's in an x64 environment? We are moving from 32-bit SQL2K to 64-bit SQL2K5 and would like to continue using these in the new environment, rather than refactor to the SQL2K5 built-ins.

Thanks,

Paul S




Post #390355
Posted Monday, August 13, 2007 6:10 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, April 14, 2014 4:18 PM
Points: 1,276, Visits: 1,132

Just FYI, I haven't compiled or tested these on 64-bit systems, but for SQL 2K5, I'd highly recommend using the SQLCLR and built-in functionality.  On SQL 2K5 XP's are deprecated, and the SQLCLR code is much easier to maintain.  Creating regular expression matching procedures and functions using .NET and the SQLCLR is relatively simple.  Just my .02.

Thanks,

Michael

Post #390387
Posted Wednesday, July 2, 2008 11:14 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Saturday, July 12, 2014 6:44 AM
Points: 441, Visits: 1,799
Mike

First of all, congratulations on earning your MVP status. Reading the news prompted me to look this article up to help me with an address validation task I have been asked to do.

I have used the kit and have managed to solve my problem, but, I am having to use a cursor as the xp_regex_search returns a table with the found value. Any chance we can nag Steve into fixing the link to the source code above so I can muck about with it and make it do what I want?

For those that are interested, here's more on what I'm trying to do. (Usual Disclaimer: Schema and App NOT my design ;))

We have an address table that contains among other columns PK, CustCode, AddressLine1, AddressLine2, AddressLine3, AddressLine4, AddressLine5, AddressLine6, Postcode.

The app that uses this table is dreadful, and over time postcodes have ended up in any of the address fields. So addressLine5 might contain "MANCHESTER M13 OJR" for example.


What I currently have is the following psuedo(ish) code

Read all records with NULL postcode into a temp table consisting of above columns.

Read first record from the temp table into Cursor
CREATE TABLE #TestSearch ( matchnum int , groupnum int , value varchar ( 128 ) )

select @addline = @add1 --Sets string to be tested
EXEC master.dbo.xp_regex_match @regExStr , @addLine, 'I+' , @Ans Output --Where @RegEx is a Postcode match
if @ans = 'Y'
Begin
INSERT INTO #TestSearch ( matchnum , groupnum , value )
EXEC master.dbo.xp_regex_search @regExStr , @addline, 'I+'

if Exists(select 1 from #testSearch)
select @val = value from #TestSearch
Begin
Update #TestMatch
Set postcode = @val where id = @id
End
END

Do the same for addressLine2, 3 etc

Get the next record and go back to the top


It would be much simpler for me, and probably much quicker to say

                Update #TestMatch
Set postcode = master.dbo.fn_regex_match_and_return_matched_value(addressLine1, @regEx)
Where Postcode is NULL

And then do AddressLine2, etc. Or build a coalesce statement. Anyway, I'm sure you get the idea.

Any other obvious solutions I have missed, please feel free to correct me :D

Once again, well done on the MVP thing.

Dave J



http://glossopian.co.uk/
"I don't know what I don't know."
Post #527458
Posted Tuesday, March 17, 2009 7:25 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Friday, July 24, 2009 3:36 AM
Points: 12, Visits: 43
Hi, i have a problem in getting the data from text file. The format of the doc file is not good.

I used regex to get the keyboard types and ignored the rest.

Now the problem is i have n number of fields with key value pair.

I have to import each field and a value into access mdb, since its not a fixed width, the only way i can get them is thr regex.

Ex: Agent Address(field) 00255 S(somecode) 28080WestTaylor St(value) City\State\Zip00255 S kokomo indiana Name 00456 ! ! S Some Titleco

Now i have build a regex for the field City\state\zip so as to begin from City\state\zip and select upto the field Name(ignoring name field)

How to exclude the entire word name from the pattern? since[^Name] works only for characters present in the words but not the entire word?

Post #677421
Posted Friday, July 31, 2009 3:05 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 6:24 AM
Points: 60, Visits: 375

All in all, quite a civilised lack of agreement there - I even found the explaination interesting

My opinion = having regex, bcp, bulk insert, transact..and a copy of excel rocks every data situation you could possibly think of.

Thanks for the thread.
Post #762961
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse