Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Administration |
Can not Truncate the database because “Secondary has no log was added” - I got an error when trying to truncate the database: "Database can not shrink until all secondaries have moved past the point where the log was added". When I check the status of the secondary on the primary machine (Always On High Availability Dashboard), it has heath: good and Synchronization state: Synchronizing. But the status […] |
Blocking query - Hi All, Seeing blocking on production server. There is one particular sql statement which is causing the blocking all the time. Please guide and on how to resolve or minimize the blocking for this statement. I always see this as a head blocker. These sql statement is executed quite a lot. Why it is holding […] |
SQL Server 2016 - Development and T-SQL |
Hierarchy related calculation - Hello all, I have a hierarchy of businesses. example can be created as follows: create table #temp (LeafLvl varchar(20), L1 varchar(20), L2 varchar(20), L3 varchar(20), L4 varchar(20), L5 varchar(20)) insert into #temp (leafLvl, L1, L2, L3, L4, L5) select 'L2-1', 'Top', NULL, NULL, NULL, NULL UNION ALL select 'L3-1', 'Top', 'L2-1', NULL, NULL, NULL UNION […] |
SQL Server 2019 - Administration |
if then else issue - I'm trying to use the if then else to check if a member exist in a server role. if it does, do X, else do Y. but not getting the desire outcome. BEGIN DECLARE @member nvarchar(50); USE [master] SELECT @member = members.name FROM sys.server_role_members AS server_role_members INNER JOIN sys.server_principals AS roles ON server_role_members.role_principal_id = roles.principal_id […] |
Can not Truncate the database because “Secondary has no log was added” - I got an error when trying to truncate the database: "Database can not shrink until all secondaries have moved past the point where the log was added". When I check the status of the secondary on the primary machine (Always On High Availability Dashboard), it has heath: good and Synchronization state: Synchronizing. But the status […] |
database schema and permissions - Hi - trying to find a t-sql to list all db schemas and their permissions. unable to find anything helpful on google. thanks |
SQL Server 2019 - Development |
Find the records based on group by Student ID - Data looks like below Status 1 is Active and 2 is Clean For one Student ID we may have one active, one clean status; I want to find the records only with Clean status for a student ID. Student Id Student_Status 12345 […] |
problem of slowness in my requests - hello, I am having a major performance issue , with this part of code which is still blocked on my server , Attached is the part of the code that is causing the problem. DELETE R FROM #RESULTS_DEM AS R INNER JOIN dbo.Dem_trans AS DEM ON DEM.NUM_DEM = R.NUM_DEM WHERE ( NOT EXISTS ( SELECT […] |
Joining CTEs Causing Performance Issues - Hi everyone I am not sure why the query is taking so long to run. If I run each CTE separately then it runs in less than 2 seconds. However, when I join them they take forever to run. I stop the query after about 10 minutes. I am pretty sure I am joining them […] |
Need to create a .xml file in specific format using SQL Query. - I have a table of data that I need to create a .xml file from in a specific format. CREATE TABLE [dbo].[XML_TABLE]( [ProductID] [nvarchar](25) NULL, [Name] [nvarchar](25) NULL, [ParentID] [nvarchar](51) NULL, [AttributeType] [nvarchar](10) NULL, [AttributeID] [nvarchar](255) NULL, [AttributeValue] [nvarchar](4000) NULL ) ON [PRIMARY] GO Here are some values to insert: INSERT INTO WORK.DBO.XML_TABLE([ProductID], [Name], [ParentID], […] |
SQL Azure - Development |
Copy DB from Prod to Test !! - Good morning. I would like your advice. I work on Azure Sql. We have 3 environments (Dev, Test and Prod) Each environment has a specific tenant. Every month, I would like to copy the database from Production to the Test environment. What solution do you recommend to perform this task? Regards |
SSRS 2014 |
Open linked report in new tab with multiple parameters (javascript) - I have a report that links to another report on the server, while the way I have it currently works the users are requesting that it opens in a new window. The report being linked to has two multi select parameters ="javascript:void(window.open('http://east-rpdb01/reports/report/Testing/Profitability%20Report%20All%20Clients&FiscalYear=" & Fields!FiscalYear.Value &"'))" I am close to getting this but not sure […] |
Anything that is NOT about SQL! |
Need information on past SQL Summits, please... - I'm endeavoring to convince my employer to send me to SQL Summit this year, but I'm going to need to "sell" that it would be worthwhile for them to do this. And sell it not just to my supervisor, but to his supervisor and to her superior. Now, I fully expect that there's going to […] |
SQL Server 2022 - Development |
The Nook Spa - The Nook Spa is a safe and healing environment. offering therapeutic massage services, body treatments, facials, anti-aging treatments, enhancements and infrared sauna. Services are provided by licensed estheticians and professional massage therapists in Dallas, TX. for more details click here:Professional Thai Massage Therapists Dallas TxThai Massage Services Dallas Tx |
What are some SQL commands that data scientists should be familiar with ? - Hello As an individual who is new to the field of data science, I am keen to gain insights into the fundamental SQL commands that data scientists should possess knowledge of. I would appreciate your guidance on this matter. |