Article
· Mar 22, 2016 1m read

View stream properties in SQL

Stream datatypes are not displayed when you execute SQL (in SMP for example).

The following query (SAMPLES namespace):

SELECT TOP 2 ID, Notes FROM Sample.Employee

Produces this output:

IDNotes
1011%Stream.GlobalCharacter^Sample.PersonS
1023%Stream.GlobalCharacter^Sample.PersonS

 

To get around that use SUBSTRING operator:

SELECT TOP 2 ID, SUBSTRING(Notes, 1) FROM Sample.Employee

It produces much more useful output:

IDNotes
101Juanita used to work at TelePedia Inc. as a(n) Associate  Manager
102Danielle used to work at MetaTel Corp. as a(n) Assistant WebMaster

 

To limit the length of the stream property  use three argument form:

SELECT TOP 10 ID, SUBSTRING(Notes, 1, 100) FROM Sample.Employee 

In this example only the first 100 characters from a stream would be returned.

Discussion (0)0
Log in or sign up to continue