Questions tagged as 'sql-server'

3
answers

How can I make a copy of multiple tables in a new table using SQL SERVER?

I have several tables with the same number of columns. and I want to insert the records of these tables into a new table. Anyone have an idea? because I could only insert one and not accept the rest of the tables that I have. select * from DA...
asked by 05.10.2017 / 21:58
2
answers

Error trying to remove a temporary table [closed]

I have a service where you load data from an ERP into a DW. Because the data source is SQL Server 2008 R2 10.50.1600.1 and the destination server MS SQL Server 2008 10.0.5512.0 SP3. The service executes a stored procedure that generates tem...
asked by 18.01.2016 / 13:26
6
answers

Convert varchar to date in SQL

You can convert dates to varchar for date . I'm having difficulty performing cross-date searches because of this discrepancy in the database where I query. When I enter my line of code: select * from TAB_FATURAMENTO where cd_...
asked by 01.06.2017 / 13:55
3
answers

How do I get the current month and year in SQL?

How can I print on the screen the current month and year in sql? I need the month to come out in full. I'm using the query below. select GETDATE() from DUAL It is currently being printed as follows. 2018-08-21 10: 34: 03.253 I need it...
asked by 21.08.2018 / 15:38
2
answers

How to perform a Where using Entity Framework

I have a web application that needs to present a list containing some data, for this, I created the Model: Crm_Analise : public class Crm_Analise { [Key] public int id { get; set; } public string cod_item_CRM { get; set; }...
asked by 12.07.2017 / 21:02
3
answers

multiple values for a column in Where

Is there any way to put multiple values for a column in WHERE ? For example product A has been replaced by product B, product 2933 by 4044, the product 2599 by the 7845, and the product 5987 by 9432. Example: where DepartureDate...
asked by 20.06.2017 / 19:35
2
answers

Left Join in SQL

SELECT SUM(TAXAS) FROM DOCUMENTO LEFT JOIN PARCELAS PARCELA IN (PARCELA.CODE = DOCUMENTO.CODE) WHERE PARCELAS.FATURADAS = TRUE I'm getting a syntax error that I can not resolve     
asked by 17.04.2018 / 19:03
1
answer

Connecting to the database with App.config

How to establish a connection to the Northwind database using App.config and ADO.Net?     
asked by 27.06.2014 / 02:48
2
answers

SQLServer Trigger after update

Let's imagine the following scenario: CREATE TABLE invalido ( ds_valor character varying(255) ) CREATE TABLE email ( email character varying(255) ) I now need a trigger that every time I run a UPDATE or INSERT i...
asked by 30.11.2016 / 14:23
2
answers

How to get the number of columns in a temporary table

How can I get the number of columns in a given temporary table in the sql server ?     
asked by 27.04.2018 / 15:27