|
|
-
Vishal Gajjar Posted 4 Months ago through Syndicated Blogs | 1 Point
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 4 Months ago through Syndicated Blogs | 1 Point
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 5 Months ago through Syndicated Blogs | 1 Point
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 5 Months ago through Syndicated Blogs | 1 Point
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 5 Months ago through Syndicated Blogs | 1 Point
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 5 Months ago through Syndicated Blogs | 1 Point
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 6 Months ago through Syndicated Blogs | 1 Point
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...
|
-
Vishal Gajjar Posted 1 Years ago through Syndicated Blogs | 1 Point
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 Posted 1 Years ago through Syndicated Blogs | 1 Point
To check SQL Server Agent Job History you can use the Log File Viewer from SQL Server Management Studio.
To Open Log File Viewer,
1. Expand Server Node > 2. Expand SQL Server Agent > 3. Expand Jobs > 4. Right click on the Job and 5. Select "View Hi...
|
-
Vishal Gajjar Posted 1 Years ago through Syndicated Blogs | 1 Point
SQL Server stores all mails and attachments in msdb database. To avoid unnecessary growth of msdb database you should remove these mail history unless it is required for auditing or other purposes.
To check all mails processed by Database Mail, you can ...
|