Questions tagged as 'sql-server'

2
answers

How to check WHERE clause with apostrophe in a DELETE operation?

I need to delete a record, but in the WHERE clause one of the data has an apostrophe. How can I check this information, because it is obvious that it will give error. DELETE FROM IES WHERE IDENTIFICACAO ='456' AND ESTADO='SP' AND MUNICIPIO='SA...
asked by 07.08.2014 / 22:51
3
answers

how can I insert multiple rows once only using Sql?

I have exported a data record from Sqlite to Sql Server with Dump. I need to get these records and insert inside a new table that I have created to receive these records inside my database on the Sql server. The problem is that I have many rows...
asked by 25.08.2017 / 19:22
2
answers

Export SQL Server Database 2014

I need to export the SQL Server database to send to a friend. But I'm not getting it, I wanted to know if I copy these files and send them to him, if it will work on his SQL Server (I do not know what version of it). C: \ Program Files \ M...
asked by 07.10.2015 / 04:28
2
answers

column with accentuation invalid [closed]

I am putting together a report using a system database and PHP with DBLIB, but whoever structured the database created the tables and fields with accentuation. When I'm going to do a query in some field that does not have accent the query works,...
asked by 26.01.2017 / 19:31
2
answers

How to restore a database backup from an application in C #?

I've been looking into how to restore a BD backup through a C # application, but I had a hard time understanding logic. I have already programmed a form that does the backup and I do not have and idea of how a restoration would work, for...
asked by 21.11.2016 / 17:43
1
answer

Erase older duplicate data in MS SQL server

I have a problem in a table that has duplicate data. The duplicate data is identified by an ID, where each line has the identifier and a date, how can I delete all the data with more than 1 record from the table, leave only the most recent recor...
asked by 04.02.2018 / 15:00
2
answers

Concatenate SQL Server

I have the following query: SELECT UPPER(admatribuido) AS [admAtribuido], Count(admatribuido) AS [quantidade_admAtribuido] FROM ##tmp WHERE Month(dataabertura) = Month(Getdate()) AND Year(dataabertura) = Year(Ge...
asked by 18.01.2018 / 16:40
1
answer

Group by with error in SQL Server

Good morning, I would like to know why my SQL query is not working, I'm using SQL Server 2008 and my GROUP BY is going wrong. I already checked and the table names are correct and are filled correctly. Code: SELECT categoria, nome_ca...
asked by 07.06.2016 / 14:45
1
answer

Warning: sqlsrv_fetch_array () expects parameter 1 to be resource, boolean given in D: \ xampp5.6 \ htdocs \ sysriomed \ bank-material.php on line 27

I am making a form for editing materials (products). I'm viewing the bill of materials and I created on my form a button that passes my IdItem . I'm wrong:    Warning: sqlsrv_fetch_array () expects parameter 1 to be resource,   boolean...
asked by 26.10.2016 / 18:11
1
answer

Query returning unwanted result

In my sql statement: SELECT DISTINCT C.TABLE_NAME,C.CONSTRAINT_NAME,C.COLUMN_NAME FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE C INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS T ON T.TABLE_NAME = C.TABLE_NAME WHERE C.TABLE_NAME = 'VALOR_...
asked by 04.11.2016 / 18:33