CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 06:58:14 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=3da7de27bf36575b31415c05e6973f01460ff477b14079cd1848161633531671a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22CfC8XmHC2hB38ZgaQkztBr4shPwQFdfU%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cc77c7cbc7d86d-BLR
10. hierarchyid 3 - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE Renewable_Energy_Devices (
- device_id NVARCHAR(26) PRIMARY KEY,
- device_status INT CHECK (device_status >= 0 AND device_status <= 6),
- device_power DECIMAL(18,0),
- company_id INT,
- device_location GEOGRAPHY,
- device_location_geom GEOMETRY,
- device_hierarchy HIERARCHYID,
- device_description XML
- );
- DECLARE @latitude DECIMAL(9, 6), @longitude DECIMAL(9, 6);
- DECLARE @point GEOMETRY;
- DECLARE @hierarchy HIERARCHYID;
- DECLARE @device_description XML;
- DECLARE @i INT = 1;
- WHILE @i <= 50
- BEGIN
- SET @latitude = RAND() * 180 - 90;
- SET @longitude = RAND() * 360 - 180;
- SET @point = GEOMETRY::Point(@latitude, @longitude, 4326);
- SET @hierarchy = HIERARCHYID::GetRoot();
- SET @device_description = '<description>Device_' + CAST(@i AS NVARCHAR(5)) + '</description>'; -- Zmiana sposobu tworzenia wartości dla kolumny device_description
- INSERT INTO Renewable_Energy_Devices (device_id, device_status, device_power, company_id, device_location, device_location_geom, device_hierarchy, device_description)
- VALUES (
- 'Device_' + CAST(@i AS NVARCHAR(5)),
- CAST(RAND() * 6 AS INT),
- CAST(RAND() * 1000 AS DECIMAL(18, 0)),
- CAST(RAND() * 10 AS INT) + 1,
- GEOGRAPHY::Point(@latitude, @longitude, 4326),
- @point,
- @hierarchy.GetDescendant(NULL, NULL),
- @device_description
- );
- SET @i = @i + 1;
- END;
- WITH DeviceHierarchyCTE AS (
- SELECT
- device_id,
- device_hierarchy,
- device_id AS hierarchy_path,
- CAST(device_id AS NVARCHAR(MAX)) AS device_path,
- 1 AS hierarchy_level
- FROM
- Renewable_Energy_Devices
- WHERE
- device_hierarchy = HIERARCHYID::GetRoot()
- UNION ALL
- SELECT
- red.device_id,
- red.device_hierarchy,
- dhc.hierarchy_path.GetDescendant(red.device_hierarchy, NULL),
- dhc.device_path + ' > ' + red.device_id,
- dhc.hierarchy_level + 1
- FROM
- Renewable_Energy_Devices AS red
- INNER JOIN
- DeviceHierarchyCTE AS dhc ON dhc.device_hierarchy.IsDescendantOf(red.device_hierarchy) = 1
- )
- SELECT
- device_id,
- device_hierarchy.ToString() AS hierarchy_path,
- device_path,
- hierarchy_level
- FROM
- DeviceHierarchyCTE
- ORDER BY
- hierarchy_path;
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ 8
JavaScript | 1 sec ago | 0.24 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 5 sec ago | 0.24 KB
-
⭐✅ Exploit 2500$ in 15 Minutes⭐⭐⭐ V
JavaScript | 8 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ C
JavaScript | 12 sec ago | 0.24 KB
-
⭐⭐⭐Exchange Exploit⭐⭐
Java | 13 sec ago | 0.10 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 14 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ D
JavaScript | 19 sec ago | 0.24 KB
-
⭐✅ Swapzone Glitch ✅ Working⭐⭐⭐ P
JavaScript | 23 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand