Questions tagged as 'sql-server'

1
answer

Sort result with 4 different columns

I have a table with 4 different columns, 2 of them indicating the beginning (date and time) and another 2 indicating end (also date and time). Is there a way to sort the result so that it prioritizes the most recent event? for example: If the en...
asked by 27.02.2015 / 22:50
1
answer

DISTINCT with UNION and COUNT

I'm running a query in the database to return 6 results from a Agenda table that has multiple available times per day (eg: 08: 10: 00: 000 | 08: 30: 00: 000 ) and for periods (ex: T (representing 'afternoons' or M representi...
asked by 26.11.2014 / 14:16
1
answer

sp_executeSQL for each record in a table

I have the following problem: I need to analyze the differences between two databases, based on the existing tables and columns within these tables. My idea is to get the name of the columns inside the INFORMATION_SCHEMA of each bank and base...
asked by 10.02.2015 / 20:53
1
answer

SELECT in an XML Field

I'm having trouble retrieving the value of an xml node from a field and need help ... The table structure is: --Table Pessoa Id int Nome varchar(max) DtNascimento date Xml_Detalhes XML My xml looks like this: (1) - Registr...
asked by 03.12.2014 / 14:03
1
answer

help with SQL Nvarchar

Hello, I had some problems with a code in SELECT ... example: SELECT dados FROM banco WHERE CPF='$CPF' // com o código assim estava dando alguns erros pois o bd era em SQL e o Servidor windows. The solution was: SELECT CAST(C...
asked by 12.01.2015 / 17:36
2
answers

Large images corrupted or truncated when pulling SQL server with PHP

I'm looking for images from the SQL-server database through PHP and jQuery + AJAX. The image when it is small loads everything completinho, but when the image is a little big of this error in JavaScript:    Image corrupted or truncated: data:...
asked by 04.11.2014 / 14:35
1
answer

I can not change column type - Object Depends on the column in question

I need to modify the column type of a client table, however this change will be done through a program written in VB.Net and therefore needs to be done via SQL command. The issue is that when using the command: ALTER TABLE Customer ALTER CO...
asked by 10.10.2014 / 14:00
1
answer

Is there any technique for synchronizing a structure of a SQL Server database?

I have had some problems recently in making modifications to the approval environment and for bureaucratic reasons these modifications could not be inspected in the production environment and were done wrongly, causing a delay in identifying the...
asked by 18.09.2014 / 18:38
2
answers

Error converting dates during an insert

I need to load a table in one database with data from another table and another database. It turns out that in the DateTime field is giving a conversion error because the data from the other table is in Varchar. Here's how I did it: use [Rup]...
asked by 15.08.2014 / 13:55
1
answer

SQL Server versioning integrated with the Entity Framework

In the company I worked with, I opted to create the templates from the database with Entity Power Tools . We have an online version of our application and sites for testing and development. When it is necessary to change something in...
asked by 02.09.2014 / 20:58