I need a Regular Expression to split all SQL query in a file..
like that file I need to split all queries from it.. to an array..
CREATE TABLE IF NOT EXISTS `collections` (
`collectionid` int(3) unsigned NOT NULL auto_increment,
`collectiongroupid` int(2) NOT NULL,
`name` text NOT NULL,
`productsCount` int(6) NOT NULL,
PRIMARY KEY (`collectionid`)
);
INSERT INTO `collections` (`collectionid`, `collectiongroupid`, `name`, `productsCount`) VALUES
(1, 1, 'Chairs', 9),
(2, 1, 'Beds', 5),
(65, 5, 'Desks', 1),
(67, 1, 'Longers', 3),
(72, 1, 'Sofas', 5),
(73, 5, 'Tables', 2);
CREATE TABLE IF NOT EXISTS `mailing_queue` (
`mailqueueid` int(10) unsigned NOT NULL auto_increment,
`mailid` int(10) NOT NULL,
`mails` text NOT NULL,
`userid` int(3) NOT NULL,
`ipaddress` varchar(25) NOT NULL,
`dateline` datetime NOT NULL,
PRIMARY KEY (`mailqueueid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=35 ;
INSERT INTO `mailing_queue` (`mailqueueid`, `mailid`, `mails`, `userid`, `ipaddress`, `dateline`) VALUES
(1, 10, 'a:2:{i:0;s:18:"email@server.com";i:1;s:20:"emailfrom@server.com";}', 1, '127.0.0.1', '2010-11-24 08:14:07'),
(2, 10, 'a:2:{i:0;s:21:"email@server.com";i:1;s:18:"email@server.com";}', 1, '127.0.0.1', '2010-11-24 08:14:07'),
(3, 10, 'a:2:{i:0;s:13:"email@server.com";i:1;s:28:"email@server.com";}', 1, '127.0.0.1', '2010-11-24 08:14:07');
can anybody split queries in an arraylist using C#
string DataFile = @"Queries above";
string[] Queries = DataFile.Split(';');
and tnx :)