Viewing 15 posts - 1 through 15 (of 2,644 total)
naumon765 wrote:
Hi Jeff, Thanks for taking the time to share your thoughts. I wanted to mention that I do not like the formatting of sqlservercental.com...
June 28, 2026 at 2:10 am
Does the table have any clustered index, e.g a clustered primary key?
December 28, 2025 at 3:53 am
As Scott points out moving the ON condition of a left join to the WHERE will make it an inner join.
But it is a good idea to try rewriting the...
April 30, 2025 at 2:31 pm
I have a list of transactions in a table. Each transaction has a unique id which is a Guid, a date, a product that was ordered and an amount....
April 15, 2025 at 12:30 am
I have a list of transactions in a table. Each transaction has a unique id which is a Guid, a date, a product that was ordered and an amount....
April 15, 2025 at 12:30 am
You can export the data as text files as long as you re-import the files to check it goes smoothly. People often find commas in csv fields or...
April 10, 2025 at 5:50 pm
How could I incorporate this into a report?
Can I add this to the bottom of the query?
IF OBJECT_ID('tempdb..#source_table', 'U') IS NOT NULL DROP TABLE #source_table;
IF OBJECT_ID('tempdb..##new_table', 'U') IS NOT...
April 9, 2025 at 2:47 pm
if a global temp table works, that would be fantastic. When, how does a global temp table get dropped.
P.S. I'm thinking of putting this code into a report, which...
April 9, 2025 at 2:46 pm
This works using a global temporary table:
IF OBJECT_ID('tempdb..#source_table', 'U') IS NOT NULL DROP TABLE #source_table;
IF OBJECT_ID('tempdb..##new_table', 'U') IS NOT NULL DROP TABLE ##new_table;
DECLARE @sql NVARCHAR(MAX);
DECLARE @cols NVARCHAR(MAX);
DECLARE @insert_sql... April 9, 2025 at 2:16 pm
Error - Windowed functions cannot be used in the context of another windowed function or aggregate.
SELECT ROW_NUMBER() OVER (PARTITION BY Account ORDER BY A."Account") AS "RowNo", A."Account" AS "Account", (A."Debit")...
March 26, 2025 at 12:42 pm
RIGHT_SHIFT and LEFT_SHIFT are CPU instructions implemented in hardware using barrel shifters, making them extremely fast, significantly faster than multiplying or dividing by 2 raised to an integer power. However,...
March 19, 2025 at 4:47 pm
The POWER function is relatively resource-intensive, so a more efficient approach is to hardcode the 30 values directly.
CREATE OR ALTER FUNCTION dbo.ufn_GetStatusMSB_NF
(
@status...
March 16, 2025 at 3:40 am
Sorry, I should have been more specific; the reason I don’t use a temp table is the CTE is in an inline TVF which takes @status as a parameter;...
March 13, 2025 at 7:47 pm
I just tried this and it works
DROP TABLE IF EXISTS #Numbers
-- Create a temporary table
CREATE TABLE #Numbers (
Num INT
);
-- Populate the temporary...
March 13, 2025 at 4:41 pm
.
March 5, 2025 at 6:23 pm
Viewing 15 posts - 1 through 15 (of 2,644 total)