Posts Tagged: SQL Server

Recently I changed the name of my SQL Server computer from the generic one given by the Windows installation to ‘SERVER’. In the beggining there was no apparent problem in the connections since I used IP addresses. After a while I wanted to use Replication and tried to create an SQL Server Publication only to… Read Article →

Recently one of my sites that was created using umbraco has started to behave somewhat strange. There was nothing that seem to be wrong and all the errors produced were:  No Document exists with Version ‘00000000-0000-0000-0000-000000000000’ As it turned out the problem was due to extreme delay in the SQL Server. What made me look… Read Article →

Ever wanted to get the current time and date from the SQL Server to avoid different times between yous server and the clients (for example having a centralized application running on many countries) ? Using LINQ to SQL there is no way to get the time from the database build in the class. What you… Read Article →

The day of the week can be retrieved in SQL Server by using the DatePart function. The value returned by function is between 1 (Sunday) and 7 (Saturday). To convert this to a string representing the day of the week, use a CASE statement. Method 1: Create function running following script: CREATE FUNCTION dbo.udf_DayOfWeek(@dtDate DATETIME)… Read Article →

This is a SQL Script that Cleans your Database Records & resets Identity Columns, and it is all in 6 lines! /*Disable Constraints & Triggers*/ exec sp_MSforeachtable ‘ALTER TABLE ? NOCHECK CONSTRAINT ALL’ exec sp_MSforeachtable ‘ALTER TABLE ? DISABLE TRIGGER ALL’ /*Perform delete operation on all table for cleanup*/ exec sp_MSforeachtable ‘DELETE ?’ /*Enable Constraints… Read Article →

Scroll To Top