prisma: MSSQL Prisma: ConnectorError { user_facing_error: None, kind: QueryError(Utf8)

Bug description

Kinda premise is here: https://github.com/prisma/prisma/discussions/7475

In short: Introspected via prisma already existing database on localhost (which was created via .bak file earlier with MS SQL Server Studio), tried to make a basic query/graphql type for start via example and now receiving error while querying Invalid `prisma.people_List.findMany()` invocation:\n\n\n Error occurred during query execution:\nConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Utf8) })

Prisma information

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["microsoftSqlServer"]
}

datasource db {
  provider = "sqlserver"
  url      = env("DATABASE_URL")
}

model people_List {
  id_People           Int       @id @default(autoincrement())
  Surname             String    @db.VarChar(30)
  Name                String    @db.VarChar(30)
  **[A lot of other columns] too lazy to describe**
}

Environment & setup

  • OS: Windows 10 [RU]
  • Database: MSSQL
  • Node.js version: 15.8

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 43 (23 by maintainers)

Most upvoted comments

Yeah, ran a query now with an updated (aka reinstalled) @prisma/client and prisma to 25.0 version and now I’m not receiving error and can receive Char string. About mutations… well, maybe will write/test later, now a bit busy

image

Oh, wait, got the script of creating table (columns), though I guess it will be empty

/****** Object:  Table [dbo].[people_List]    Script Date: 06.06.2021 18:17:01 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[people_List](
	[id_People] [int] NOT NULL,
	[Surname] [varchar](30) NOT NULL,
	[Name] [varchar](30) NOT NULL,
	[Patronymic] [varchar](30) NULL,
	[OldSurname] [varchar](30) NULL,
	[OldName] [varchar](30) NULL,
	[OldPatronymic] [varchar](30) NULL,
	[Marriage] [bit] NOT NULL,
	[Sex] [char](1) NOT NULL,
	[BornDate] [datetime] NOT NULL,
	[BornPlace] [varchar](100) NULL,
	[id_Doc] [smallint] NOT NULL,
	[DocSerial] [varchar](10) NOT NULL,
	[DocNo] [varchar](30) NOT NULL,
	[DocDistributed] [varchar](150) NULL,
	[DocDate] [datetime] NULL,
	[DocDepartmentCode] [varchar](50) NULL,
	[id_Sitizen] [smallint] NOT NULL,
	[Photo] [image] NULL,
	[Other] [text] NULL,
	[is_webimported] [bit] NOT NULL,
	[id_web] [int] NULL,
	[FIO] [varchar](92) NOT NULL,
	[FIO2] [varchar](125) NULL,
	[msrepl_tran_version] [uniqueidentifier] NOT NULL,
	[SurnameRP] [varchar](30) NULL,
	[NameRP] [varchar](30) NULL,
	[PatronymicRP] [varchar](30) NULL,
	[id_Nationality_old] [int] NULL,
	[id_Nationality] [int] NULL,
	[UID] [int] NULL,
	[UID_stat] [int] NULL,
	[UID_sok] [int] NULL,
	[UID_zo] [int] NULL,
	[INN_old] [bigint] NULL,
	[SSN] [varchar](255) NULL,
	[INN] [varchar](12) NULL,
	[tabNumber] [varchar](10) NULL,
 CONSTRAINT [PK_people_List] PRIMARY KEY CLUSTERED 
(
	[id_People] 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] TEXTIMAGE_ON [PRIMARY]
GO

Is this something that needs to be set on the server, database or table level? If you can share some code how to achieve this on a stock SQL Server, we might be able to reproduce this and hopefully understand and fix it.

You mean Collation (encoding)? Kinda it was automatically (I guess) set on installing MS SQL Server and MS SQL Server Studio. But I suppose it can be changed at least via MS SQL Server Studio with right-clicking and setting parameters of collation of the database