New answers tagged

0

If you have access to DNS you can create a CNAME, or alias, with the name you want and point it to your server. If you don't have access to DNS you could also add an entry to your "Hosts" file on the server which will create the same kind of redirect as DNS only locally. If you decide to use a Hosts file make sure you document it well so in the ...


1

I don't think there's much specific variance on why to use one over the other, as far as SQL Server is concerned, rather they're just multiple options to accomplish the same thing. Likely it just depends on which drivers you have installed on the host server to your SQL instance, so not all of those options may always be applicable. Additionally, the ...


1

The issue you're running into is you have the same CustomerId ordering on the same OrderDate multiple times, so the COUNT() function will be inclusive of dupe dates. You can simply use the DISTINCT keyword inside the aggregate COUNT() method to minimally change your existing query like so: SELECT MAX(c.FirstName) as FirstName, COUNT(DISTINCT o.OrderDate) as ...


1

The reason why you can see incorect result is that COUNT(o.OrderDate) returns number of rows where o.OrderDate is not null. While you are looking for distinct values. You may use code as per below, but I think that there should be an easier way (with one of the window functions) with CTE AS ( SELECT Distinct c.FirstName as FirstName, o....


2

Some great advice above, but just a quick question before you do anything drastic - is the 92GB you quoted the size of the transaction log file, or is that the amount of space that is in use within a larger file? If only a few GB is in use within the transaction log then the transaction log backup will be a lot smaller than you might be expecting. Also you ...


13

Assuming this is a standalone instance and the database isn't part of an AG, you should be able to abandon the current log chain and start over, by: switch to simple recovery model run CHECKPOINT; twice DBCC SHRINKFILE(filename, 1); ALTER DATABASE db MODIFY FILE(name = filename, size = <some appropriate size>); I usually do this in multiple steps if ...


10

No, there is no concept of a "partial transaction log backup". Do you need to maintain the transaction log chain for restores, or otherwise hold on to the 92GB of transaction log backups? If you want to just get rid of it & start over, and can confidently say "I don't need to do point in time recovery to a point in time before now!" ...


18

No, you can't do partial log backups to split this work into multiple files. What you can do depends on your goals. If you need to maintain the log backup chain, your only option is to provision more storage (locally, or via a network share) and do a complete log backup If you don't need to maintain the log backup chain, and your goal is simply to get this ...


2

Possible? Yes. A good idea? Perhaps not. Here is one possible way to use a calculated column to facilitate placing rows onto individual partitions based on a composite value. Do this in tempdb, so we don't inadvertently clobber your work: USE tempdb; GO DROP TABLE dbo.Units; DROP PARTITION SCHEME units_ps; DROP PARTITION FUNCTION units_pf; GO Create the ...


0

Turns out that the stats were bad-ish... If I run: SELECT o.name as tablename, s.name as statsname, s.stats_id, sp.object_id, sp.stats_id, sp.step_number, sp.range_high_key, cast(sp.range_rows as bigint) as range_rows, cast(sp.equal_rows as bigint) as equal_rows, cast(sp.distinct_range_rows as bigint) as distinct_range_rows , cast(sp.average_range_rows as ...


5

Short answer to your questions: Forever See above (this doesn't happen, because of above) But there are exceptions: The client app can have defined a timeout less then indefinite, meaning it will send an "abort" (formally called "attention") on the TDS protocol after that many seconds. SQL Server receives the attention signal and ...


2

It's anybody's guess why the UI is preventing you from being able to use the copy-only checkbox. So I can't give you an answer and don't think it would be productive to throw out guesses. I can offer a workaround (and generally, this is a better way to accomplish just about anything a pointy-clicky UI tries to do for you): Press the Script button Copy the ...


1

This link should answer your question: http://nedotter.com/archive/2018/01/in-memory-oltp-resources-part-4-oom-the-most-feared-acronym-in-all-of-in-memory-oltp/ There is no max memory size for memory-optimized tables, but that doesn't mean you can't "run out of memory", based on the Edition you're running. Bottom line is that if you are running ...


1

The JSON you asked for is not valid. However, it looks like you may want a pretty similar JSON { "result": [ { "B": [1628424359816, 35] }, { "A": [1628424359816, 1] }, { "B": [1628424380816, 63] }, { "A": [1628424380816, 1] } ] } For this, you can ...


4

Unfortunately not. This information comes from the sys.dm_os_ring_buffers DMV, where it uses the RING_BUFFER_SCHEDULER_MONITOR record type. This information is produced every minute, and that is not customizable. I.e., it isn't the reports "fault", it is the information that is lacking in the first place. Below is the query that this report is ...


Top 50 recent answers are included