Derived Table using Existing View
Hi Iam new to Sql can someone please help me with the derived table.I had an existing view as the starting point from which should build the query to give derived table with all the employees and...
View ArticleMultiple sub select statements in an insert into command.
Hello, I'm having a bit of difficulty getting the following to work.[code language="sql"]INSERT INTO BANDALLOCATION (BANDSYSID,ZONEID,RATETYPE,SIMPLEBREAKSINDICATOR,SERVICEID,VE
View ArticleSQL Agent Job dependency between two Servers
Is there a way to set dependency between two SQL Server agent jobs that are not in the same server beside using a linked server?
View ArticleUnable to update CompanyID from another table
I have a table with a clolumn name 'CompanyNid' which I am not able to update from the staging table. Below is a query I am using [code language="sql"]update [PMG].[ContactData] set CompanyNids
View Articlevery simple Insert into
I am embarrassed for even asking this...I can't seem to even get this to work . . [code language="sql"]SELECT * into #temp2From(SelectSUPPLIER_IDFrom SOLICIT.GTM_DOC D)
View ArticleDetecting unusable objects
Hi,Iimagine if you will you have a database with over 500 stored procedures, views and functions and your testing an upgrade from the third party who developed it. The problem is you know that the...
View ArticleBlocking in a VL Table
Hi Experts, I have a table with more than 4 million records , I am updating values older than 2018 ,same time I am selecting values after 2018 . But the select is getting blocked by update how? Update...
View ArticleReport has no parameters and arguments were supplied
Hi Experts,Please help me with the below query.I am not sure where i am getting it wrong.When i execute the proc it gives me an error "dbo.p_Detail_Report has no parameters and arguments were...
View ArticleProfiling spikes in query duration
Table:[code language="sql"]create table GamePeriodsAdvanced ( GameId varchar(30) not null, PeriodType varchar(10) not null constraint CK_GamePeriods
View ArticleReport runs faster after Backup and Restore
This is the detail of the situation:The Report process was running very slow in the Live Database (10+) minutes. When I Backup and restore the Production database and restore to Test Company in the...
View ArticleExport and Import 214 tables
Hi guys I inherited a process in which extracts changes from 214 tables in a sql database into 8 flat files using numbers to mark each table. Then gets imported into a data warehouse via an SSIS...
View ArticleSelecting Min of multiple values, including an operation
Hi All,It's been a while, but would like to tap on your expertise. I've been trying to figure out the below query, particularly the OriginalWrittenPremiumMTD field, which involves taking the minimum of...
View Articleseparate pipe values
Is there a SQL to separate pipe values into separate rows? This is how the values are stored in my table CompanyNid Produce(Commodity)5836 Cooking Vegetables|Salad Vegetables|Berries|Citru
View ArticleOPENROWSET error accessing XLSX if not manually saved
Good day,Apologies if this is in the wrong forum. Please refer me to the correct one if this is the case, thank you.I have a bunch of excel files that are added to a Dropbox folder on a monthly basis. Th
View ArticleDoes a check constraint with UDF has performance impact on Query?
Hi all We have a Master table that has a primary key with two columns ( Code char(4), location int ). We have child tables referring this table, with only 1 column Code. So i cannot create a Foreign...
View ArticleIf branch then 'HDQ CityName, State
I have a table and a user requested a data and he wants me to format it in a way he wants it. I can't find a way to do it but before I tell him that, I am still working on figuring this out.The...
View ArticleIs there a better way to fetch more than one parameter from a row?
Over the years I've developed the habit of doing this in circumstances where I need to fetch a couple of parameters from a row in a table:set @id = (select top 1 id from tbl_EmailQueue where IsSent =...
View ArticleView - failed because it contains a derived or constant field.
I have this View:Create View xyz AsSelect Value,MAX(Case When Other = 'Color' Then Description Else '' End) Color,MAX(Case When Other = 'Font' Then Description Else '' End) FontFrom Att
View ArticleDynamic "FOR XML PATH" in SQL 2014
I have seen several replies on the Net that it is not possible to have dynamic FOR XML PATH in SQL 2008, but I wonder if this is still the case in SQL 2014, please?I have a bit complex SELECT statement...
View Article