Questions tagged as 'tsql'

1
answer

Update field with a specific condition with trigger

I have the following situation I would like an idea of the condition that could be put in a trigger so that when you insert an ISR422 for example 1.1 the date is updated automatically of the one that has an isr422 = 1, that is, both would have t...
asked by 20.07.2017 / 22:55
3
answers

Get a word from a string in SQL Server 2008

I have a varchar field that contains a string with the following: "The Scenario is BUDGET; the Year is 2018; the period is June" The values of Scenario , Year and Period may vary. I am building a script, and part of w...
asked by 24.07.2017 / 21:28
0
answers

Doubt about triggers in T-SQL

As far as I understand, when a trigger is executed for the insert event, the new records are added to a virtual table called inserted. When running for a delete event, the deleted records are added to a temporary table named deleted. But w...
asked by 18.06.2018 / 03:19
1
answer

Pass parameter value to query before running in power bi

I am looking for a query to extract data from sql but I would like to know if power bi has the functionality of passing the value of a parameter in for example: start date and end date to the query and that this value is captured by the user bef...
asked by 25.04.2018 / 01:47
2
answers

SQL TRANSACTIONS

A query, I have a procedure with transaction handling, in which several INSERT must be executed, as I do to know in which INSERT I failed the procedure in such a way that I can show in the RAISERROR message something like "error to insert...
asked by 26.01.2018 / 21:02
1
answer

T-SQL: CASE within WHERE

I have the following WHERE where I have to put a clause CASE to do a search depending on the name of the day and it gives me an error in = that is within THEN : Declare @dia date = DATENAME(dw,GETDATE())--aqui obteng...
asked by 02.08.2017 / 17:07
0
answers

Dialog is repeated twice C # WPF

Good afternoon, greetings. Lately I have had a problem with sampling a Dialog in a formload, I am currently using C # in conjunction with sql server and implemented the UI of my program with Mahapps.metro. My code is as follows: private as...
asked by 24.06.2017 / 18:13
1
answer

How can I rephrase a query that uses subqueries?

I want to reformulate a query of a stored procedure that uses a series of subqueries from from . PROCEDURE RPT_MOSTRAR_ESTUDIOS(p_ndat_id NUMBER, p_nusr_id NUMBER, c_cursor OUT refcursor) AS BEGIN OPEN c_cursor FOR SELE...
asked by 13.10.2016 / 02:07
2
answers

QUERY SQL - Separate String

I am working with some queries and the need has arisen to have to stay with only a part of a field, that is, I have a field that has a final extension similar to this 13123243534.Consumo and at the same time other values in that Same fiel...
asked by 09.08.2017 / 14:52
2
answers

TSQL How can I create a field that depends on another

I have a problem in TSQL that I do not know how to do it, I explain I have to create a field that takes the date of another field and adds 3 years, is there any way to do this directly in the field without inserting it?     
asked by 13.06.2017 / 18:43