Add CREATE TABLE dbo.QueryHistory #17
Replies: 5 comments
-
This seems to work. `USE [AxialSQLTools] /****** Object: Table [dbo].[QueryHistory] Script Date: 8/2/2025 12:29:40 PM ******/ /****** Object: Table [dbo].[QueryHistory] Script Date: 8/2/2025 12:29:40 PM ******/ SET QUOTED_IDENTIFIER ON CREATE TABLE [dbo].[QueryHistory]( |
Beta Was this translation helpful? Give feedback.
-
The table is being created automatically on first insert. IF OBJECT_ID('{qhTableName}') IS NULL
BEGIN
CREATE TABLE {qhTableName} (
[QueryID] INT IDENTITY (1, 1) NOT NULL,
[StartTime] DATETIME NOT NULL,
[FinishTime] DATETIME NOT NULL,
[ElapsedTime] VARCHAR (15) NOT NULL,
[TotalRowsReturned] BIGINT NOT NULL,
[ExecResult] VARCHAR (100) NOT NULL,
[QueryText] NVARCHAR (MAX) NOT NULL,
[DataSource] NVARCHAR (128) NOT NULL,
[DatabaseName] NVARCHAR (128) NOT NULL,
[LoginName] NVARCHAR (128) NOT NULL,
[WorkstationId] NVARCHAR (128) NOT NULL,
PRIMARY KEY CLUSTERED ([QueryID]),
INDEX [IDX_{indexNameGuid}_1] ([StartTime]),
INDEX [IDX_{indexNameGuid}_2] ([FinishTime]),
INDEX [IDX_{indexNameGuid}_3] ([DataSource]),
INDEX [IDX_{indexNameGuid}_4] ([DatabaseName])
);
END I'll think about making this process a bit more transparent. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I would just update the documentation for clarity. Query History is the number one reason that the extension caught me attention. I did create the table manually on the local instance of my DB so that queries would be captured across instances/databases. Saving the Query Templates to a shared location is quite nice as it allows templates to be shared among a team.
From: Alex Bochkov ***@***.***>
Sent: Monday, August 4, 2025 12:41 PM
To: Axial-SQL/AxialSqlTools ***@***.***>
Cc: David Holley ***@***.***>; Author ***@***.***>
Subject: [EXTERNAL] Re: [Axial-SQL/AxialSqlTools] Add CREATE TABLE dbo.QueryHistory (Discussion #17)
The table is being created automatically on first insert.
https://github.com/Axial-SQL/AxialSqlTools/blob/main/AxialSqlTools/AxialSqlToolsPackage.cs#L173C1-L193C28
IF OBJECT_ID('{qhTableName}') IS NULL
BEGIN
CREATE TABLE {qhTableName} (
[QueryID] INT IDENTITY (1, 1) NOT NULL,
[StartTime] DATETIME NOT NULL,
[FinishTime] DATETIME NOT NULL,
[ElapsedTime] VARCHAR (15) NOT NULL,
[TotalRowsReturned] BIGINT NOT NULL,
[ExecResult] VARCHAR (100) NOT NULL,
[QueryText] NVARCHAR (MAX) NOT NULL,
[DataSource] NVARCHAR (128) NOT NULL,
[DatabaseName] NVARCHAR (128) NOT NULL,
[LoginName] NVARCHAR (128) NOT NULL,
[WorkstationId] NVARCHAR (128) NOT NULL,
PRIMARY KEY CLUSTERED ([QueryID]),
INDEX [IDX_{indexNameGuid}_1] ([StartTime]),
INDEX [IDX_{indexNameGuid}_2] ([FinishTime]),
INDEX [IDX_{indexNameGuid}_3] ([DataSource]),
INDEX [IDX_{indexNameGuid}_4] ([DatabaseName])
);
END
I'll think about making this process a bit more transparent.
—
Reply to this email directly, view it on GitHub<#17 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BMWGVTQ27XAHVOUI6ZZ3BZL3L6LL5AVCNFSM6AAAAACC66DZASVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOJZGE4TCMA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
|
Beta Was this translation helpful? Give feedback.
-
I've added the create script to the settings page. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I’ve had a few other thoughts but alas I work for a startup. 😊
From: Alex Bochkov ***@***.***>
Sent: Monday, August 25, 2025 8:25 AM
To: Axial-SQL/AxialSqlTools ***@***.***>
Cc: David Holley ***@***.***>; Author ***@***.***>
Subject: [EXTERNAL] Re: [Axial-SQL/AxialSqlTools] Add CREATE TABLE dbo.QueryHistory (Discussion #17)
I've added the create script to the settings page.
—
Reply to this email directly, view it on GitHub<#17 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BMWGVTTM3EIZQDMV5IRSSQT3PMFEHAVCNFSM6AAAAACC66DZASVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIMRRGA3TAMI>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The script to create the dbo.QueryHistory table is missing. The documentation/read me is also missing information on the table definition. I tried guessing via the columns in the Results grid and subsequent errors but ran into some blockers due to continued errors that do not expose the datatypes of the columns.
Beta Was this translation helpful? Give feedback.
All reactions