Questions tagged as 'sql-server'

1
answer

Trigger Sql Sever

I have a database with two tables: Category and Team, the relationship between the tables goes like this: a category can have many teams. I have created a trigger so that at the moment of inserting a team a quantity field of the category table i...
asked by 03.03.2018 / 04:55
1
answer

SQL Server PHP PDO exception: could not find driver

I am trying to connect to a database in SQL Server 2008 from Yii2. My version of php is 5.6.31 This is my configuration file in db.php return [ 'class' => 'yii\db\Connection', 'dsn' => 'mssql:host=127.0.0.1;dbname=softw...
asked by 01.03.2018 / 07:15
1
answer

Null value when trying to get data from another object

I am working in a real estate portal and I have in a table inmueble the type of property (understand "housing", "local", among others) when loading a property returns the data found in the database less the type of property which is in an...
asked by 24.02.2018 / 21:58
1
answer

In clause where does not discriminate a subtraction

Hello, I have the following query. It is quite extensive but it is more or less like this Select CantidadEmpacada, CantidadFacturada FROM PedidoEmpaque WHERE (CantidadEmpacada - CantidadFacturada) > 0 throws me 2 rows but when the su...
asked by 12.03.2018 / 15:24
2
answers

Remove the first name from each SQL SERVER office-box

Good, I have a little problem to see if you can help me. I start from the following query SELECT Caja, Oficina, DNI, NombreCompleto, Importe FROM miTabla WHERE Importe > 50 and Caja LIKE '0%' What they ask me now is to group it so tha...
asked by 01.02.2018 / 12:41
2
answers

Limit INT data types (only positive)

Good afternoon. I was searching the internet and found nothing. What I want to do is to limit all the INT fields to accept only the positives. Is there any SQL function to do this? You could put an IF that validates that, but I do n...
asked by 05.02.2018 / 18:56
1
answer

I have problems in my laravel 5.5 project

This error appears:    SQLSTATE [42S22]: Column not found: 1054 Unknown column 'clients.deleted_at' in 'where clause' (SQL: select * from clientes where clientes . deleted_at is null) Generate my controllers and...
asked by 07.02.2018 / 17:28
2
answers

Stored procedure to delete data in referenced tables

I need help with a stored procedure that allows me to delete a column in the usuarios table and when this column is deleted, delete all the data where it is used as primary key its id , the table that inherits from usuarios i...
asked by 07.02.2018 / 19:59
1
answer

Another way to save files without xp_cmdshell SqlServer 2008

Good morning classmates, I need your help, I have a storedprocedure where a select is executed and the information obtained from that query is printed and saved as a .txt file in a specific route by means of the command...
asked by 02.08.2018 / 18:55
1
answer

SQL - Master in same table with default value - Return the different values

I would like to know how (and if it can be done) in the same query, as long as the following SQL server query is efficient: I have a single table with the following fields: Id, CorporationId, Name, Value. In this table there are some "mast...
asked by 19.02.2018 / 23:02