Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Administration |
How to find out the time when command failed in sql server? - I was performing dile shrinking using GUI. After more than 10 hours I got an error, saying that the shrink command failed. Maybe a silly question but I am not able to see exact time when Error occurred in sql server? I started shrink file job in SSMS using GUI. After more than 10 hours […] |
SQL Server 2016 - Administration |
Restore Verify only failing. - We are having issue for backup restore from lower version 2012 to 2016. We copied the backup file over the network from other VM and did check the backup file using restore verify and this verify getting fail. Please help with your valuable suggestion. |
SQL Server 2016 - Development and T-SQL |
Attempted foreign key constraint creation involving multiple fields fails - Hello Experts I have defined a table with an incrementing primary key (pretty usual), and also with a unique index on two other fields, thus: Create Table dbo.CTRs ( CTRseqNo Integer identity(1,1) not null, -- Incrementing number, generated on import. LocalPatientID varchar(20) not null, -- Assigned by provider, unique to them ReviewDate Date not null, […] |
Development - SQL Server 2014 |
Stop job after specified run time - I'm testing a long running job and want to stop it after it has been running for, say, 2 hours. How can I do this automatically, i.e. without being around to manually stop it? |
SQL Server 2012 - T-SQL |
Show only once repeated value in result a set - Hello Everyone, Here again I came with a question. Below is my query for a report that I want. It's working fine with no issues. SELECT TP.Location, TE.Name, TEI.imp_amount_approved_by_finance AS Amount, CONVERT(DATE, TEI.imp_fin_appr_date, 103) AS PaidDate FROM tbl_emp_imprest TEI JOIN tbl_Projects TP ON TP.Sno = TEI.imp_emp_location JOIN tbl_Employee TE ON TE.Sno = TEI.imp_id WHERE imp_amount_approved_by_finance […] |
SQL Server 2019 - Administration |
Need to extract all queries used across all packages - A developer is asking me to provide a list of all the "queries" (aka sqlcommand) as it is in the tables there. He is asking for ALL of the queries from ALL of the packages... Is there an extract I can run against the SSISDB to render this list of queries? (the developer was pulling […] |
SQL Server 2019 - Development |
Compare 2 rows in the same table and output result when conditions are met - I am newbie to SQL, tried searching for answers for similar question but couldn't find any. Sorry, if this type of question was asked before. I have a temp table as below: Drop TABLE if EXISTS #temp Create table #temp(ID int, Country VARCHAR(40), ItemCount int, DeliveryDate Date, Itemtype VARCHAR(40) ) insert #temp(id,Country,itemCount,DeliveryDate,Itemtype) Select 3012111,'Dublin', 100, […] |
Compare 2 rows in the same table and output result when conditions are met - I am newbie to SQL, tried searching for answers for similar question but couldn't find any. Sorry, if this type of question was asked before. I have a temp table as below: Drop TABLE if EXISTS #temp Create table #temp(ID int, Country VARCHAR(40), ItemCount int, DeliveryDate Date, Itemtype VARCHAR(40) ) insert #temp(id,Country,itemCount,DeliveryDate,Itemtype) Select 3012111,'Dublin', 100, […] |
Bulk Insert C# Code Error - I figured out the issue. Please ignore post. |
How to do recursion in join clause or in exits clause or in "in" clause. - hi, I have used "with cte" to do some recursion, which i have used on top, is there any why that i can do recursion with "with cte" or with other techniques in side the exists clause or in outer apply or cross apply . note : "with out using function" as some one said […] |
T-SQL : Slicing time periods - Consider the following table that gives the validity dates for which an Item is associated to something called a DU, and a certain Market : CREATE TABLE Items (Item_ID VARCHAR(2) ,Start_Date DATE ,End_Date DATE ,DU VARCHAR(2) ,Market VARCHAR(10) ); INSERT INTO Items VALUES ('X', '2020-06-01', '2020-09-30' , 'A', 'GREECE'); INSERT INTO Items VALUES ('X', '2020-11-01', '2021-01-01' , 'A', 'BELGIUM'); INSERT […] |
T-SQL (SS2K8) |
running OPENROWSET from sql function with parameter - Following function works if the parameter to harcoded as shown below. But i would like to replace the value with parameter. PO12345 - should be replaced by @IpRef. I am not able to figure out how to do that. --select * from dbo.ki_GetSupplyUsage ('PO12345') alter FUNCTION ki_GetSupplyUsage(@IpRef VARCHAR(100)) RETURNS TABLE AS return SELECT * FROM […] |
SQL Azure - Administration |
Tempdb Behavior in Managed Instances - Dear colleagues, I understood that the tempdb size will depend on multiple factors, such as the service tier, the number of vcores and much of it is directly controlled by Microsoft. However, something that is very strange to me, is that when the instance is restarted not always come back with the same configuration for […] |
General |
Python Pattern best practice - Ahoi, anyone can tell me if there is a pattern/best practice to handle this type of request handling? I am trying to handle the execution of functions by name. I found a pattern for classes using a dicitionary but i couldnt make it work like this. https://github.com/faif/python-patterns/blob/master/patterns/creational/factory.py What i have i have made work is […] |
Integration Services |
Issue with Execute SQL Task in Sequence container returning 0 results - I'm working on a package to update some local tables from a datalake we access. I've been able to write individual incremental update packages for each table. The general flow of the package is "Get Now" (UTC) - Get Max Modified Utc from local table, get list of changed ids from source table where modified […] |