I am creating a windows application using VB.Net and this application will take a SQl create .sql file as a parameter and will return all fields and their data types inside in a list or array.
Example:
USE [MyDB] GO /****** Object: Table [dbo].[User] Script Date: 07/07/2009 10:16:48 ******/
SET
ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[User]( [UserId] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [MiddleName]
[varchar](50) COLLATE SQL_Latin1_General_CP1_CI_A
Should Return:
UserId int, FirstName string, MiddleName string
I want to do this by any way, pure vb.net code or using RegEx.
Anyone knows the fastest way to finish this?