SQLProvider icon indicating copy to clipboard operation
SQLProvider copied to clipboard

Incorrect FROM statement is produced when a table name contains periods

Open jasonmcboyd opened this issue 2 years ago • 2 comments
trafficstars

Describe the bug

Using SQLProvider 1.3.8

Given a SQL table named A.B.C

This f# code: for t in ctx.Dbo.ABC

Produces this FROM statement when querying SQL Server: FROM [dbo.A.B].[C] instead of FROM [dbo].[A.B.C]

To Reproduce See above

Expected behavior I expect the correct FROM statement to be generated.

jasonmcboyd avatar May 22 '23 18:05 jasonmcboyd

The schema could have commas too... but would someone ever have a situation where they'd have [a.b].[c] and [a].[b.c] in the same database...

Thorium avatar May 22 '23 21:05 Thorium

I am not sure I understand. This is not a matter of the schema having periods or commas; the schema in question is [dbo]. The wrong query is being generated. It is querying table [C] in schema [dbo.A.B] neither that schema nor that table exist in the database. It should be querying table [A.B.C] in schema [dbo].

jasonmcboyd avatar May 24 '23 03:05 jasonmcboyd