Product:

Microsoft SQL Azure

Issue:

What index does exist in the database?

Solution:

Enter below query in SSMS to find list of all index:

SELECT
s.name AS SchemaName,
t.name AS TableName,
i.name AS IndexName,
i.type_desc AS IndexType,
i.is_primary_key,
i.is_unique,
i.is_unique_constraint
FROM sys.tables t
INNER JOIN sys.schemas s
ON t.schema_id = s.schema_id
INNER JOIN sys.indexes i
ON t.object_id = i.object_id
WHERE i.index_id > 0 -- Excludes heaps
ORDER BY s.name, t.name, i.name;

 

To list number of records in a AZURE database enter:

SELECT
SCHEMA_NAME(t.schema_id) AS SchemaName,
t.name AS TableName,
SUM(ps.row_count) AS Rader
FROM sys.tables t
JOIN sys.dm_db_partition_stats ps
ON t.object_id = ps.object_id
WHERE ps.index_id IN (0,1)
GROUP BY
t.schema_id,
t.name
ORDER BY Rader DESC;

 

To check if the database is in restoring state, switch focus to MASTER database, and run below script:

SELECT
name,
state_desc,
create_date
FROM master.sys.databases
WHERE name = 'MyRestoredDatabase';

 

Result:

state_desc Meaning
ONLINE Restore completed
COPYING Database creation/restore in progress
OFFLINE Not available
RECOVERING Final recovery phase

 

More Information:

How to count the number of rows in a table in SQL Server – Brent Ozar Unlimited®

SQL COUNT() Function

 

Product:

Notepad++

Issue:

How to check that the downloaded notepad program is the correct one?

Solution:

Check the file hash, to ensure that the file is the original one from notepad++ web site.

Download the file from Download Notepad++ v8.9.8.1 (stable: auto-update triggered) | Notepad++

In our example we take the x64 version and click on installer (exe) link to download. Save the file in a folder like c:\temp\check

Then you need to download the checksum from there site;

Click on “SHA-256 digests of binary packages” to download the text file, with the hashes for all files of this version, to your folder c:\temp\check.

Open the file npp.8.9.8.1.checksums.sha256 in Notepad.  Look at the line that is for your version.

Start PowerShell on  your windows computer.

Go to the folder where you stored the exe file you downloaded, in our example c:\temp\check

Enter command: Get-FileHash -Path “npp.8.9.8.1.Installer.x64.exe” -Algorithm SHA256

Replace with your file name, to make the test accurate.

Compare the hash in the txt file with the one you get in powershell above. If they match your are in good status.

 

To convert a txt files content to all CAPS (UPPERCASE) use:

(Get-Content 'secondhash.txt').ToUpper() | Set-Content -Path secondhash.txt

 

More Information:

How to Verify Checksum of a File in Windows? – GeeksforGeeks

How to Verify Checksum of a File – Technology Spy

Get-FileHash -path filename.txt -Algorithm XXX

To get a list of parameter values for Algorithm, you can use Get-Help Get-FileHash

MD5 Example: Get-FileHash -path filename.txt -Algorithm MD5
SHA1 Example: Get-FileHash -path filename.txt -Algorithm SHA1
SHA256 Example: Get-FileHash -path filename.txt -Algorithm SHA256

How to Compare Two Files in Notepad++

Use PowerShell to Compare Two Files – Scripting Blog [archived]

Product:
LM Studio
Microsoft Windows 10 or later
Nvidia GEFORCE GTX 980 with 4 GB ram or better

Issue:

How test LLM (Large Language Model) locally on my computer?

How run LM Studio on my Windows?

Solution:

There are many ways to do this, but this is one of the simpler. https://blog.n8n.io/local-llm/

First your computer needs a CPU that supports AVX2 instruction set.

https://us.forums.blizzard.com/en/d2r/t/list-of-avx-supported-processors-intel-amd/12969

You need a Nvidia Graphic card with at least 4 GB RAM or more. The graphic cards memory holds the LLM model and the GPU is the one doing the work when you use a LLM. The more memory the better LLM can you use.

https://llmconfigurator.com/en/guides/best-gpu-buyer-guide 

Your Windows computer need at least 16 GB of RAM.

Download the LM STUDIO from https://lmstudio.ai/download 

If you download LM Studio Bionic, you must install the latest supported v14 (for Visual Studio 2017–2026) from here:

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

Bionic will not start if you do not have the latest Visual C++ Runtime libraries.

Run LM-Studio-0.4.26-4-x64.exe to install the software on your computer.

Start LM Studio from the icon.

Now you need to download a LLM model – inside LM Studio go the the model search and see a list of models to use. Check the size of the model in the description.

Select a model that fits in your graphics cards memory. Click download to get it to your computer.

Go to library, and select the model and click on load Model. Here you can adjust context length (this requires more memory) before you Load Model. This will load it to the GPU memory.

Then you can go to the CHAT, and start using the model.  Questions that take seconds on internet, will take 10s of minutes on your computer. But it is all local.

The symbols think and vision, is that it will show how the LLM think, and that it can understand pictures if you send one to it. The LLM can not draw pictures.

To make a local Large Language Model (LLM) draw pictures, you need to pair the text model with a separate image generation model (such as Stable Diffusion or FLUX) or use a tool that connects them. Standard text-only LLMs process and output words, not pixels, so they cannot draw on their own unless paired with an image backend (though some modern environments like Ollama are adding experimental native text-to-image support for specific vision/image models).

 

For one user, it is easier and cheaper, to use a subscription to some of the paid service on internet, than to have a local LLM model.

https://www.artspace.ai/ 

https://opentherank.com/ai-pricing/

https://opentherank.com/ai-pricing/le-chat/ 

https://chat-box.ai/

 

More Information:

An LLM (Large Language Model) is a type of artificial intelligence trained on massive amounts of text to understand, summarize, translate, and generate human-like language. [1, 2]
How It Works
  • Next-token prediction: LLMs read text broken down into small pieces called tokens (words or parts of words) and guess what word should come next. [1, 2]

  • Transformer architecture: They rely on deep learning neural networks (introduced by Google) that use “self-attention” to track how words relate to one another across long sentences. [1, 2]

  • Massive scale: They are trained on billions or trillions of words from books, websites, articles, and code. [1, 2]

https://www.twoody.com/local-llm-calculator/nvidia-gpu 

https://www.databasemart.com/blog/choosing-the-right-gpu-for-popluar-llms-on-ollama

https://cpu.userbenchmark.com/ 

https://www.epey.co.uk/cpu/technologies-supported/avx2/ 

https://www.cpu-world.com/cgi-bin/CPU_Chart.pl

https://www.junian.dev/downloads/vc-redist/ 

https://lmstudio.ai/docs/app/basics 

https://aipricecompare.org/ 

https://artificialanalysis.ai/models

https://sandner.art/run-large-language-models-locally-a-practical-guide-to-local-llms-llama3-gemma-mistral/

https://www.pluralsight.com/resources/blog/ai-and-data/how-run-llm-locally-desktop

 

Product:
DuckDB v1.5.5 (Variegata)

Issue:

How sum a big csv file?  Excel is to small.

Solution:

Download DUCKDB, that is an embedded column-oriented database purpose-built for analytical workloads (OLAP).
DuckDB load your data in memory on your laptop, and then let you use SQL querys to find out information.
DuckDB’s SQL parser is derived from the pg_query library (https://www.sqlite.org/cli.html) , which is itself derived from PostgreSQL’s SQL parser that has been stripped down as much as possible.

On windows download the duckdb zip file, and unzip it to a folder like c:\duckdb. Go to that folder with powershell and enter DUCKDB to start the program.  https://duckdb.org/install/?platform=windows&environment=cli

 .\duckdb.exe

To import a csv file, that use European characters (note it use Linux syntax, forward slash for folders) , use a command like this:

create table budget as select * from read_csv_auto('c:/temp/db/datatabell.csv' , encoding='Latin-1') ;

This will create a in-memory databas called budget, that you can query, like to list number of rows:

select count(*) from budget ;

To get a sum for a month (note that it differs for small and capital letters  Month and month are two different columns):

select sum(amount) from budget where Månad='01' and År=2027;

Enter below to get a quick glance of what column names exist in the database table:

select * from budget ;

Then you can see the name and if it is int64 or varchar.   To find rows with zero as value, enter:

select * from budget where amount = 0;

 

To stop duckdb enter  .exit.  When you  exit duckdb the database is erased.

 

More Information:

DuckDB’s architecture delivers several distinct advantages over traditional databases and data analysis tools:

  • Vectorized query execution — Processes data in batches of 2048 rows, maximizing CPU cache efficiency and enabling SIMD acceleration
  • Columnar storage — Only reads the columns your query requests, dramatically reducing I/O compared to row-based systems
  • Direct file querying — Query CSV, Parquet, and JSON files directly without importing them first — a massive productivity boost
  • Hybrid execution — Supports both in-memory and on-disk processing, automatically spilling to disk when datasets exceed available RAM
  • Full SQL standard compliance — Supports complex queries including window functions, CTEs, PIVOT, and UNION that go far beyond what Excel or Pandas can do
  • Multi-language support — First-class bindings for Python, R, Java, Node.js, C++, Rust, and many more
  • Extension ecosystem — Load extensions for HTTP/S3 access, full-text search, spatial data, and more

How DuckDB Compares to Alternatives

Aspect DuckDB SQLite Pandas PostgreSQL
Storage model Columnar Row-based In-memory Row-based
Analytics perf ⚡ Fast Slow Fast (fits RAM) Moderate
Setup time Seconds Seconds Minutes (env) Hours (server)
Max dataset >RAM (spills) <RAM <RAM >RAM
SQL features Full Basic No native SQL Full

 

https://duckdblab.org/en/post/duckdb-beginners-guide-2026/ 

https://duckdb.org/docs/lts/data/csv/overview

https://duckdb.org/docs/current/guides/file_formats/csv_import

https://duckdb.org/docs/current/sql/introduction

https://motherduck.com/blog/duckdb-tutorial-for-beginners/

https://www.sqlite.org/cli.html

https://en.wikipedia.org/wiki/DuckDB

https://github.com/davidgasquez/awesome-duckdb 

https://duckdblab.org/en/cheatsheet/

https://duckdb.org/docs/current/sql/dialect/friendly_sql

Query Features

Product:

Microsoft Azure SQL

Issue:

Store procedures / process take a long time to finish – than a few weeks ago to a lot less of time.
The usage of resources in the SQL server is flat in the monitor view.

Solution:

Check that you do not have any columns that use [NVARCHAR](MAX) in a stage table or other table. This can when data grow in your tables, make the SQL CPU /Memory resources – be to small for it to handle.

Check also if you can make a CREATE NONCLUSTERED INDEX on you largest table that are in use in the query, to help improve performance.

As a very short term solution, you can increase cpu and memory on your Azure SQL instance, but this is not a good solution.

When you combine an nvarchar(max) with an nvarchar(100), SQL Server often implicitly promotes the result to nvarchar(max). Once an expression becomes a LOB (Large Object) type, SQL Server may switch to much more expensive processing. Nvarchar(max) is treated differently than normal string types. nvarchar(100) is stored directly in-row.
nvarchar(max) may be stored off-row. “Stored off-row” means SQL Server may not keep the actual string data inside the data page that contains the rest of the row. A SQL Server data page is only 8 KB. Then SQL Server must maintain LOB pointers and perform additional I/O.

This increases CPU and memory usage. When SQL Server sees nvarchar(max), it must assume values could be huge (up to 2 GB).

Check whether SQL Server is using off-row storage

SELECT
OBJECT_NAME(object_id),
lob_used_page_count,
used_page_count
FROM sys.dm_db_partition_stats
WHERE object_id = OBJECT_ID('dbo.Test');

 

If lob_used_page_count is non-zero, SQL Server is storing LOB (nvarchar(max), varchar(max), xml, etc.) data on separate pages.

 

To see what SQL are doing, enter:

sp_who2

More Information:

https://www.brentozar.com/archive/2016/10/max-data-types/

https://www.brentozar.com/archive/2025/10/which-should-you-use-varchar-or-nvarchar/

https://www.brentozar.com/free-sql-server-training-videos/ 

https://vladdba.com/2024/05/26/the-curious-case-of-the-truncating-nvarcharmax-variable/

https://www.conradakunga.com/blog/how-to-index-a-nvarcharmax-table-in-sql-server/ 

https://learn.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql?view=sql-server-ver17 

https://erikdarling.com/using-sp_tableoption-to-store-lob-data-off-row/ 

https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/performance/troubleshoot-memory-issues

Product:

Microsoft AZURE SQL database

Issue:

It is running a long time, what is the SQL doing?

Solution:

In SSMS, run below query’s to get some information:

 

SELECT
r.session_id,
r.status,
r.wait_type,
r.wait_time,
r.blocking_session_id,
r.cpu_time,
r.total_elapsed_time,
DB_NAME(r.database_id) AS database_name,
t.text
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t
ORDER BY r.total_elapsed_time DESC;

 

 

SELECT
r.session_id,
s.login_name,
s.host_name,
r.status,
r.command,
r.cpu_time,
r.total_elapsed_time,
r.logical_reads,
r.reads,
r.writes,
DB_NAME(r.database_id) AS database_name,
t.text AS sql_text
FROM sys.dm_exec_requests r
JOIN sys.dm_exec_sessions s
ON r.session_id = s.session_id
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t
WHERE r.session_id <> @@SPID
ORDER BY r.cpu_time DESC;

 

 

The key columns are:

  • wait_type → what resource it is waiting for.
  • blocking_session_id → another session blocking it.
  • wait_resource → the specific resource.

 

More Information:

https://www.mssqltips.com/sqlservertip/5521/understanding-and-using-sql-server-sysdmexecrequests/ 

https://dev.to/shiviyer/mastering-performance-troubleshooting-with-sysdmexecrequests-in-azure-sql-3f0j 

 

Product:
Microsoft Windows 2022 server

Issue:

List users who have access to a folder from script?

Solution:

Start a powershell window and enter something like this:

$path = "C:\Your\Folder\Path"
(Get-Acl $path).Access |
    Select-Object IdentityReference, FileSystemRights, AccessControlType, IsInherited |
    Format-Table -AutoSize
More information:

 

Product:
FileBeat 8.19.3

Microsoft Windows 2022 server

Issue:

Have installed filebeat service in windows, to collect logs files to elastic, but it does not read any files. And when i try to stop the services it hangs.

After you stop the filebeat service with Task Manager, you need to erase the lock file in folder C:\ProgramData\filebeat\ to make it to read the yml file at next start of the service.

Solution:

Check the filebeat.yml file. The JSON format is sensitive to spaces and other formats.

In this case there was a row:
ignore_older: ‘7d’
that made the filebeat service to stop.

It only supports minutes and hours, so you need to enter like this:
ignore_older: ‘168h’

The ignore_older: ‘168h’ function will check the timestamp of the file, and not read files that was created more than 7 days ago.

The filebeat.yml file is in folder C:\Program Files\Filebeat on windows.

Below a example of a filebeat.yml file for use with TM1 logs files – you need to add spaces in the beginning of every line to get it to work.

# ============================== Filebeat inputs ===============================
filebeat.inputs:
- type: filestream
id: tm1server
enabled: true

paths:
- D:/TM1 folder/Logs/tm1server.log
fields_under_root: true
fields:
event:
dataset: audit.plain

- type: filestream
id: tm1s2
enabled: true
ignore_older: '168h'
paths:
- D:/TM1 folder/Logs/tm1s2*.log
exclude_lines:
- '^#'
include_lines:
- 'AD'
fields_under_root: true
fields:
event:
dataset: audit.plain

# ---------------------- beats state ----------------------
- type: filestream
id: beats-logs
enabled: true
paths:
- C:/ProgramData/filebeat/logs/filebeat*.ndjson
include_lines:
- 'Non-zero metrics in the last 30s'
fields_under_root: true
fields:
event:
dataset: beats.state
processors:
- dissect:
tokenizer: '%{}"@timestamp":"%{event.start}"'
field: message
target_prefix: ""
ignore_failure: true
setup.template.settings:
index.number_of_shards: 1
fields:
system:
env: prod
id: SystemTM1
fields_under_root: true
max_procs: 1
processors:
- add_host_metadata:
when.not.contains.tags: forwarded
- add_cloud_metadata: ~
output.logstash:
hosts: ["elasticservername.domain.com:9999"]
ssl.enabled: true
ttl: 5m
pipelining: 0



More Information:

Filebeat sends log files to Logstash or directly to Elasticsearch.

## Getting Started

To get started with Filebeat, you need to set up Elasticsearch on
your localhost first. After that, start Filebeat with:

./filebeat -c filebeat.yml -e

This will start Filebeat and send the data to your Elasticsearch
instance. To load the dashboards for Filebeat into Kibana, run:

./filebeat setup -e

For further steps visit the (https://www.elastic.co/guide/en/beats/filebeat/8.19/filebeat-installation-configuration.html) guide.

## Documentation

Visit (https://www.elastic.co/guide/en/beats/filebeat/8.19/index.html) for the full Filebeat documentation.

## Release notes

https://www.elastic.co/guide/en/beats/libbeat/8.19/release-notes-8.19.3.html

https://www.elastic.co/beats/filebeat

https://www.elastic.co/downloads/beats/filebeat

https://github.com/elastic/beats

Product:

Microsoft Power Bi dataflow

Issue:

Get a error on all dataflow, Error: An authentication problem is preventing the dataflow from being refreshed. Please have the owner of the dataflow sign out of Power BI and sign back in and try again.

or error message like  {“code”:”DMTS_OAuthTokenRefreshFailedError”,”details”:[{“code”:”DM_ErrorDetailNameCode_UnderlyingErrorMessage”,”detail”:{“type”:1,”value”:”AADSTS135010: UserPrincipal doesn’t have the key ID configured} from the dataset that use the dataflow.

Can happen if you change you windows pincode login from microsoft, and use the same account to run the dataflow with.

Solution:

Go to the dataflow in your workspace in https://app.powerbi.com/

Go to settings

Click on data source credentials

Click on edit credentials

If the value is correct, click Sign in without a change.

Confirm the login question you will get, from you company.

Go to the workspace.

Try to refresh the dataflow again.

 

More information:

This error indicates that the cached credentials for the dataflow owner have expired, changed, or are no longer authorized to access the data source, causing a Power BI refresh failure. To resolve it, the owner must sign out of the Power BI service, clear browser cache, sign back in, and re-enter credentials in the dataflow settings.
Actionable Steps to Resolve:
  • Re-authenticate Dataflow Credentials: The dataflow owner should go to the Power BI Service, locate the dataflow, go to Settings > Data source credentials, and click “Edit credentials” to re-authenticate.
  • Sign Out/In: Sign out of app.powerbi.com completely, clear your browser cache/cookies, and sign back in to refresh token authentication.
  • Check Data Source: If using a Gateway, ensure the credentials in the gateway settings are valid.
  • Verify Permissions: Ensure the user who created the dataflow still has permissions to the underlying data sources (SQL, SharePoint, etc.).

 

https://www.fourmoo.com/2019/02/13/why-is-my-powerbi-dataflow-refresh-failing/ 

Product:

Power BI Dataflow

Issue:

After user account is changed (owner), the dataflow is not updated.  (this is only when you use a Power BI gateway to access SQL database on prem.)

 

Solution:

You have on the dataflow gone to settings, and change the owner to a other person. (by press the Take Over button)

On the dataflow tab go to EDIT

Click EDIT on one table.

You get a error message, that it can not contact SQL server.

Click on OPTIONS icon.

Click on project and data load, and change the data gateway to one in the dropdown list.

Click OK.

Now the table should be refreshed automatic, and you can save and close the dataflow.

 

More Information:

https://learn.microsoft.com/en-us/power-bi/transform-model/dataflows/dataflows-configure-consume

https://learn.microsoft.com/en-us/power-query/dataflows/data-sources?tabs=power-bi-service

https://data-marc.com/2022/08/02/what-you-must-know-when-building-power-bi-dataflows-routing-over-the-on-premises-data-gateway/