Something to watch out for when using sp_rename on Stored Procedures, Functions and Views
For those who don’t know, the stored procedure sp_rename allows you to change the name of a user-created object. Basically...
2013-02-11
2,337 reads
For those who don’t know, the stored procedure sp_rename allows you to change the name of a user-created object. Basically...
2013-02-11
2,337 reads
The other day one of the developers I work with gave me a script similar to this:
BEGIN TRAN
sp_rename 'tablename.columnname', 'newcolumnname'
COMMITHe...
2013-02-06
760 reads
We got a call last week about an application that was running slowly. The server was showing about 80% CPU...
2013-01-30
1,248 reads
Problem: You’ve added columns to the base table of one of your views, but the view isn’t reflecting the change.
Over...
2013-01-29 (first published: 2013-01-21)
3,837 reads
Most DBAs have at least some idea what the system databases are for. Master has the list of databases & logins,...
2013-01-28
929 reads
I just wanted to do a brief highlight of a handy little object property. For those of you who aren’t...
2013-01-23
1,451 reads
This isn’t really one of those features of SSMS that I’ve used a great deal. At least didn’t until recently....
2013-01-17 (first published: 2013-01-14)
3,282 reads
I just had the interesting task of finding the port number that one of the instances I deal with is...
2013-01-08
1,677 reads
Recently I received a security request and realized I wasn’t comfortable in my ability to script out the t-sql commands...
2013-01-07
838 reads
Most DBAs have seen those nice clear red errors in the results pane. And I’m sure most DBAs have noticed...
2012-12-27 (first published: 2012-12-19)
2,086 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