Problem with introspection and dumping DDL.

已回答

Hi, I'm connected to Azure SQL Database. I'm trying to dump all DDLS into files. Basically for each view I've got 

alter view schema.views as
-- missing source code
;

For tables I see only column names, without datatype, constraints etc..
The introspection on Database is set to level 3

 

0

Hi Walisko Rafal,

Are you using the SQL Scripts | SQL Generator to obtain the DDLs? Could you please provide:

  • The original DDLs of a sample table and view.
  • The output of the following queries (replace <view name> with the actual name):
SELECT @@version;
SELECT OBJECT_DEFINITION (OBJECT_ID('<view name>'));
SELECT HAS_PERMS_BY_NAME('<view name>', 'OBJECT', 'VIEW DEFINITION');
0

Hi @Anastasia Zhukova 

 

I'm using: Click on DB > Import/Export/ > Dump To DDL Data Source

Microsoft SQL Azure (RTM) - 12.0.2000.8 
Sep 16 2025 16:46:58 
Copyright (C) 2025 Microsoft Corporation



CREATE view [s_prodpric].[ALL_PROGRAMS]
AS 
SELECT 
CASE
    WHEN [PROMO_TYPE] IN ('DCP', 'PDA', 'NPI') THEN 'Online'
    WHEN [PROMO_TYPE]  = 'Offline' THEN 'Offline'
    ELSE ''
    end
as 'PROMO_TYPE'
,case 
      when sales_org_id like '3%' then 'LA'
      when sales_org_id like '4%' then 'EMEA'
      when sales_org_id like '5%' then 'AP'
	  when sales_org_id like '1%' then 'NA'
	  when sales_org_id like '2%' then 'NA'
      else REGION
      end as [Region]
,case
	when [SBU] = 'SDB' THEN 'SD'
	WHEN [SBU]='SCB' THEN 'SC'
	ELSE [SBU]
	END AS [SBU]
,[VALUE_USD]
from s_prodpric.grm_promotions
UNION ALL
SELECT 
'3 Years Promo' as 'PROMO_TYPE',
replace([REGION], 'Region','') as 'Region',
case
	when [SBU] = 'SDB' THEN 'SD'
	WHEN [SBU]='SCB' THEN 'SC'
	ELSE [SBU]
	END AS [SBU], 
[VALUE_USD]
from s_prodpric.grm_promotions_3YR_PROMO
union ALL
SELECT 
'MMI' as 'PROMO_TYPE',
replace([REGION], 'Region','') as 'Region',
case
	when [SBU] = 'SDB' THEN 'SD'
	WHEN [SBU]='SCB' THEN 'SC'
	ELSE [SBU]
	END AS [SBU], 
[MMI_CAL] AS 'VALUE_USD'
from s_prodpric.GRM_PROMOTIONS_MMI
1

It looks like, I can get here everything I want. The problem occurs for dumping whole data source

0

It looks like, I can get here everything I want. The problem occurs for dumping whole data source

So are you getting the correct DDLs when using SQL Scripts | SQL Generator for specific objects and when using SQL Scripts | Generate DDL to Clipboard for the whole data source?

Also, could you let me know you DataGrip version?

0

Actually no.. when I use this method it gives me mixed results, for some objects I have the proper DDL, for other: -- missing source code. With popup. however the whole database was set to introspection at level 3.
Altough your queries always give me the correct DDL, maybe there is some kind of instrospection problem

0

I see, thank you for clarifying it. May I ask you to additionally collect the log archive as follows?

  1. Generate the diagnostic dataSource*.log as described here, but instead of Step 2. "Run the introspection ..."  run Force Refresh.
  2. Collect the log archive via Help > Collect Logs and Diagnostic Data.
  3. Upload the log archive to https://uploads.jetbrains.com and specify the upload ID here once done.
0

Ok, during the force refresh process I saw many schemas were introspected at level 2, some of them were at level 3.

Upload id: 2025_10_21_DU3j6wbJPyBnP3NjWDPi1S (file: datagrip-logs-20251021-1522344118512667702116742.zip)

0

Walisko Rafal,

Could you first generate the diagnostic dataSource*.log as described here (with Force Refresh instead of Step 2. “Run the introspection ...”), wait for the introspection to finish, disable the Diagnostic Mode, and then collect the log archive once again?

Also, please share a screenshot of the Introspection Level setting from the Options tab of the data source properties.

0


Here's the log: Upload id: 2025_10_22_2ARwCLT6fsSacV6qvh6yJW (file: dataSource-20251022-051516-Raitddb.log)
 

0

Walisko Rafal, thank you. I've reported it in the DBE-24519. Could you also attach the latest idea.log file (Help | Show Log in Explorer) to the ticket, just to have the logs aligned with each other (by default, the attached files are only available to our team)?

As for the tables, do you see only the column names without datatypes, constraints, etc. for all of them, or is it just specific ones? Could you share a sample table DDL as well?

0

请先登录再写评论。