Questions tagged as 'sql-server'

1
answer

Select with exception of values (SQL / Oracle)

I need to improve this select that already exists here to perform a query where the ICCIDs started by 8995 are not returned, but I do not have much knowledge of the database. How can I change this select? I use SQLDEVELOPER, however the clien...
asked by 08.06.2015 / 17:06
1
answer

Problems with passing values asp.net C #

I have a problem, when I assign the return from query to a variable of type object it passes as null . I have other identical methods and they work right, only the one that is not happening the right value. I was able to see...
asked by 03.06.2015 / 21:04
1
answer

How to merge lines?

How can I merge two or more **Linhas x Coluna** of the query below? select cast(OS.CreateDate as date) as DtMovimentacao, OS.Id as NrOS, OS.Description Origem, OSI.Description as ItemSaida, OSI.Quantity as QtdSaida, OSE.Description, OSE...
asked by 04.12.2015 / 17:43
1
answer

Can I execute any query in SQL Server without passing the credentials, is this normal?

I was looking to restart the SQL Server service, that's when I discovered a way to manipulate the database without logging into the system. See: Open Management Studio. Icanceledtheauthentication. 3.AccesstheViewmenu>RegisteredServers.No...
asked by 07.09.2015 / 00:31
2
answers

How to get date and time in different columns through a select Sql server?

I'm having a problem filtering a query under the following conditions: I have the Date field and I have the field time both in varchar, when I try to do the query like this: ex: select Serial, Latitude,Longitude,Data,Hora from [CheckPoint...
asked by 20.04.2015 / 14:58
1
answer

Show only positive delay days in SQL query?

I am making an appointment where I want to calculate the number of days of delay in a due date, I would like to show only if there are days of delay, at the moment I am showing days that are not due for expiration, which should have been zero....
asked by 20.04.2015 / 21:15
1
answer

Error: There are no primary or candidate keys in the referenced table

I'm trying to create a new table in an existing DB, however, the following message appears:    There are no primary or candidate keys in the referenced table   'match_contact_current' that match the referencing column list in   the foreign ke...
asked by 09.03.2015 / 15:04
2
answers

How is crud to update records in SQL Server by Visual Studio C #?

I'm using this code, it does not error, but does not update the data public static int attLoja(LojaVirtual loja) { int resposta = 0; using (OdbcConnection conexao = ConexaoPadrao.CreateConnection()) {...
asked by 25.05.2015 / 19:17
2
answers

Bring a field, by MAX (ID)

How do I bring up any field, by the largest ID of the table. I made a MAX (Field1), Field2 and had to do a grouping by Field2 and the result it brought me several Field2 and not just one that has the largest ID. Select MAX(ID), campo2 from tab...
asked by 09.02.2015 / 14:46
2
answers

How to create a database in SQL Server?

I installed SQL Server, and here comes Magnament Studio, how do I create my bank? I already tried going there, and I had to authenticate for Windows but it gives an error. How do I create my bank?     
asked by 02.02.2015 / 04:42