Questions tagged as 'sql-server-2014'

1
answer

Doubt to Load ComboBox from an account with the subaccount

I made a select to fetch an account and load the sub account and would like your opinion to see if this is how it does if it is correct code private void cbbConta_SelectedIndexChanged(object sender, EventArgs e) { PlanoCont...
asked by 20.08.2015 / 15:32
1
answer

How to merge two results into a query conditionally

Talk, guys! Would anyone know how I can use a UNION ALL conditionally? Example: DECLARE @cond INT = 1 SELECT * FROM table1 IF(@cond = 1) BEGIN UNION ALL SELECT * FROM table2 END The idea is this but this does not work. How coul...
asked by 06.09.2018 / 04:35
0
answers

Get the percentage between 2 in a Dynamic SQL query

Good afternoon I'm trying to get the % between months compared to the year after, so in month 1/2016 value was 2115.00 month 01/2017 value was 3511.00 take the percentage between these 2 and make the margin / percentage the...
asked by 29.08.2018 / 17:26
0
answers

WHERE failed to associate a column to query in a view

I'm passing some parameters to a view where I need to get the return of this query. When defining the filters in the Where of my query, the query return reports the following error:    Invalid 'competition' column name. I know it's my cod...
asked by 10.07.2018 / 20:22
0
answers

Query schedule in sql

I have the following problem, I will receive a bank with "x" available positions in several specialties and another with "y" patients requesting those specialties follows the model of the tables below, would have to elaborate a query that would...
asked by 13.05.2018 / 00:08
1
answer

SQL Server Create a filter in a DateTime field, bringing the previous 24 hours (not counting the current time)

Good evening, I'm having trouble putting a date filter, I have a query where I bring the information of CD, Crane and DtRegister (datetime) In this query I am already filtering the 24 hours between the current day and 24 hours before, GRU_DT_R...
asked by 07.08.2017 / 03:16
1
answer

Update and maintain update code when it is repeated

I've made this update: declare @rx_num varchar(20), @id_oit_max int, @id_exm_rea int, @id_xfc_novo int, @id_xfc int = 0 declare oit_cur cursor for select pl.rx_num, er.id_exm_rea, er.id_xfc from t_cmo_planilha_leitura pl inner join T_CMO_EXA...
asked by 26.04.2017 / 23:39
1
answer

Condition (if) does not work to insert data

I made this query to insert data. I should only enter data if there is nothing in the OIT1980 table. Then I mounted a cursor and ran and put an IF. If I remove the IF, it works, but if I leave it there, I do not know if the way I compare is corr...
asked by 24.04.2017 / 21:03
1
answer

SQL Server 2016 Msg 3169 How to solve restore Sql Server 2016 to 2104 with compatibility mode 110

SQL Server 2016 Msg 3169 How to solve Sql Server 2016 to 2104 with compatibility mode 110. Error: Msg 3169, Level 16, State 1, Line 38 The database was backed up on a server running version 13.00.4001. That version is incompatible with thi...
asked by 22.04.2017 / 21:07
0
answers

Error trying to connect sql server 2014 with hibernate-core 5.2.7 Final

I'm learning java with hibernate. I'm using maven to manage the project. I get the following error INFO: HHH000206: hibernate.properties not found as below in the image (click on the image to get bigger). Theerrortracestackisthisaquijava.l...
asked by 13.02.2017 / 02:14