Questions tagged [Transact-SQL] (96)

2
answers

MS SQL Server. T-SQL. The organization "change history"

I wanted to make any changes to a particular record in a particular table were monitored and it was always possible to revert to an older version. On reflection I prikol that it would be good to implement this on the DB level to avoid any lining application. Create mytable_history, with a signature identical to mytable, ...
Vince_Donnelly asked October 10th 19 at 14:23
7
answers

Learning C# and T-SQL

Welcome habracha! Was offered a job of a programmer in C# training in the work process, at the moment, the relation to programming are very mediocre and knowledge in this area are minimal (you can write any simple console application input/output/count anything remember what took place at school), have a General idea about ...
Kattie_Wilderman asked October 8th 19 at 00:11
4
answers

[SQL] How to extract a value from a group based on conditions in another column?

CREATE TABLE Items ( ItemId INT NOT NULL, CategoryId INT NOT NULL, ItemValue INT NOT NULL ) The table contains the item s. Each item has a category (CategoryId), and also some value (ItemValue). Need to write a query whose result will be grouped by category and will contain the following columns:id category;id item and w...
Magnolia.Haag52 asked October 7th 19 at 17:44
0
answer

How to set rights to the folder or report in Microsoft Report Manager, using t-sql?

Good time of day. Tell me how to set permissions for the folder or report in Microsoft Report Manager using the request. I understand the algorithm of actions like this: 1. Read by user(s) ID 2. Collect policyID 3. Used this policyID need the directory or report Skill is not enough, who can already faced such problem?
4
answers

Is it possible to "expand" a table in sql?

I have a table like| ID | ProductID | PropName | PropVal | ---------------------------------------------- | 1 | 560 | Color | green | | 2 | 560 | Family | Resistors | | 3 | 560 | Series | 375 | Is it possible to bring it into this:| ID | ProductID | Color | Family | Series | -------------------------------------------------...
janick_Vandervort asked October 2nd 19 at 21:55
2
answers

Why not change the INDEX fragmentation after REBUILD?

There is a script to Defrag indexes USE [Backup2]; GO SET NOCOUNT ON; DECLARE @objectid int; DECLARE @indexid int; DECLARE @partitioncount bigint; DECLARE @schemaname nvarchar(130); DECLARE @objectname nvarchar(130); DECLARE @indexname nvarchar(130); DECLARE @partitionnum bigint; DECLARE @partitions bigint; DECLARE a float...
Maryse_Keeling48 asked October 2nd 19 at 17:12
4
answers

What books/Internet resources to read for the novice SQL developer (transact-sql)?

At work have the opportunity to develop in the direction of the sql development. Have experience in writing complex database queries, but lack the experience / knowledge of how to develop, for example integration between the two systems. Scoured the Internet on the subject of how to properly / not properly develop in the da...
Hattie.Lubowitz asked October 1st 19 at 02:00
1
answer

Pivot. How to implement a coup of several rows in a table?

Good time, Lord. There is a table of the form It should be turned so that the values sync_table become row headers, though not repeat, and date_max - steel columns. Something like this: Here is the code how it happened:select sync_table, [2014-02-14],[2014-02-15],[2014-02-16],[2014-02-17],[2014-02-18] from ( select ...
darby.Spencer asked September 30th 19 at 17:36
5
answers

About transactions in SQL?

Hello! Tell me, please, whether correctly I understand that if the following code is run simultaneously (direct millisecond per millisecond) with several clients, none of them will work with the same string?$mysqli = new mysqli("localhost","root",null,"tmp"); $sql = "START TRANSACTION"; $result = $mysqli->query($sql); ...
carlotta.Hodkiewicz32 asked September 30th 19 at 15:44
0
answer

As for mysqli to make a transaction with multi_query?

I have a script import a lot of data, read that I need to use transactions, otherwise all extremely long and nagruzhena performed. In fact, when you're trying to use, are the examples$mysqli->real_query("SELECT * FROM sd_hotellook_cityids WHERE countryid != 0 AND updated = 0 AND checked = 0 ORDER by id LIMIT 3"); $query ...
Kailey.Moore63 asked September 27th 19 at 22:31