Questions tagged as 'sql'

1
answer

How to execute a script before a view in sql server?

I created a view and it fetches information from an X table. However, this X table must be created in a select, before running the view, so that the data is updated. How can I create something in the sql server so that as soon as the user cli...
asked by 09.04.2015 / 16:02
0
answers

SQL exercise [closed]

Good afternoon guys, I'm doing the following exercise but I'm not sure if I did it right or not, could you take a look? Type the SQL queries according to the database schema given below. a. Select the year, semester and the name of the cou...
asked by 18.03.2015 / 19:01
0
answers

Query calculating in double [closed]

I'm running this query: $db->query("UPDATE 'stack' SET 'vote_up' = ('vote_up'+1) WHERE 'id' = '3'"); When I run this way in the PHP script it adds the vote_up + 2 but when I run in sql it does the normal sum that is vote_up...
asked by 03.03.2015 / 01:21
0
answers

Retrieve all values from a SQL table and add to a session

I'm using the following code to get all the data in my table: $sql4 = mysqli_query($db, "SELECT * FROM login"); $exibe4 = mysqli_fetch_assoc($sql4); It is working perfectly and is picking up all normal data. But before, when it was a spe...
asked by 12.03.2015 / 18:02
0
answers

Does mirroring influence server auditing?

Does Mirror Break Influence Server Audit? I ask this because in the databases where I need to redo the mirroring for some reason, I also have to specify the audit again (BASE > > > >> Database Audit Spec. > > > Audit Field)....
asked by 19.01.2015 / 17:32
1
answer

replication error

I'm trying to use a command in shell in PostgreSQL (Windows) with the following syntax: select pg_start_backup('nome do meu banco de dados', true); It responds to a record. Now, when I type the following command nothing happens: pg_base...
asked by 06.03.2015 / 15:42
0
answers

Add amount of gold to player

I have a [Mu Online] Ex 802 server, and it has {SHOP CASH} system for players to be able to buy their items. Well my Server has a control panel in which I can add the amount of currency the Player will have, plus this system is in C #. The Sh...
asked by 29.01.2015 / 19:10
2
answers

Why use WHERE 1 = 1 in a SQL query?

During the maintenance of a legacy system I noticed the following procedure : DECLARE @sql AS varchar(MAX); DECLARE @param as varchar(50); SET @sql = 'SELECT * FROM Destinatario where 1 = 1'; IF(@param IS NOT NULL) SET @sql = (@sql + '...
asked by 10.04.2014 / 18:53
2
answers

Relation between 3 tables and search result from last week mysql

I have three tables, tbl_recursos , tbl_categorias , and tbl_categoria_recurso . The tbl_recursos consists of the listing of resources posted by the user. tbl_categorias are the categories that a resource can hav...
asked by 29.07.2014 / 16:11
4
answers

Is it possible to reference a column other than a primary key in another table?

For example, I want to reference the id_2 of Table 1 in Table 2, I know I can do with primary keys but with other columns I do not know if it is possible. Table 1: id (primary key of table 1), id_2, name Table 2: table_id2 (primary key of...
asked by 07.05.2014 / 16:20