Questions tagged as 'sql'

1
answer

Use the Execute block in SQL

Is there a way to find two fields (in different tables), compare them and if they are different to perform an update? Could you give me a brief example if there is any way, using EXECUTE BLOCK .     
asked by 15.06.2015 / 15:47
1
answer

Shortcut to Ident Query Sql

Good afternoon everyone! Is there a keyboard shortcut that indentifies SQL Query and leaves the code organized? In the Database.Net application the command is Ctrl + M If anyone knows please let me know, today I work with SSMS and I use...
asked by 21.12.2018 / 17:00
2
answers

SQL query with 2 subselects for query lambda (or linq)

select fieldA from TableA where fieldA = 459249 and fieldB in ( select FieldC from TableB where FieldD in ( select cte.FieldE from TableC cte where key= 'ABDC123' ) ) I got to the point below, the pr...
asked by 11.07.2014 / 17:56
1
answer

Primary key field from int to bigint

Well I need to turn my primarykay fields from int to bigint, but it's giving a problem. Here is the code below: Executing SQL script in server ERROR: Error 1025: Error on rename of './DB_ATOS542/#sql-b4b_210' to './DB_ATOS542/tbl_PESSOAS' (err...
asked by 02.12.2015 / 18:01
2
answers

Database maintenance c #

I have a system in another language and need to create an updater for this system, however it needs to be run scripts in MySQL for the maintenance of the database. I searched Java and found Maven that has all this maintenance control and read...
asked by 23.10.2017 / 19:40
2
answers

How do I save the DropDownList's SelectedItem value in the database?

I want to register a client and one of their attributes is sex Database: sex attribute is nvarchar ASP.NET: I'm working with a listview to insert client data <asp:SqlDataSource ID="clientes" runat="server" ConnectionString="&...
asked by 19.02.2015 / 11:43
2
answers

Simple log editing with PHP + MySQL

Basically the three scripts should edit a record in the Database: records.php: <?php // Aqui você se conecta ao banco $mysqli = new mysqli('127.0.0.1', 'root', '', 'login'); // Executa uma consulta $sql = "SELECT 'user_i...
asked by 26.02.2015 / 20:40
0
answers

SQL Procedures: can I use a table as a parameter for a procedure?

I am a beginner in procedures. I'm trying to insert data into a table using a procedure, where I get the name of the table, the names of the columns, and their values. How do I get the data types I want, such as a table or a column? Am I th...
asked by 13.09.2018 / 10:13
1
answer

How to bring only a certain part of a text in a field

How do I bring only part of the text in a field in the sql server? I have the query below that in the Description column, it returns a text with lots of information, for example. Nome Cliente Data do ultimo Tramite Descrição Teste...
asked by 27.07.2017 / 13:48
3
answers

Filter a select, without duplicate SQL queries being returned

The problem is to return a SELECT with only the schedules that have not already been accepted by the user. I am trying to use the table of schedules that have already been accepted, which have both the user ID and the scheduling it has accepted...
asked by 29.09.2017 / 06:01