Questions tagged as 'sql-server'

1
answer

"Linked Server" with MySQL

DBMS: SQL SERVER 2014 + MySQL 5.5 What are the SELECT, INSERT, and UPDATE syntax instead of using the "OPENQUERY" function, when connecting through the SQL Server Linked Server, connecting to MySQL?     
asked by 06.06.2014 / 14:17
1
answer

Doubt - SQL Server Query Condition

Galera, in the query below is bringing as follows. But I want you to bring only the 'YES'. The difficulty is because it is a subselect with case. I bring you where? No where or a having? How would it be more or less Current Result Client...
asked by 10.05.2018 / 13:48
1
answer

compare and sum in sequence with sql server

I want to add the col3 fields by checking that the col2 value is the same as the following by doing a sequential group by. col1 col2 col3 ind seq1 5 ind seq1 3 ind seq1 7 ind seq1 4 ind seq2 5 ind seq3 1 ind seq3 3 ind se...
asked by 17.03.2017 / 19:32
2
answers

SQL: Doubt in Relationship between Tables

I'm creating an academic system that consists of a virtual restaurant menu type, so I've created three tables in the database: Menu Items Table: CREATE TABLE ITEMS( ID INT PRIMARY KEY NOT NULL, NOME VARCHAR(20) NOT NULL, DESCRIC...
asked by 05.09.2017 / 13:48
1
answer

Error converting from varchar to smalldatetime

In the query below the following error occurred:    Converting a varchar data type to a smalldatetime data type resulted in a value out of range. By analyzing, I realized that if I take out the dbo.FN_CALC_HORAS_UTEIS function, it...
asked by 13.09.2017 / 15:19
1
answer

How to display 2 DB tables within a DataGridView in the application?

I have an application developed C# using the Windows Forms project that displays the Database People Table in a list in the DataGridView field. However I need to display in the DataGridView also the Endereco ta...
asked by 16.08.2017 / 13:08
0
answers

What should I worry about when creating a partitioned table in SQL Server?

It was suggested to partition the main table of my system to improve the performance of some queries. The dev that made the suggestion suggested using the ano registry information to partition, because as the system has not been runnin...
asked by 09.03.2018 / 17:05
1
answer

How to get a column in the database, perform a calculation and send to grid

I want to perform a calculation using the value of the field VAL_VIDA_UTIL of my BD and then save the result from calculation in a new variable VAL_DEPRECIACAO and pass to my fieldName, but I am not succeeding. Could someone help me? My code...
asked by 12.07.2016 / 13:31
1
answer

How to show result between 3 tables?

I have these three tables; table_1 |---------------------| | ID1 | name | |---------------------| | 1 | 'xxxxx' | | 2 | 'xxxxxx' | | 3 | 'xxxxxxxx' | | 4 | 'xxxxxx' | |...
asked by 21.03.2016 / 15:21
2
answers

Create a script to check if the table has a primary key

I need to create a script to check if a table has primary key , if it does not, it is added to primary key . I found this form to do the script, I did not understand where it takes the name of this table "INFORMATION_SCHEMA.TAB...
asked by 26.11.2015 / 18:06