IN SSIS How to change SQL Authentication to Windows Authentication
HI I was trying to deploy the packages in to server it is erroring out with the below error . TITLE: SQL Server Integration Services The operation cannot be started by an account that uses SQL Server Authentication. Start the operation with an account…
Azure SQL Database Stored Procedure long execution time issue
In my Azure SQL Database I have Stored Procedure sp_subledger (Attached the code : sp_subledger.txt) The Stored Procedure is completing within 1 min when Tenant = 1 is provided but when Tenant = 2 is provided it is running for more than 2 hours. for…
Joing two tables in SQL with Different Primary Keys
Hi, I'm trying to join two tables, they are both string datatype but the only difference is the first table having an extension number either '001', '002', or '003', etc. I was thinking to use LIKE % but I'm not sure how. I have like thousands of…
How to handle blank space in table
Hi Expert, How to enter blank space and default date in timestamp column create table tabletest1 (col1 char(23), col2 int,col3 decimal(3,3),col4 timestamp) expected values
Updating running balance in SQL
How can I update the Balance in a SQL table based on the BillAmount , EmployeeId and Id fields? I want to update the balance of every record to be less by the BillAmount of that record when compared to the immediate previous record for the same…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
TSQL Lag Calculate the Period Delta from a column which has only Period Ending Balances
We are trying to derive the period change amount from a table which only has period ending values. This is sample code: --We are trying to derive the period change amount from a table which only has period ending values. --This is sample…
double qoutes issue
Hi Expert, I want to remove the double qoutes from end and start of the statement create table table1 ( col1 varchar(200)) create table table1 ( col1 varchar(200)) insert into tale1 values('"Test1 Test1 Test1 "Test1"…
![](https://techprofile.blob.core.windows.net/images/GNq3KEcGu0aiBwwttW-8_Q.png?8DC240)
How to calculate number of weeks worked by an employee for a fiscal year in sql server
How to determine the total weeks an employee has worked during a fiscal year using SQL Server. My start date is 12-28-2023 and till today, I would like to calculate the no.of weeks worked by an employee during that time.
![](https://techprofile.blob.core.windows.net/images/YC3KiAudCk6A0I6NB9vOyA.png?8DA953)
T-SQL R language - return fewer columns
I'm running an R language script under T-SQL where I use REGEX to validate data in two columns. However I only want to output the id column in my result set. My script is: EXECUTE sp_execute_external_script @language = N'R', @script = N' pattern =…
sqlpackage export data
Is it possible to export data only of all the tables in the DB using sqlpackage export action? Schema is not to be included in the .bacpac file.
![](https://techprofile.blob.core.windows.net/images/YC3KiAudCk6A0I6NB9vOyA.png?8DA953)
How to get dynamic variable in 'Delete Activity' in Azure Synapse.
I am new to azure synapse analytics. I want to delete a folder from a container having format 'YYYYMMM' if it exists. If folder is not there ,a new folder same format YYYYMMM should be created. I have tried as below but could not be able to delete the…
![](https://techprofile.blob.core.windows.net/images/UVyLn-Xlr0apNce5TRX1RA.png?8DBA3B)
Create a Table based on Multiple Criteria
Hello All, I am a Power BI developer and I have come across a problem that I need help solving. I want to create a table based on multiple criteria. I am doing a drill through from one page to another, where I can see the details of feedback that…
![](https://techprofile.blob.core.windows.net/images/YC3KiAudCk6A0I6NB9vOyA.png?8DA953)
How to get data related from #parts table based on company id and in case of table #company not have companyid then display all data ?
I work on sql server 2019 i face issue i need to write join display data from table #parts based on values exist for #company in case of #company have companyid then get data related if #company table not have any companyid then get all data…
![](https://techprofile.blob.core.windows.net/images/hUXz8h3k5kWxSrxVes31Qw.png?8DC16B)
Convert day, hour, minute, second (6d 5h 19m 18s) in Hour’s integer value in SQL Server
Hi All, we have a issue to convert Day, Hours, Minute, Second in Hours integer value. This is incoming data format-6d 5h 19m 18s, we need to convert this value in hours as integer value. Thanks MV
How to store dynamic sql result into temporary table
This is my dynamic sql. SET @Anonymous = ' Select XX.,'''' scale,Isnull(AllowComma,''FALSE'') AllowComma,Isnull(AllowedDecimalPlace,''0'') AllowedDecimalPlace, Isnull(AllowPercentageSign,''FALSE'')…
How to do the bulk insert of one lack records in sql server using node js
Hi, I will store the data in following Json format. Now I want to insert this one lack. records in sql server. Kindly Please provide the best solution and if it's possible share your solution with sql query. [ { key: value, key: value, key: value, key:…
![](https://techprofile.blob.core.windows.net/images/KhnRGP5_AwAAAAAAAAAAAA.png?8DBA61)
SCD Type 2 : MERGE Update and Insert
Hi All - I am trying to implement a Type 2 Slowly changing dimension in SQL procedure using MERGE. Here are the rules : If its a new record insert into target table with start date = getdate, end date = null and islatest =1 If the record is…
![](https://techprofile.blob.core.windows.net/images/kjzQAO5Oq0Oj37wdNf6qTQ.png?8D8E42)
SQL job get blocked after some time by a process on master DB
I have a job which performs following steps on high level 1.) Load Stage table 2.) Load Fact table 3.) Apply lots of rules on fact table, so lots of updates This was working fine for more than a year but now it gets stuck after applying some of the…
![](https://techprofile.blob.core.windows.net/images/9CqRWkWyk0WIvV6eSiSD-g.png?8DB6B7)
Does SQL Table Column is assigned with column number
In Table, we can see there is number assigned automatically (line number) is the same thing is available for the columns (column number) and how can we get that number? I need a SQL query to find the column number not the number of columns.
i have a stored procedure that is complaining about a group by clause but i can see nothing wrong with it
Would someone PLEASE tell me what is wrong with this? select d.customer_no, e.sort_name, d.order_no, d.perf_no, d.season_desc, h.prod_no, b.seat_no, g.description 'section', f.seat_row, f.seat_num, a.sli_no, a.last_event, b.event_code, c.description…
![](https://techprofile.blob.core.windows.net/images/YC3KiAudCk6A0I6NB9vOyA.png?8DA953)