Viewing 15 posts - 1,261 through 1,275 (of 2,648 total)
Thom A wrote:I don't understand what you're asking here. PST is a column already.
Sorry. PST row become column
Do you mean you want to have all the PST values for each...
December 12, 2019 at 7:15 pm
You will find you get much better performance if you split the merge into two separate statements (an update followed by an insert).
Performance Tip: The conditional behavior described for the MERGE...
December 12, 2019 at 7:07 pm
Empty file by migrating the data to other files in the same filegroup
Migrate all data from the specified file. This option allows the file to be dropped using the ALTER...
December 12, 2019 at 2:03 pm
If you are worried about shrinking the datafile then the standard advice is to create a new datafile and migrate the data into it.
December 12, 2019 at 1:51 pm
It looks like the entire program could be changed to be a single SQL statement. If you are using SQL Server 2012 or higher you could use the LAG function....
December 12, 2019 at 12:00 pm
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
...
December 12, 2019 at 1:16 am
If you press F7 in SSMS you can select multiple tables and script the create for all of them, in one go.
You would then have to edit the script but...
December 11, 2019 at 10:40 pm
Regarding @jonathan-ac-roberts 's test: you might want to include a GO between the two test queries. It might not make a difference, but I have found that quite...
December 11, 2019 at 6:24 pm
Is it because you are looking up on a different column: ponum instead of po_num
select po_num from poitem_all
where poitem_all.ponum not in (select po_num from preqitem)
December 10, 2019 at 7:15 pm
It may or may not use the index. It depends on whether the optimiser thinks a full table scan will be more efficient than a seek with a key-lookup. An...
December 10, 2019 at 7:05 pm
Well, I got to the first line of the article "Database UPPERCASE". I just wondered why you should have a database in uppercase? What if it consisted of 2 or...
December 10, 2019 at 12:24 pm
The execution plan is recommending you create the following indexes:
CREATE INDEX IX_DM_NOTF_CHG_EVNT_1 ON [DNB_MDM_MON].[dbo].[DM_NOTF_CHG_EVNT_ATTR]
(
[NOTF_CHG_EVNT]
)
INCLUDE
(
[ELMNT_XPATH],
[CHG_TYP_ID],
...
December 9, 2019 at 2:12 am
Change the query to this:
SELECT a.notf_chg_evnt AS notf_chg_evnt,
a.notf_btch_dtl_id AS notf_btch_dtl_id,
a.chg_detct_time AS...
December 7, 2019 at 9:00 pm
45 minutes or more doesn't sound unreasonable for a table that big, but it also depends on the hardware, particularly the disk.
December 7, 2019 at 12:17 pm
I use this to get active SQL statements.
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time,
CONCAT(req.total_elapsed_time/1000,' secs') elapsed_secs,
CONCAT(req.total_elapsed_time/1000/60,' mins') elapsed_mins
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(req.sql_handle) AS sqltext
It also gives the amount of CPU each statement...
December 6, 2019 at 4:21 pm
Viewing 15 posts - 1,261 through 1,275 (of 2,648 total)