Viewing 15 posts - 31 through 45 (of 1,315 total)
The ORDER BY used in filling the temp table has no effect on the column order in the XML result, because the DISTINCT keyword in your subquery (SELECT DISTINCT ColumnName...
February 26, 2019 at 3:25 pm
I don't get it. All the documentation links posted say it has to be 1 and 1 for memory-optimized tables. The example posted above shows an error message stating it...
February 26, 2019 at 3:04 pm
February 26, 2019 at 12:58 pm
You will only get as many rows as the nodes at the level of your XPATH expression. If your XPATH expression tells it to drill down to SupplierMapping nodes, then...
February 18, 2019 at 12:42 pm
A lack of Referential Integrity (foreign keys, constraints, etc) will certainly affect execution plans, and not in a good way. From their Wikipedia page: "Uniface applications are database- and platform-independent". Meaning...
February 12, 2019 at 12:14 pm
It occurred to me that instead of randomly reordering the Employees over and over again for each DataTable row, the NTILE function could be used to randomly divide DataTable into...
January 25, 2019 at 5:22 am
At first glance, you could do this with a correlated subquery. This would pick a random X or Y employee for each DataTable row.
UPDATE dbo.DataTable SET...
January 24, 2019 at 10:49 am
You probably need to use a Derived Column transformation to define a varchar(10) column from the expression "LEFT(xyz, 10)".
Changing the metadata to say you only want 10 characters...
January 22, 2019 at 12:43 pm
If you're going to run this in a multi-server window, you may not want separate results for each database.
Also, I deal with servers with different collations so at times...
January 18, 2019 at 8:33 am
The ? placeholder will be replaced by the database name, so just use it as a string literal.
EXEC sys.ms_foreachdb '
SELECT ''?'' AS DBName, t.name as TableName,...
January 18, 2019 at 8:20 am
Creating a view requires DDL admin rights, which are usually a higher level than read or write. I don't know if the combination of ddladmin and denydatawriter would even work.
January 2, 2019 at 11:00 am
If you are reading one row at a time in the CreateNewOutputRows method, and passing the data from each one to the appropriate ScriptBuffer.AddRow method, then it should not spool...
December 28, 2018 at 3:28 pm
Why not simply delete batches until there are no more left? I don't see why the temp tables and transaction are necessary, the procedure just exits if an error occurs.
December 28, 2018 at 2:57 pm
WITH stockRatings AS (
SELECT stockUID,
rating,
stockRatingCount = COUNT(*) OVER (PARTITION BY stockUID),
stockRatingOrder = ROW_NUMBER() OVER (PARTITION BY stockUID ORDER BY rating ASC)
December 28, 2018 at 2:41 pm
The sys.dm_exec_sessions view will show jobs running TSQL job steps with a program name like "SQLAgent - TSQL JobStep (Job 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF : Step 1)". You can parse out the job...
December 26, 2018 at 4:30 pm
Viewing 15 posts - 31 through 45 (of 1,315 total)