Given a string e.g.:
CREATE TABLE [dbo].[Table1] (
[Id] [int] NOT NULL,
[Title] [nvarchar](255) NULL
)
ALTER TABLE [dbo].[Table1] ADD
CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED ([Id])
INSERT INTO [dbo].[Table1] ([Id], [Title]) VALUES ('Home', NULL)
CREATE TABLE [dbo].[Table2] (
[Id] [int] NOT NULL,
[Title] [nvarchar](255) NULL
)
...
How would i go about ordering the statement so that the CREATE TABLE bits are at the top. I’m guessing i would have to use regular expressions but i’m not sure where i go from there.
I’d appreciate the help. Thanks
Having fun with LINQ.