Get a Week’s Start and End Dates
To be able to use any date, and based on that date, get the start (Sunday) and end (Saturday) dates, use the following T-SQL: Start of Week (sunday): DATEADD(wk, DATEDIFF(wk, 6, @mydt), 6) End of week...
View ArticleSQL Statements followed by Semi-colon
You might see some examples on the net in which a semi-colon is used as a separator between multiple sql statements. This is still a requirement in some databases, but not generally, in SQL Server or...
View ArticleDateName Function in T-SQL
As you probably know, the month function runs against a date and returns numerically, giving you the number of the month of the year. For instance, if your date is in August, it will return an 8. If...
View ArticleTransaction Log is Full
If you ever get this error, whether it is in a SharePoint app or ASP.Net app, or directly in SQL Server, never delete the files directly. This will most likely cripple your application. Instead,...
View ArticleRenaming SQL 2008 Database
For quite a while, to rename a database, you could just execute the system stored procedure called ‘sp_renamedb': EXEC sp_renamedb 'OldName', 'NewName' At one point though, as I understood it, the word...
View ArticleDowngrading SQL 2008 to 2005 and Publishing to new Host
I came upon a strange situation, that I had to really work with, to get it done. My website databases were all done in 2008, and backups would not work across hosts in my case (using .bak or detaching...
View Article
More Pages to Explore .....