Skip to content Skip to sidebar Skip to footer
Showing posts with the label Tsql

Sql Join Only If All Records Have A Match

I have 3 tables: CP_carthead (idOrder) CP_cartrows (idOrder, idCartRow) CP_shipping (idCartRow, i… Read more Sql Join Only If All Records Have A Match

Start The First Day Of The Week As Sunday In Sql

I want my first day of the week to be as Sunday but my issue with my code is that it starts always … Read more Start The First Day Of The Week As Sunday In Sql

How To Use T-sql Merge In This Case?

I'm new to T-SQL command MERGE so I found a place in my SQL logic where I can use it and want t… Read more How To Use T-sql Merge In This Case?

T-sql Script To Calculate Time Difference Between Multiple Rows

I have a table that looks like this: EventDateTime EventName AppID --------------------… Read more T-sql Script To Calculate Time Difference Between Multiple Rows

Run A Delete Statement Certain Table Names Stored In A Table

I have a table which stores the names of certain tables - tableNames. I'd like to run a DELETE … Read more Run A Delete Statement Certain Table Names Stored In A Table

Insert Or Update Datatable Values Into A Database Table Using Stored Procedure

I have a table Cars as follows: This table will be read in grid of a C# application. The applicati… Read more Insert Or Update Datatable Values Into A Database Table Using Stored Procedure

Sql Server - Statistics And Recompiling

A bulk update was done on a table. This caused an SP to execute very slowly even if it had OPTION(R… Read more Sql Server - Statistics And Recompiling

How To Include Other Grouped Columns

I'm joining a couple of tables, and aggregating some of the columns via GROUP BY. This is what … Read more How To Include Other Grouped Columns