|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Python Lambda Expressions | |
I want to add a lambda expression in Python to my code. How many statements can I include inside the expression? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
The JSON Basic Query I have this document: DECLARE @json NVARCHAR(1000) = N' { "player": { "name" : "Sarah", "position" : "setter" }, "team":"varsity" } '; If I want to get the name of the player, what query is used? Answer: SELECT JSON_VALUE(@json, '$.player.name') AS PlayerName Explanation: The JSON_VALUE() function is used. The path is .player.name. Ref: JSON_VALUE - https://docs.microsoft.com/en-us/sql/t-sql/functions/json-value-transact-sql?view=sql-server-ver15 |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
SQL Server Performance Counters - Here's a question that feels like I'm asking if a tree falls in the woods and nobody is there to see it, does it make a noise? With that - Performance Counters (SQL Server specific ones), do these run in the background the entire time? Or does starting up Perfmon and tracking them start them […] |
SQL Server Mirroring - Principal cannot set endpoint to Mirror - I followed the below guide & I am stuck on the very last step where you set the endpoint to reference the mirror server. The result is the same even if I use SSMS. I am able to telnet successfully on port 5022 from principal to mirror. I am also able to telnet successfully on […] |
SQL Server 2016 - Administration |
SQL Server Load - Hi, The application team is pushing more than 7 lakhs records per day to SQL Server. The SQL Server version is 2016 with ALWAYS ON. During one point of time the SQL Server hungs and I need to failover manually. How much load can SQL Server withstand How much connections can it take at a […] |
SQL Server 2016 - Development and T-SQL |
How to aggregate Dimension values properly - Ahoi, im trying to deal with a user request to combine 2 values of a column based on values of a different attribut. I managed to make it work like this, creating 2 hidden memembers and combining those in my cube script. --Hidden 1 CREATE MEMBER CURRENTCUBE.[Order].[Ordertype].[Onlineshop Webshop] AS ([Order].[Ordertype].[All],[Order].[Belegart MDX Ohne Mandant].&[Webshop]), VISIBLE = […] |
SQL 2012 - General |
questions about sys.sysprocesses/sys.dm_exec_sessions and sys.dm_exec_requests - I have some questions about sys.sysprocesses/sys.dm_exec_sessions and sys.dm_exec_requests, please kindly give your guidance and comments, thanks! 1. under Microsoft SQL server Management Studio, when I execute select * from sys.dm_exec_sessions and select * from sys.sysprocesses, they have same pieces of records, so spid of sys.sysprocesses is the same thing with the session_id of sys.dm_exec_sessions, is […] |
SQL Server 2012 - T-SQL |
Converting minutes to hh:mm:ss - I'm trying to develop a formula to convert minutes (my raw data) to hh:mm:ss format. E.g.: 526.30 minutes = 31,578 seconds which should read 08 hrs. 47 minutes and 8 seconds or 08:46:08 ~ I think (?) |
SQL Server 2019 - Administration |
How to mantain index in SQL and size of Database - Hi everyone, I'm trying to figure out how to manage the maintenance of the indexes I just created in some tables of my database. Once I run the Rebuild, the size of the database increases and by shrink, the indexes are fragmented again. Is there a way to clean up the indexes without affecting the […] |
Interpreting Index Usage Stats on an Availability Group - I've been querying sys.dm_db_index_usage_stats on the nodes of an availability group, and I've noticed an exponential difference between the number of user_seeks on the primary node versus either of the secondary nodes. On the table I'm analyzing, the primary node has many indexes with user_seeks greater than 100,000, whereas on the secondary nodes not one […] |
Virtual SQL - Standard vs Enterprise, per-core - Hi, I understand that licensing all the Cores in a physical host with Standard Edition and SA give almost the same benefits as Enterprise Edition with SA, but what does the one that isn't included in Standard - Unlimited Virtualization - actually mean? I'm working on a 2-site design that involves SQL versions 2012 through […] |
SQL Server 2019 - Development |
All month/yr when no data across different column combinations. - was hoping to get some help as it appears I'm not close. Trying to get all year/mo combinations even when there's no data...based on year/mo, Site, Dept and Cat. Appreciate any help! create table #Date_Dim (Date date ) Insert into #Date_Dim values ('2020-01-01') ,('2020-01-02') ,('2020-01-03') ,('2020-01-04') ,('2020-02-01') ,('2020-02-02') ,('2020-02-03') ,('2020-02-04') create table #Data (Date […] |
Ideas for Auditing - I'm currently looking to design some auditing on my SQL application and am wondering what would be the best way. Basically when a user Inserts or Updates I would like to capture what the previous value was and what the new value is. This would be across about most of my tables and could be […] |
Can I download Shapefiles for all countries from somewhere? - I'm trying to get my head around the Geography/Geometry methods in SQL Server... are the shapefiles for all the countries downloadable from somewhere? So far I haven't found them. |
Azure Data Factory |
Set Variable to lookup first row value with white space in property name - Hi, How can I set the value of a variable from a Lookup activity when thw property name hase a white space? I'm trying to do it this way but fails: "value": "@activity('LookupMaxRecordId').output.firstrow.Record ID#", Find the complete code below: Thanks! ************* { "name": "pipeline8", "properties": { "activities": [ { "name": "LookupMaxRecordId", "type": "Lookup", "dependsOn": [], "policy": { "timeout": "7.00:00:00", "retry": 0, "retryIntervalInSeconds": 30, "secureOutput": false, "secureInput": false […] |
Reporting Services |
Query in SSRS report, double hop to linked server - I have 3 (old) existing SSRS reports that were developed and deployed on Server A. They each use the same 2 shared Data Sources (RD and DR). 1 of the Data Sources(DR) is a linked server, Server B. The reports have queries against the same datasets. 2 of the datasets use the shared […] |
Data Transformation Services (DTS) |
vbs failing - This vbscript for Excel that opens a pipe delimited file is failing srccsvfile = Wscript.Arguments(0) destxlsfile = Wscript.Arguments(1) Set objExcel = GetObject(,"Excel.Application") objExcel.Visible = false objExcel.displayalerts=false Set objWorkbook = Workbooks.OpenText (srccsvfile, Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="|") Set wkbTemp = ActiveWorkbook Set objWorksheet1 = objWorkbook.Worksheets(1) It's failing on the OpenText […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |