Replace Function With Wildcards
Posted on 2003-11-25
Hello again! More SQL Server questions abound! I am using the Replace function on a table that holds about 600 Create Table statements that are written in PL/SQL. I am using Replace to parse down the data to a usable create table statement by SQL Server. The process is working quite nicely however, I am trying to think about using this procedure when the table has new entries and then has some different string sets that need to be removed.
One example that I need to remove are all the CONSTRAINT expressions... there are a lot of different constraints, and I would like the ability to say:
Where it would replace everything that lied between the word Constraint and a comma.
I know Replace functino doesn't work this way... but is there a way within Replace to do a select statement or some kind of clause or is there another way all together to accomplish this? Or am I gonna have to list out every single constraint one by one? :)