Attach All SQL Datafiles in a Directory
Have you ever had the need to attach a large number of database in one go? There’s no way to attach multiple databases in SSMS or via script, so...
2022-08-24 (first published: 2022-08-15)
278 reads
Have you ever had the need to attach a large number of database in one go? There’s no way to attach multiple databases in SSMS or via script, so...
2022-08-24 (first published: 2022-08-15)
278 reads
Sometimes I find remembering where a particular server sends its backups to a nightmare. You might have servers backing up to different locations, you might have different locations for...
2022-06-16
21 reads
Imagine that we’re seeing very heavy load on our SQL server, be it CPU or IO and we need to find out which database is the driver. I’m sure...
2022-05-11 (first published: 2022-05-03)
829 reads
I’m going to assume that most people will have at least heard of Brent Ozar’s brilliant First Responder Kit. If you haven’t then you’ve been missing out on some...
2022-02-09
66 reads
Spinlock contention is always a real headache to deal with. I recently saw an issue when spinlock contention on SOS_CACHESTORE was making the server virtually unresponsive. The issue was...
2021-11-15 (first published: 2021-11-03)
295 reads
Here’s an interesting issue that recently came up. We were seeing very high compilations and recompilations on a server to the point that it started causing us some very...
2021-10-29 (first published: 2021-10-19)
326 reads
It look like we had a little bug in sp_RestoreScript that was putting a rogue 0 after the backup file name. That’s now been fixed in 1.9. For information...
2021-09-16
66 reads
This is something that comes up time and time again. A developer or member of the service desk comes up to me and says “SQL’s timing out, you see...
2021-07-27
70 reads
As always the code can be found here in our github repoWe updated our sample report here We forgot to mention V2.5! We added the ability to add Thresholds...
2021-07-23
103 reads
We all had those calls, it’s the middle of the night and we get that phone call that a customer is getting error messages due to their tempDB being...
2021-06-30 (first published: 2021-06-18)
727 reads
By Steve Jones
This is my last week of the year working (I guess I come back...
Want to seriously boost your data skills? Mastering advanced SQL is the key, whether...
By Steve Jones
This is my last week of the year working (I guess I come back...
Comments posted to this topic are about the item Function Defaults
Comments posted to this topic are about the item Big Data or Small Data
I have created this function in SQL Server 2022:
CREATE FUNCTION dbo.AddInt (@one INT, @two INT = 1) RETURNS INT AS BEGIN RETURN @one + @two ENDHow can I call this and invoke the default value for @two? See possible answers