Questions tagged as 'sql-server'

1
answer

How to perform restore of only 1 specific table in SQL Server 2012

Good afternoon! I have a following situation: I have a database backup and the server has already created a database with this base called test, however, I need to migrate a specific table that is in this test base to another database called...
asked by 04.09.2017 / 21:43
1
answer

Division of tables with Count and Sum

I'm working on a query where I have some sums and counts, and in some places I need to divide it into a table that I added or counted, for example: COUNT(M.ID_MAILING), SUM(CASE WHEN SS.IS_APPROACH = 1 THEN 1 ELSE 0 END) I need to divide th...
asked by 18.08.2017 / 12:48
1
answer

Select data from the last file in the database and select file data from the previous time to the last one. Compare Data [closed]

After fetching two uploaded files, I go in the table to compare the data inside them Between 8: 50 e 23: 50 (with interval of one in an hour) it performs a check in a file of that bank that I call Time Search with the established Stand...
asked by 07.08.2017 / 15:25
1
answer

Android Studio, CRUD in SQL Server 2008

I am making an application in the company where I can do registration of condominiums and visitors of the place. I am making a connection to the SQL Server 2008 database quietly, but I can not do the CRUD in the application. I made the Add tes...
asked by 14.08.2017 / 21:42
2
answers

Connect to SQL with AppConfig

How can I make a connection to SQL with the connectionstring in AppConfig? I did this, but I wish it could be by AppConfig, how can I do it? private void button1_Click(object sender, EventArgs e) { string connectionString = @"Da...
asked by 21.09.2017 / 16:24
1
answer

Not bringing records - SQL Query

Good afternoon! Galera, below is the query that is to bring the number of active clients in one column and the number of clients blocked in another column, but when executing the query, it is null in both columns. NOTE: When executing the sep...
asked by 21.07.2017 / 20:42
1
answer

SQL in php script

SELECT CAST(REPLACE(CAST(DsXML as Nvarchar(Max)),' xmlns="http://www.portalfiscal.inf.br/nfe"','') as xml).value('(/nfeProc/NFe/infNFe/transp/vol/qVol/node())[1]', 'int') as [qVol] FROM SPDNFE WHERE CdIdNFe = 'NFe131612039761410001325500300004352...
asked by 08.08.2017 / 14:39
1
answer

SQL query error in PHP

I came across a sql error, but when I run the query in SQL Server Studio it returns the normal query. Query that is below. SELECT CAST(REPLACE(CAST(DsXML as Nvarchar(Max)),' xmlns="http://www.portalfiscal.inf.br/nfe"','') as xml).value('(/nfeP...
asked by 08.08.2017 / 15:09
1
answer

Error - Query: The subquery returned more than 1 value

I'm new to SQL and I have the following error in my query: "The subquery returned more than 1 value. This is not allowed when the subquery follows a =,! =, & lt ;, < =, & gt ;, > = or when it is used as an expression ". The query is this:...
asked by 14.07.2017 / 14:16
1
answer

Select with several Left Joins

I made a LEFT JOIN considering as attributes ( CPF , TEL1 , TEL2 and TEL3 ). Why all these? Because the CPF field often returns zeroed on one of the bases, so I'm considering the phone fields as well. As...
asked by 06.07.2017 / 22:17