Questions tagged as 'sql'

1
answer

SQL statement charindex

I have created a sql statement that traverses a string and generates columns with data. CODE: select p.FK_workitem, p.numero_sd, p.PARRAFO, LTRIM(substring(p.PARRAFO, 0, CHARINDEX(':', p.PARRAFO))) Tipo,...
asked by 27.12.2018 / 01:12
1
answer

Problem when extracting data from a weak entity with a foreign key in MySQL

I have a small problem when trying to extract all the data of a weak entity that I have created between a table called Doctor and another patient. When I do the query, I extract the data correctly but in triplicate, that is, instead of returning...
asked by 26.12.2018 / 14:39
1
answer

Error creating a Trigger

I'm trying to create the following trigger: DELIMITER // CREATE TRIGGER 'smdraux_after_insert' AFTER INSERT ON 'smdraux' FOR EACH ROW BEGIN IF(LENGTH(NEW.llamante) = (4) AND NEW.nombreinterlocutor1 NOT LIKE 'VM Channel%' AND NEW.nombreint...
asked by 02.01.2019 / 17:58
1
answer

How to add rows by code to a DataGridView that is filled with a query to a BD

I have read several open cases of this type but I do not really see one that fits my case. Well I raise my case; I have a DataGridview which, by consulting the BD, I filled it and I want to add rows through TextBox that are in the same form....
asked by 16.12.2018 / 02:17
1
answer

Query Excluding duplicate records in SQL

I have a query in SQL server: SELECT [nIdLogTG] ,[nUsuario] ,[nConsDetalle] ,[nConsDoOrigen] ,(case when a.cCodigoComplementarioDo IS NULL THEN b.cCodigoComplementarioDo ELSE a.cCodigoComplementarioDo END) AS Cod...
asked by 18.12.2018 / 22:13
1
answer

SQL close date

Along with saying hello and thanks for this space, I ask for help with the following. I have two tables .. the table1. is a historical sales record with the fields fecha_vta, código_producto, cantidad. in the other table I have the variation of...
asked by 05.12.2018 / 17:01
1
answer

Oracle REGEXP_SUBSTR to SQL Server?

I want to convert the following to MS SQL Server : REGEXP_SUBSTR(m.DESCRIPTION,'CATEGORY=([^,]*)(,|\Z)',1,1,'c',1)     
asked by 17.10.2016 / 19:15
1
answer

Error in query when creating tables with foreign keys in SQL Server

I am executing a query with C # and I get the following error .. This is the query that I'm executing, something fails, I do not know why, it still is not good sql ... CREATE TABLE Empresa( id_empresa int IDENTITY(1,1) NOT NULL...
asked by 21.03.2017 / 17:31
2
answers

Bring data from the table using an ID

Please, I need your help with this. I have this table in the view: What I need is that in the ID column I get a list to select the IDs that I have in this database, and when selecting an ID I load the item and the unit price in the view...
asked by 06.12.2018 / 00:23
1
answer

show last record of a table in c # with sql server

What I try to do is capture the last code that was entered from my table in sql and show it in my txt that is in c # try with this code but it did not work for me I hope your help SqlConnection con = new SqlConnection(ConfigurationManager.Co...
asked by 26.11.2018 / 06:43