Viewing 15 posts - 286 through 300 (of 7,608 total)
Use EXISTS() instead of a JOIN (although SQL likely already is doing the equivalent of that in the plan, it doesn't hurt to be sure).
The only other thing you could...
January 3, 2024 at 9:24 pm
If you typically/most often query the table by Final_date, you need to cluster the table first on Final_date. If you have a column that would naturally make the index unique,...
January 2, 2024 at 3:09 pm
I think you would want something more like this:
DECLARE @DestinationTableName SYSNAME = 'dbo.tableA'
,@id NVARCHAR(30)
,@ProcessName VARCHAR(100) = 'ETL_InitialLoad'
,@SQL NVARCHAR(MAX)
SELECT @SQL = 'IF NOT EXISTS (SELECT * FROM dbo.ETL_lOG...
December 31, 2023 at 6:31 am
>> will process and return a table with Say DynamicMaster with column Distance added along with respective Data <<
How, specifically, does it return a table? Does it create a temp...
December 27, 2023 at 7:23 pm
Great. Glad it helped, and that the abbreviated way I posted it made sense.
December 20, 2023 at 3:42 pm
(1) Make sure any relevant statistics on the table are up to date.
(2) Easiest might be to add:
OPTION(RECOMPILE)
to the end of the SQL and see if it helps; iirc, SQL...
December 19, 2023 at 5:27 pm
Or maybe just this:
SELECT CompanyName,
LEFT(CompanyName, EndOfWord1) AS [First Word],
LEFT(CompanyName, EndOfWord2) AS [First + Second Word],
...
December 12, 2023 at 10:09 pm
You need to look at the "Estimated" plan for the one that doesn't work, just to be sure. See if anywhere SQL is referencing or "output"ing the restricted column.
December 11, 2023 at 9:08 pm
What is the specific error message (and error number and status) you get? (Using dummy column name(s) as needed, of course).
What is the query plan? Does it give any help...
December 11, 2023 at 6:02 pm
You don't need to export to Excel to do the comparison, you can do it directly in SQL Server.
December 8, 2023 at 4:05 pm
Look at the files on the drive and see if there is a large, obsolete file(s) (perhaps old backups?).
Depending on the version of SQL Server, you might also be able...
December 7, 2023 at 10:38 pm
Try this. It may not work because of the GROUPing. You might have to do the GROUPing after concatenating the subquery results.
SELECT
DISTINCT
G.[Period],
G.[Sector],
G.RID,
STUFF
((
SELECT
DISTINCT
...
December 7, 2023 at 8:52 pm
Is your tempdb database on the C: drive? If so, that could theoretically cause the problem.
By the way, 9GB is a very tiny amount of free space on a drive. ...
December 7, 2023 at 3:28 pm
Viewing 15 posts - 286 through 300 (of 7,608 total)