Questions tagged as 'sql-server'

1
answer

JDBC Java Web Connection and SQL Server 2014

I'm starting to develop a portal using JAVA Web and database in SQL Server 2014. I've never worked with SQL Server and there's a problem that I can not find the solution. Here's the problem: The connection usually happens through this clas...
asked by 31.07.2017 / 12:29
1
answer

SQL Query return records only after 2 days prior to today

Well, as a beginner in SQL, I need some help. I need only bring records that have not been moved for more than two days. The query below is bringing everyone without this condition. I even did a test using the datediff, but I'm not sure if th...
asked by 26.07.2017 / 02:31
2
answers

Query that only returns the result if one field is in another table

The title may not represent the issue well. I have a table with information about cars (id (CP), name, model, among others) and another one with the "Extras" (id (CP), car_id (CS) p> +---------------------+ | tbl_carros |...
asked by 30.06.2017 / 12:15
1
answer

Group duplicate lines Sql Server

I created the query where I have a Products table and another inventory (1: N) I need to add the stock of each product has in the inventory table, I made the following query: select DISTINCT p.ID,IsNull(p.CodigoBarra, '') As CodBarra,IsNull(p...
asked by 23.06.2017 / 02:07
1
answer

SQL - Crossing tables within tables

I do not know if the title is appropriate, but come on. I have in Table A (table of processes queried) two key fields (new_process and old_process) and I have in my table B my interest variable (new_process_process). In Table C, I have the co...
asked by 03.07.2017 / 22:15
2
answers

How to fix accent query data sql server [closed]

Good morning! Well, how do I perform the correction of data accents from a select in the sql server. For some records that were meant to come as Sergio, Sergio is coming.     
asked by 13.07.2017 / 14:20
1
answer

CPF Validation - Integration Services

I'm importing a base with CPFs for my DW but I need to do CPF validation within SSIS. Does anyone have any idea how I can do this? Thank you! edit: I was able to solve it the way I wanted it. I used the script component, I got a...
asked by 23.05.2017 / 22:16
1
answer

SQL query with SUM, displaying the return in rows [closed]

So I have a question that is consuming my insides. Could someone please tell me how to return a total of records from a query, via SUM (SQL Server) function, displaying the total of rows proportional to the number of records rather than the valu...
asked by 05.05.2017 / 23:52
1
answer

SQL Pivot function error

First question: The column that will be transformed into Line (in this case specific the header) can be repeated? I have several records that repeat, Example Column Description : I'm trying to do this: IF object_id('tempdb..#tab1') I...
asked by 09.05.2017 / 18:22
1
answer

Two databases communicate with the same model [closed]

I wanted to have one database for production and another for development to separate the actual data from the test environment data. The problem is that I have no idea how to do this. I created a clone of my development database with the "Schema...
asked by 27.04.2017 / 12:01