Questions tagged as 'sql-server'

2
answers

How to select the foreign key id in the main table? [duplicate]

public List Select() { List ListaCaminhao = new List(); SqlConnection conexao = new SqlConnection(strCon); string sql = "Select * from Caminhao;"; SqlCommand cmd = new SqlCommand(sql, conexao); conexao.Open()...
asked by 31.03.2016 / 14:31
3
answers

Get value of a variable in Sql Server

I have this Sql block: SET NOCOUNT ON; Declare @QueryString as NVarchar(4000), @Datazero as varchar(20), @Datamn as varchar(20), @CdUsuario as integer, @SitProcesso as int ,@DsUsuarioRede varchar(20) ,@Processo as int...
asked by 10.03.2015 / 15:21
1
answer

FOR in php and sqlsrv

I have to make a FOR in PHP using SQLSRV. I'm using the penultimate version of PHP and not the last one, as I can not update PHP.     
asked by 05.11.2014 / 17:32
3
answers

How to generate SQL in relationship table without repeating values?

I have the following scenario: Tables: Video (id, url) VideoCategoria (id, id_video, id_categoria) Categoria (id, descricao) I need to get the last 120 categories that have received videos. At the same cursor I wanted the following fields:...
asked by 23.09.2015 / 15:27
2
answers

PHP how to get image, in direct hex format from MSSQL?

I'm doing a system with PHP and I've already been able to put a word image or file directly inside MSSQL , SQLSRV , without needing put them in a folder, but I can not fetch them and display them in the normal format. Does anyone know how I...
asked by 08.10.2014 / 15:25
2
answers

How best to insert an array into the database

I would like to know how to insert an array into a table in the database. I could use a foreach but I would like something performatic because I will work with a large number of data. foreach (var item in registros) { s...
asked by 07.04.2015 / 22:54
2
answers

UPDATE with two conditions

I would like to make a UPDATE where I have two conditions; wanted to put the two together in one, if not one is the other. FIRST: UPDATE RLT005 SET CtrDatBaixa = '2018-12-15 00:00:00' WHERE CtrDatBaixa BETWEEN '2018-12-15 00:00:00' A...
asked by 17.12.2018 / 18:53
1
answer

Passing an Array of Strings to a preparedStatement?

I'm trying to pass an array of Strings to a preparedStatement , but it's returning this exception: java.sql.SQLFeatureNotSupportedException: This operation is not supported. at com.microsoft.sqlserver.jdbc.SQLServerConnection.create...
asked by 04.07.2017 / 00:29
2
answers

Foreach in SQL to put a value in a variable

My problem is that I have a subquery that works perfectly, but for this I have to insert the id I want in the variables. In the @mediaKM_mes variable I select the tbl table by car id; in the @km variable I select the table tblCar by the car i...
asked by 11.07.2017 / 01:05
1
answer

Python Error SQLACHEMY

It is giving an error when I try to connect to the SQL SERVER database with SQLALCHEMY from sqlalchemy import create_engine, engine import pandas as pd engine = create_engine('mssql+pyodbc://User:password@server:1433/Bases_testes?drive=SQL+Ser...
asked by 28.10.2018 / 16:22