Viewing 15 posts - 466 through 480 (of 607 total)
TRY CATCH is used for error handling while IF is used for conditional logic.
IF (Some Condition)
BEGIN
-- run these statements if your condition is true
END
ELSE BEGIN
-- run these statements if your...
January 22, 2013 at 5:03 am
Beginner_2008 (1/21/2013)
Error Number: -1073548784
----------------------
Executing the query "BACKUP DATABASE [DatabaseName] TO DISK = N'\\\\BackupLocation" failed...
January 22, 2013 at 3:02 am
Nice easy question. The question is all about whether setting a bit datatype to 'TRUE' evaluates to 1 or NULL. Easy to guess as the output would either be all...
January 22, 2013 at 12:37 am
I had to investigate a similar problem and discovered the cause was a junior DBA running the following piece of code at 11PM and then going home.
BEGIN TRAN;
UPDATE MyTable SET...
January 21, 2013 at 6:17 am
tcomponent (1/17/2013)
Hi, NandyPerhaps you should modify your cursor query into this.
declare test_cursor cursor for
select * from test WITH(NOLOCK)
to be able to make alteration to the table
:sick:
January 21, 2013 at 6:11 am
fdassis (12/23/2012)
If your SQL Server is 2005 or later, you can use:SELECT 'Statistics since: ' + CAST(sqlserver_start_time AS VARCHAR) FROM sys.dm_os_sys_info
It's more safe and reliable.
Not so much a case of...
January 21, 2013 at 5:49 am
DVSQL (1/18/2013)
I see that there is normal stuff such as shrinking the database
Shrinking the database is not normal maintenance stuff.
January 21, 2013 at 5:12 am
SQLKnowItAll (1/18/2013)
..., but I don't know how to test.
Did someone steal your login credentials?
CREATE PROCEDURE TestErr
AS
DECLARE @Err NVARCHAR(255);
BEGIN TRY
SELECT 1 / 0
END TRY
BEGIN CATCH
SET @Err = 'Errrr';
RAISERROR(@Err, 16, -1);
END...
January 21, 2013 at 5:09 am
USE [AdventureWorks];
GO
CREATE TABLE TestTrigger (ID INT)
GO
CREATE TABLE TestTriggerAudit (ID INT)
GO
CREATE TRIGGER trTestTrigger ON TestTrigger
FOR INSERT
AS
INSERT INTO TestTriggerAudit SELECT * FROM inserted;
GO
INSERT INTO TestTrigger VALUES (1);
GO
CHECKPOINT;
INSERT INTO TestTrigger VALUES (22);
DBCC LOG('AdventureWorks',...
January 21, 2013 at 4:58 am
Binding a default value to a data type will be removed from SQL because it is a bad idea.
This feature will be removed in a future version of Microsoft SQL...
January 21, 2013 at 4:06 am
http://support.microsoft.com/kb/949080
Workaround 1
To work around scenario 1 in the "Symptoms" section, you must manually update the .NET Framework assemblies in SQL Server. To do this, use the ALTER ASSEMBLY statement to...
January 21, 2013 at 3:59 am
Stewart "Arturius" Campbell (1/21/2013)
Thanks
Sean Pearce (1/21/2013)
How does knowing the last day of February in 2016 have anything to do with...
January 21, 2013 at 2:49 am
This question is better suited for http://www.GeographyCentral.com.
How does knowing the last day of February in 2016 have anything to do with SQL Server? I had to check a...
January 21, 2013 at 1:21 am
Count Function (Report Builder 3.0 and SSRS)
Returns a count of non-null values specified by the expression, evaluated in the context of the given scope.
scope
(String) The name of a...
January 18, 2013 at 6:00 am
SQLRNNR (1/16/2013)
Index MaintenanceBackups
Integrity Checks
Deadlock monitoring
Don't forget to restore those backups.
January 17, 2013 at 3:27 am
Viewing 15 posts - 466 through 480 (of 607 total)