Questions tagged as 'sql-server'

1
answer

Error in FK when running Migrations in C #

I have the following scenario public class branch() { public Branch() { Branchs = new HashSet<Branch>(); } [StringLength(80)] public string Description { get; set; } [Required] [ForeignKey("TypeDeliv...
asked by 19.06.2017 / 18:58
1
answer

Error when using SqlCommand and foreach

I'm trying to navigate a list of objects and persist their data in SqlServer: foreach (var item in pedidos) { cmd.CommandText = "INSERT INTO MinhaTabela (Coluna_A, Coluna_B, Coluna_C) " + "VALUES (@Val_A, @Val_B, @Val_C)"; c...
asked by 20.11.2017 / 13:54
1
answer

Access SQL Server database via CMD

In Oracle I know how to access and execute queries through sqlplus in CMD. Does anyone know if SQL SERVER also has a similar command?     
asked by 06.06.2017 / 21:13
1
answer

PHP Slow - Code or Hosting? [closed]

I'm having frequent problems with PHP, maybe because I'm creating it in a "simple" way, or would it be my hosting that is basic? I use the Hosting Plan I of Locaweb. I am creating a system that will do two SELECTs in SQL Server, picking up...
asked by 10.07.2017 / 17:44
2
answers

Procedure sql server 2012 + java

I want to structure an INSERT using JAVA in the same way that the INSERT is structured in VB .NET. Here's the code in VB .NET: Const _spName = "dbo.MEJT_SP_CAD_PRODUTOS" Public Function IncluirProduto(produto As MEJTProdutoEnt) As Integer...
asked by 16.10.2017 / 22:35
2
answers

Return values smaller than 10 of a column with DateDiff

I need to return values less than 10 in a column with DATEDIFF and others between 10 and 20 in the same column. Can anyone help me? SELECT CONVERT(VARCHAR(10), (MAX(REMESSA.DT_USO_FIM)),105) AS DATA_DEVOLUÇÃO ,DATEDIFF ( DAY, MA...
asked by 10.04.2017 / 20:48
1
answer

SQL query to return only if upper case

I would like to make a query in a column and that the return would be only the capitalized words that match the searched criteria (user input), regardless of whether the criteria was typed in uppercase or lowercase. CREATE PROCEDURE uspConsult...
asked by 26.03.2017 / 22:23
1
answer

How to return multiple rows with byte array from sql Server

I need to make a query in a table where the data is of type varbinary(max) , so I created the method below: public List<byte[]> preenche_fotos(string nCrm) { consql.bd_string(); SqlConnection sqlconn = new SqlCo...
asked by 11.05.2017 / 02:32
2
answers

How to configure the Connection String in App.config?

I would like to mount using the saved string: InstanciaSQLServer , UserSQL and PWSQL , is it possible? Example of my app.config <configSections> <sectionGroup name="userSettings" type="System.Conf...
asked by 11.05.2017 / 13:28
1
answer

Entity Framework 6 - Migrations - Add column with default value and name constraint

I want to add a column of type BIT to an existing table with a default value of 1 via migrations. The challenge is ... we have in the company a default for the name of constraints and it is not legal the name automatically c...
asked by 26.05.2017 / 21:02