Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Retornar campo separado por Pipe

By Silvio Bedine,

Dada um registro com vários campos separado por pipe (ex.

|I051|10||3.01.01.01.03.03.00|) podemos obter o valor entre os pipes passando o registro e o número do campo conforme abaixo:

SELECT dbo.bpo_retorna_campo_geral('|I051|10||3.01.01.01.03.03.00|',3) AS 'valor'

Neste caso obtemos como retorno o valor 10, pois é o valor imediatamente antes do 3.o pipe.

SELECT dbo.bpo_retorna_campo_geral('|I051|10||3.01.01.01.03.03.00|',5) AS 'valor' o retorno será o valor 3.01.01.01.03.03.00

Total article views: 243 | Views in the last 30 days: 2
 
Related Articles
SCRIPT

Valor em moeda BR

Retorna valores monetários no padrão de moeda brasileira R$.

SCRIPT

Rateio do valor do Item na Nota - Totvs RM

Essa função calcula a porcentagem do Item em relação ao valor da nota. Aplicável a Totvs RM. Em es...

FORUM

Retornar campo separado por Pipe

Comments posted to this topic are about the item [B]Retornar campo separado por Pipe[/B] Interessant...

FORUM

Valor em moeda BR

Comments posted to this topic are about the item [B]Valor em moeda BR[/B]

FORUM

Rateio do valor do Item na Nota - Totvs RM

Comments posted to this topic are about the item [B]Rateio do valor do Item na Nota - Totvs RM[/B]

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones