sexta-feira, 27 de julho de 2018

SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.

SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.

This problem was happening whatever I tried to execute a stored procedure.
My solution was

At the beginning of the stored procedure I wrote

CREATE PROC [dbo].[YourProc]
    @yourparameter varchar(50)
AS
BEGIN

    SET ARITHABORT ON



quinta-feira, 26 de julho de 2018

WINRAR.exe zip - How to zip de files and subfolders

a -afzip -r -ep1  "path\file.zip"  "path\directory you want to zip\"

Don't forget the last left slash.
Do the test with and without the left slash and you'll see the subtleness.

:)

quarta-feira, 25 de abril de 2018

How to cause a deadlock on SQL Server on purpose

Hi!

What I really needed was an error with the word deadlock inside of the message, so this is what I did.
Whenever I need a deadlock to raise up I execute my procedure proc_deadlock.
Then I make my code treatment based on the message that contains the word deadlock.


USE [master]
GO

/****** Object:  StoredProcedure [dbo].[proc_deadlock]    Script Date: 25/04/2018 12:47:19 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create procedure [dbo].[proc_deadlock]
as

    -- RAISERROR with severity 11-19 will cause execution to 
    -- jump to the CATCH block. 
    RAISERROR ('this is my deadlock', -- Message text. 
               16, -- Severity. 
               1 -- State. 
               ); 

GO


quinta-feira, 19 de outubro de 2017

sexta-feira, 18 de agosto de 2017

DJANGO - Initial steps

If you're starting from scratch
pip install virtualenv
--------------------------------------

virtualenv [env_name]
pip install django
python Scripts\django-admin.py startproject [project_name]
python manage.py startapp [app_name]