|
|
-
Vishal Gajjar Posted 3 Months ago through Syndicated Blogs
Finding database creation time is simple if database has not been detached from server. You can find database creation time using below methods.
Using sp_helpdb:
You can find the creation time of database using sp_hepldb system procedure.
EXEC sp_helpdb...
|
-
Vishal Gajjar Posted 3 Months ago through Syndicated Blogs
SQL Server error logs can fill up quickly, and when you are troubleshooting something you may need to go through huge log. However you can cycle the error log to manage the amount of log you need to go through. When you cycle error log the current log f...
|
-
Vishal Gajjar Posted 4 Months ago through Syndicated Blogs
Earlier on my blog I posted about how you can attach a database using T-SQL when no log file is available. You can catch that here. In this post we will see how it can be attached using GUI.
To attach a database with no .ldf file, follow below steps:
1....
|
-
Vishal Gajjar Posted 4 Months ago through Syndicated Blogs
In SQL Server you can enable a Trace Flag at session (effective for current session only) level and global level. If you are not sure which Trace Flags have been enabled you can use DBCC TRACESTATUS() command to get a list of enabled Trace Flags.
DBCC T...
|
-
Vishal Gajjar Posted 4 Months ago through Syndicated Blogs
You can use WITH CHECKSUM option to perform checksum when backup is created. When used this verifies each page for checksum and torn page.
You can use it in a BACKUP command as below:
BACKUP DATABASE [SqlAndMe]
TO DISK = N'C:\SqlAndMe.bak'
WIT...
|
-
Vishal Gajjar Posted 4 Months ago through Syndicated Blogs
Each login in SQL Server has a default database associated with it. When you login to SQL Server context is set to default database for login. This is set when login is created and it can be changed by using ALTER LOGIN command.
If for some reason the ...
|
-
Vishal Gajjar Posted 5 Months ago through Syndicated Blogs
You can avoid executing a function when NULL values are passed as parameters. To achieve this you need to create function with RETURNS NULL ON NULL INPUT, this option introduced in SQL Server 2005.
You can use this while creating a function as below:
US...
|
-
Interview questions and answers on various SQL Server areas such as Database Administration, TSQL Development, BI etc....
|
-
Vishal Gajjar Posted 12 Months ago through Syndicated Blogs
Although, DML and DDL triggers are used for different purposes, there are some similarities and differences between these.
Similarities between DDL and DML triggers:
1. Both are created using similar T-SQL syntax
2. Both can run .NET code
3. You can c...
|
-
Vishal Gajjar Learned 12 Months ago through Just Learned
All of us like Keyboard Shortcuts and use it frequently but memorizing them might be painful and we get to remember them after we use it over a period of time. I just found a very easy way to learn and remember the Keyboard Shortcuts in SQL Server Ma...
|