question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQL Server Introspection Error

See original GitHub issue

Bug description

I seem to be running an error when I run npx prisma introspect a SQL server db on Azure. Here’s the error I run into:

Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Introspecting based on datasource defined in prisma\schema.prisma …
Error: P4002
The schema of the introspected database was inconsistent: Table RhionsUsers not found.

The DB structure is as follows: image_2020_12_20T10_55_31_908Z

Expected behavior

Generate models and add them to schema.prisma file

Environment & setup

  • OS: Windows
  • Database: mssql
  • Node.js version: 14.15.1
  • Prisma version:
Environment variables loaded from .env
@prisma/cli          : 2.13.1
@prisma/client       : Not found
Current platform     : windows
Query Engine         : query-engine fcbc4bb2d306c86c28014f596b1e8c7980af8bd4 (at node_modules\@prisma\engines\query-engine-windows.exe)
Migration Engine     : migration-engine-cli fcbc4bb2d306c86c28014f596b1e8c7980af8bd4 (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core fcbc4bb2d306c86c28014f596b1e8c7980af8bd4 (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary        : prisma-fmt fcbc4bb2d306c86c28014f596b1e8c7980af8bd4 (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Studio               : 0.329.0
Preview Features     : microsoftSqlServer

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
janpiocommented, Jan 5, 2021

Thanks for reporting this, we already have an issue for foreign keys that span schemas: https://github.com/prisma/prisma/issues/1175

I am closing this issue.

1reaction
pantharshit00commented, Dec 25, 2020

Indeed you have a different schemas Security and dbo. Prisma doesn’t support multiple schemas in one app yet. Marking this as a feature request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MSSQL database introspection failing? Unable to resolve ...
HI, I setup new connection to a MSSQL Azure AG database. I am able to connect fine, and when I sync all the...
Read more >
How do I introspect on a SQL Server? - Stack Overflow
I need to make some minor changes to the data in a few tables in the database in an automated fashion. Just INSERTs...
Read more >
What is introspection? (Reference) - Prisma
This is most commonly the case when you're not using Prisma Migrate but perform schema migrations using plain SQL or another migration tool....
Read more >
Performing Introspection on a Data Source Connection
Introspection is a method of inspecting a physical data source for metadata elements. When you perform introspection, structural information in the data ...
Read more >
GraphQL - OWASP Cheat Sheet Series
There are GraphQL servers and clients implemented in various languages. ... default configurations (e.g. excessive errors, introspection, GraphiQL, etc.).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found