Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to parse connection strings on a column in SQL Server 2008

$
0
0

I want to extract database names from a varchar column storing connection strings.

A sample value is; 'server=SVR1;database=DB1;uid=user1;pwd=pass1;enlist=true;'

Each record might have a slightly different connection string format; Uid before Database, or no Enlist etc. 'server=SVR1;uid=user1;database=DB1;pwd=pass1;'

I have a few parsing scripts but they are not useful for this specific extraction.

Basically, I want the string starts after 'database=' and ends at the following ';'.

Thanks,

Kuzey

 

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>