Thursday, April 23, 2015

I am selecting BP(sys/dia) from a table. I want the values split into two separate columns.

Don't you really need this - in your parsename?
SELECT ID, NAME
, PARSENAME(REPLACE(BP,'/','.'),2) AS BP_SYS
, PARSENAME(REPLACE(BP,'/','.'),1) AS BP_DIA
INTO  #ABC
FROM #BP_INFO
As an aside, I am not a fan of PARSENAME.  That function is really meant for something else, but I guess in this case it is harmless.

No comments:

Post a Comment