Import fails when target has the collation set and importing data with ASCII values
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 460
- Forks
- 29
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 7
Description
- SqlPackage or DacFx Version: All
- .NET Framework (Windows-only) or .NET Core: Both
- Environment (local platform and source/target platforms): Any
SqlPackage do not provide any parameter to modify or handle target database collation. Only workaround is to increase the length of the source table column and get an export to import to the different collation databases. Verify ICM: 397401962 for the issue. We need to check if this can be fixed or not.
**Steps to Reproduce:**
Source database:
1. Create a database with default collation.
2. Create a table `CREATE TABLE [dbo].[my_table](
[id] [int] IDENTITY(1,1) NOT NULL,
[txt] [varchar](10) NULL,
PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]`
3. Add sample data `SET IDENTITY_INSERT [dbo].[my_table] ON
GO
INSERT [dbo].[my_table] ([id], [txt]) VALUES (1, N'ABCDEFGZ')
GO
INSERT [dbo].[my_table] ([id], [txt]) VALUES (2, N'ABCDEFGé')
GO
SET IDENTITY_INSERT [dbo].[my_table] OFF
`
4. Export bacpac.
Target database:
1. Create database with collation "Latin1_General_100_CI_AS_SC_UTF8".
2. Import bacpac and it fails.

**Did this occur in prior versions? If not - which version(s) did it work in?**
(DacFx/SqlPackage/SSMS/Azure Data Studio)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the bacpac import with the provided table, ASCII and accented values, and the Latin1_General_100_CI_AS_SC_UTF8 target collation using SqlPackage or DacFx. Trace the import failure and determine whether the behavior can be corrected; done means the sample bacpac imports successfully or the limitation is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100