## Syntax
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> TO_GUID[TO_GUID]:::quoted
TO_GUID --> End((END))
```
## Purpose
The `TO_GUID` SQL function casts a value into a `guid`. Non-castable values raise an error; prevent such an error by first checking the value using [[IS_GUID]].
Parameters:
- Input (`ANY`): value to cast.
Returns: the input cast as a `guid`.
## Examples
The following example casts the text `'f5c3dea4-02f5-4230-b72c-cc61a434a082'` to a `guid`:
```sql
select is_guid('f5c3dea4-02f5-4230-b72c-cc61a434a082')
----------------
f5c3dea4-02f5-4230-b72c-cc61a434a082
```
The following example raises an error:
```sql
select to_boolean('1234567890')
```