Questions tagged as 'sql-server'

1
answer

Parameters for encrypted columns

I'm trying to create a procedure to save a user's data to the SQL SERVER database, however the table has columns encrypted with always encrypted, resulting in a conflict error. I have tried to change the type of parameters for varbinary etc,...
asked by 18.11.2018 / 21:25
3
answers

Doubt with GetDate ()?

I'm having an SQL query that should bring me only the records whose date is greater than the date of the day, plus is coming records with the current date. Thanks! --não deveria mostrar a data de hoje select a.datavencimento from TB_RECEB...
asked by 28.04.2015 / 22:35
1
answer

What's the difference between Cast and Convert?

In a Transact-SQL book (Ramalho Series) it is said: CAST AND CONVERT    Implicitly converts one expression from data types to another.   CAST is a synonym for CONVERT. What do you mean by CAST is synonymous with CONVERT? What is the us...
asked by 21.06.2017 / 13:58
1
answer

How to concatenate date in sql server

I have a field where the date and time is saved: '2013-06-13 00:00:01' and '2013-06-13 11:59:59' I want to make an appointment by passing the date and a fixed time: CONVERT(VARCHAR(10), CAST(getdate() AS DATETIME), 111) + '00:00:01' and...
asked by 04.10.2016 / 20:09
1
answer

Use of Time with EF 6

I have a class with the following property. public TimeSpan TempoIdeal { get; set; } Estou atribuindo esta propriedade com TempoIdeal = new TimeSpan(days: 3, hours: 15, minutes:10, seconds: 0); When trying to insert I g...
asked by 23.06.2016 / 05:39
1
answer

How to determine permission to use tables?

How can I make a certain user "see" some tables and another not? I've been searching, I found DENY SELECT ON *** but I did not succeed.     
asked by 08.04.2014 / 13:33
1
answer

Remove Duplicate Space in the Middle of the String

Hello, I need to remove duplicate spaces in a string and leave only 1, identical to the Excel sort function. How to do this in sql?     
asked by 11.04.2016 / 16:20
2
answers

verify that multiple fields are created in the database

A further 7 columns have been added to a table, but you must first check if this column is in the database, otherwise you should not run the column creation script. Is it possible, in a single condition, to check whether the columns have alre...
asked by 25.08.2015 / 15:57
3
answers

SQL query in PHP and date format

I have a function in PHP that interacts with my SQL Server. It looks like this: public function buscaRelatorioHospedagem($nome,$de,$ate){ // TODO Essa função pode ser aproveitada pra aba nova $de--; $de++; $ate--; $ate++;...
asked by 25.05.2015 / 21:09
1
answer

Create trigger within a procedure?

I would like to know if it is possible to create a Trigger within a procedure? (SQL SERVER) The reason is that I drop the table that is triggered at the end of the day, and then recreates it with a procedure, and after creating the table, it...
asked by 03.09.2014 / 19:24