Posts by Giovanni Machado • 118 points
12 posts
-
1
votes1
answer255
viewsA: Abort the execution of a long-term SQL
Here is a suggestion: Create a table structure in your database or create a folder to receive text files with XML/Json content. After creating the structure above, instead of making a thread and…
-
0
votes2
answers4180
viewsA: Create a script to check if the table has a primary key
Krispim, use the following select: IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 'Persons' and COLUMN_NAME = 'P_Id' AND TABLE_SCHEMA ='dbo') BEGIN ALTER TABLE…
-
1
votes1
answer1421
viewsQ: How to serialize a Json in Object? Delphi XE7
I need to generate an Object that represents a JSON file and Delphi is generating me the following ERROR: 'Internal: Invalid pair name {"directory":"d: Folder Doc"}: expected type or ref' In the…
-
1
votes3
answers258
viewsA: How to generate SQL in relationship table without repeating values?
Video (1, 'Testourl1'), (2, 'testeUrl2') Videocategoria(1, 1, 1), (1, 1, 2) Category(1, 'Terror'), (2, 'Action'') If you want to return the Video URL and Category Description, will always go return…
-
0
votes3
answers309
viewsA: Postgres SQLSTATE[42725]: Ambiguous Function
By what you put from your select is missing close last parentheses. Current: UPDATE produto.categoria_departamento SET left_categoria = (left_categoria + 10) WHERE (left_categoria >= CASE WHEN 2…
-
1
votes4
answers3477
viewsA: Principle of Delegation, what is it?
Delegation in the Object Orientation view is when you develop an Object that delegates tasks to other objects, it is as if you have an intermediate object between the Superclass and the Class that…
oopanswered Giovanni Machado 118 -
1
votes1
answer376
viewsA: Procedure If exists update Else Insert in table with composite SQL Server key
This way I’ll show you guarantees the integrity of the data with the use of the transaction, see if it helps you: begin tran if exists (select * from Sua_tabela with (updlock,serializable) where…
sql-serveranswered Giovanni Machado 118 -
1
votes1
answer1121
viewsA: Show only one record of each ID
I understood your question and the select for your answer is this, correct? WITH Tels as( SELECT ClientesTel.id, ROW_NUMBER() OVER (PARTITION BY Clientes.nome ORDER BY ClientesTel.id) as number,…
-
0
votes1
answer760
viewsA: SQL Sum by periods
Try including this command in your Where clause: V.data >= '01/09/2015' and V.data <= DATEADD(DAY,30, '01/09/2015') Your query would look like this, I made an improvement using INNER JOIN as…
-
-1
votes1
answer282
viewsA: Get query result by converting Date Time field to local Time zone
See if this instruction helps: Commando: SELECT CONVERT(varchar(10),CAST('2015-04-20 17:43' AS datetime2),103)+' '+ CONVERT(varchar(8),CAST('2015-04-20 17:43' AS datetime2),114) AS 'data' Upshot:…
-
0
votes1
answer120
viewsA: Question with Table Update Trigger
Notice that you are generating a recursive with Trigger, see: Example the @LOCK variable is like "S", in this case you will generate an update again in the table thus activating Trigger again, this…
-
1
votes1
answer248
viewsA: Timeout in processing
Thread and set a timeout for the thread, so you will call the SAT inside the thread and if any problem occurs, the thread timeout will be reached and the system will exit.
delphianswered Giovanni Machado 118