Database Instructions - GitHub Copilot in SQL Server Management Studio (Preview)

Learn how to use database instructions with GitHub Copilot in SQL Server Management Studio (SSMS).

TSQL Problem:
Let's say you've got one or more scalar values that are VARCHAR 'strings' and you want to determine if they can be typed more appropriately.

For example '16:16:34.6733333' is data type TIME. It's easy to examine the value manually to make that determination. But how would you do it programatically (via TSQL)?

I've tried casting the VARCHAR as different types. TRY_CAST is successful for some data types. How would I know which one is 'right'?

#SQLHelp
#SQLServer
#SQL
#TSQL

Строковые константы в MS SQL

Строковые константы в MS SQL кажутся очень простыми в использовании. Но эта простота не всегда очевидна и порой приводит к тяжело выявляемым ошибкам в коде. По этой причине данная статья может оказаться полезной не только новичкам, но и тем, кто уже использует T-SQL в своей работе. Документация явно описывает два типа констант: обычные строковые и юникодные. Но на самом деле ситуация несколько сложнее, что и будет рассмотрено ниже.

https://habr.com/ru/articles/1001668/

#sql_server #sql #tsql

Строковые константы в MS SQL

Строковые константы в MS SQL кажутся очень простыми в использовании. Но эта простота не всегда очевидна и порой приводит к тяжело выявляемым ошибкам в коде. По этой причине данная статья может...

Хабр
OPENROWSET and External Tables for Fabric SQL Databases (Preview) | Microsoft Fabric Blog | Microsoft Fabric

Data Virtualization (Preview) for Fabric SQL Databases, enable you to query, analyze, and ingest OneLake data (CSV, Parquet, JSON) without moving or duplicating it. Data Virtualization brings to Fabric SQL Database the same set of capabilities already available on Azure SQL Database, Azure SQL Managed Instance and SQL Server, customers can now use OPENROWSET and &hellip; <p class="link-more"><a href="https://blog.fabric.microsoft.com/en-us/blog/openrowset-and-external-tables-for-fabric-sql-databases/" class="more-link">Continue reading<span class="screen-reader-text"> &#8220;OPENROWSET and External Tables for Fabric SQL Databases (Preview)&#8221;</span></a>

I spent some time writing up how to #unittest the creation and changing of #sql database components in #Microsoft #SqlServer 's #TSql . It's useful in restricted environments that won't allow other development tools that normally could conduct unit tests.
https://www.patreon.com/posts/148232620

#TodayILearned about table-valued scalar functions in Microsoft #TSql and why I should care.

These can be used in a view. If you need to run a procedure to calculate parts of the output, but use a middleware that is incapable of calling functions directly, scalar functions are your next best bet.

If they return their value as a table, you can "join" them to the main rowset in the view using the operations "cross apply" (which behaves like inner join) and "outer apply" (like outer join).

#TodayILearned that Microsoft #TSql does NOT automatically shave off the trailing spaces of a char-typed value when reading it from a data table and inserting it into a varchar-typed column of a different table. You have to trim it or convert it explicitly. Char data types aim to preserve their padding.

Do you write a lot of paper checks? (I don't--typically it's just one per month.) If so, do you screw up the year when writing in the date for the first few weeks/months of the new year?

This is my TSQL version of that. I'm off to a good start. 🙄

#TSQL
#SSMS
#NewYear

Dear Santa,

I wish for a IT remote job, so I can stop ruining my body as a laborer.

Thx a million

Yours Derek

Merry christmas to you all

#merrychristmas #santaclaus #remotejob #itjobs #msaccess #linux #vbnet #tsql #lowcode #noai

Resolving Write Conflicts in Microsoft Fabric Data Warehouse | Microsoft Fabric Blog | Microsoft Fabric

Fabric Data Warehouse (DW) supports ACID-compliant transactions using standard T-SQL (BEGIN TRANSACTION, COMMIT, ROLLBACK) and uses Snapshot Isolation (SI) as its exclusive concurrency control model. All operations within a transaction are treated atomically—either all succeed or all fail. This ensures that each transaction operates on a consistent snapshot of the data as it existed at &hellip; <p class="link-more"><a href="https://blog.fabric.microsoft.com/en-us/blog/concurrency-control-and-conflict-resolution-in-microsoft-fabric-data-warehouse/" class="more-link">Continue reading<span class="screen-reader-text"> &#8220;Resolving Write Conflicts in Microsoft Fabric Data Warehouse&#8221;</span></a>