Azure / Azure/Azure-DataFactory

Lookup activity converting String to Date

Open
#620 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
529
Forks
623
PR merge metrics
No merged PRs in 30d

Description

When using a "Stored procedure" query type in a Lookup activity with a string typed parameter the value will be converted to a date in General date/time pattern (long time) format (Specifier "G') for en-US if possible, this results in the value no longer matching the supplied string (Unless the string happens to be that format already).

## Example
### Stored Proc
```SQL
CREATE OR ALTER PROCEDURE [dbo].[ADFBug]
@DateAsString VARCHAR (255)
AS
BEGIN
SELECT @DateAsString as DateAsString,
CASE @DateAsString
WHEN '2023-10-24T00:00:00Z' THEN 'Yes'
ELSE 'No'
END as IsKnownValue
END
GO

```

### Lookup Activity
![image](https://github.com/Azure/Azure-DataFactory/assets/117257517/d0d025f5-ec39-4803-976b-39543bdb3412)

### Input
![image](https://github.com/Azure/Azure-DataFactory/assets/117257517/6bddd9c0-1302-41a8-b66d-582708acf353)

### Output
![image](https://github.com/Azure/Azure-DataFactory/assets/117257517/7f1a8945-f669-4c5d-9fc7-c274e9b7eede)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.