Questions tagged as 'sql'

3
answers

List all triggers in SQL Server

Is there a command that lists all triggers of a database in SQL Server?     
asked by 01.09.2016 / 20:11
2
answers

How does a SQL Injection happen?

Why creating parameters for each field that will be updated helps prevent SQL Injection? Example: SqlCommand comm = new SqlCommand("UPDATE Contatos Set Telefone = @Telefone, " + "Cidade = @Cidade, " +...
asked by 27.11.2015 / 16:23
5
answers

How do I know if a column exists in a SQL Server table?

I'm trying to add a new column to a SQL Server table, and I want to know if it already exists or not. I have tried something like this: IF EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'minhaTabela'...
asked by 02.02.2014 / 01:05
2
answers

How does the Where logic in the Entity Framework work?

I'm studying C # and just did my first query in the Data Bank: using System; using System.Data.Entity.Core; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace Test.Models {...
asked by 28.04.2016 / 19:42
5
answers

How to get the name of day of the week of the first day of the month?

How do I get the name (Monday, Tuesday, Wednesday ...) from the first day of December from the current date?     
asked by 17.10.2017 / 15:47
3
answers

What is the difference between Full Text Search and LIKE?

I've heard a lot about Full Text Search (FTS) lately, and they told me that I should use this instead of writing queries with LIKE . But how to use Full Text Search ? What are the advantages and disadvantages? And when is it really better...
asked by 21.03.2017 / 16:51
3
answers

How to condition the insertion of a record in SQL Server?

How can I condition the insertion of a record into a table in SQL Server using the T-SQL language considering the following rules: If the record to be inserted already exists in the table, only update the field referring to the record modifi...
asked by 12.12.2013 / 17:15
7
answers

Format decimal places directly in the SQL command in Firebird

I have a ESTOQUE table containing a field called QTDE , this field has 3 decimal places. What would be the command to return straight from SQL formatted with 3 houses? Because the whole values are returning without the houses....
asked by 31.01.2014 / 14:04
3
answers

Search for certain dates in the VARCHAR field in SQL (MySQL)

I have the following condition: WHERE sv_users.userDataNascimento LIKE '%95%'; And this condition searches on a date ( 11/12/1995 ), type VARCHAR and not Timestamp , a year ending with the numerals 95 . This numera...
asked by 16.01.2014 / 13:07
2
answers

Data type for latitude and longitude

I'm working on a new project where I need to save the latitude and longitude coordinates of an address in the database. Is there an ideal data type for this? I searched and saw some recommendations for using decimal, but I'm in doubt if it...
asked by 10.10.2016 / 15:31