Questions tagged as 'sql-server'

2
answers

Calculate length of a SQLServer field

Hello, I have a table in SQL with the word column and a WordSize column, I was wondering if I have any way to register the word in the database and execute a function that calculates the amount of characters in this word to save in the WordSize c...
asked by 13.11.2016 / 20:55
1
answer

Precision scale using Entity Framework and SQL Server

I have noticed some strange time saving values double in the SQL Server database with the Entity Framework. I noticed that when reporting a value ex: 12.23 after saving the information is breaking the decimals in more houses ex: 12.225...
asked by 08.08.2016 / 22:22
2
answers

What is the best way to read a SQL error return?

What is the best way to read a sql server error return in a C # web form application? I have the following .. No sql server; END TRY BEGIN CATCH Raiserror('Erro ao gerar os dados', 18, 1); return; END CATCH; No c # SqlCom...
asked by 29.10.2015 / 19:12
2
answers

Azure Shared Application Service

Good morning everyone! I am developing an entertainment portal where you will have images and text (eg Earth or UOL) using ASP.NET and sql-server. I was analyzing about Azure and I had a question: Is the shared application service similar to the...
asked by 30.04.2016 / 16:01
2
answers

How to get data from two tables in the same column?

I have two tables in the database: Tabela1 Id Nome Sexo 1 NomeA Macho 2 NomeC Fêmea Tabela2 Id Nome Sexo 1 NomeB Macho 2 NomeD Fêmea I would like to have the following re...
asked by 30.07.2015 / 18:54
2
answers

Left join returning more records

I have a main table with about 5,000 records, and I need to fetch information from another table with 7,000 records. But my query is returning +6000: SELECT principal.id, info.nome, info.endereco, principal.valor FROM principal LEFT JOIN in...
asked by 30.12.2014 / 15:02
4
answers

Difficulty with MSSQL and PHP on CentOS 6 server

I can not run a PHP system on the server (CentOS 6). When I try to connect to an MSSQL database the following error appears: Call to undefined function mssql_connect() In my localhost it works normally. The PHP version on the server is 5.4...
asked by 15.09.2015 / 18:12
2
answers

return of decimal places in sqlserver queries

In the query below I would like to return only 3 boxes after the comma for the columns: size in mb, availablespaceinmb As for column available, I would like to return with no decimal places after the comma. How can I do this. SELECT rtrim(n...
asked by 28.10.2014 / 20:32
3
answers

How to return the last id inserted in the table?

I need to get the generated id, in the last and recent insertion made in a table in SQLSRV, Mssql, using PHP. I'm already connecting to the bank, using the sqlsrv driver. $sql = "INSERT INTO [RDO].[dbo].[ANALISE_CRITICA] (CC, NMANALISE, TXTOB...
asked by 21.10.2014 / 17:34
1
answer

How to configure an existing field for auto-increment?

I would like to set the id field already created as auto-increment, because I created the table and did not put this option for it, how could I do this?     
asked by 25.02.2016 / 15:53