Microsoft documentation contradictions about indexed views?
Hello!Recently a person I met from time to time, who is preparing for an exam, told me about an interesting subject, indexed views, the fact they are automatically used by the optimizer ONLY by...
View ArticleDBA Trainer
Hi,I would like to get you opinion on this:I have an offer of full time SQL Server Trainer if e.g. I work on it for 3 years at least which impact on my target DBA job for future.Please your opinion is...
View ArticleQuery not returning all rows
I'm trying to set a query that will return all products that a load requires along with the amount that has been allocated to it. I have this semi working, only thing is it will only provide me with a...
View ArticleCTE Parse
Currntly I concatenate XML tags and & lookup temp table to return the name at postition and assign the tag, then XmlTransform to add the customer id to all the parent & child records, works...
View ArticleMS SQL DBA
Hi,I wanted to implement a scenario in my environment that when ever my Transaction Log grows more than 70% of the particular file system then I will get alert via Email.Please help me to write above...
View ArticleSQL server casting string to integer checking value before casting
i have got a table in database (MS SQL SERVER 2012) called MINIMUM_AGE, the values are inserted as nvarchar i,e 17 years 54 years N/A 65 years and so on i would like to apply where clause on the...
View Articleadvanced join
Hi All,I am trying to figure out how to do this and appreciate any help. Basically, I have two tables shown below. I need to join the orders table with the shipments table on Customer IDand on date so...
View ArticleHow to convert from varchar to bigint?
Hi all, I have a stored procedure which is inserting value like thiscmd2.Paremeters.Addwithvalue("@water", dtr["waterd"])dtr["waterd"] is a varchar and this needs to be converted to bigint, how do I...
View ArticleGET all children for parents
Hi all - i have this code to get all the children under a particular parent and it is working but it only works with one parent at a time. how can i modify this so that I can pass multiple parents and...
View ArticleGROUP BY clause and table join
This is probably simple but I’m just trying to learn SQL. I have two tables.employee...
View ArticleLeft Join Issue
Hi Guru'sI am having a table A whith 2 columns (SID,Sub).Sid SUb201 T1201 T2201 T5202 T2202 T3203 T4I am having another table B with 1...
View ArticleCompute for the Median
Hi Experts,i have this table:Date Activity Duration 11/27/2013 A 1.00 11/27/2013 A 2.00 11/27/2013 A 3.50 11/27/2013 B 4.00 11/27/2013 B 5.00 11/27/2013 B 6.50 11/27/2013 B 3.00I want to compute for...
View Articleselecting correct rows
I am having trouble selecting the correct rows, as I have got duplicate rows in my table.Column 1 Column 2 Column 3 Column 41...
View ArticleSum Numbers Within String
select COM, co.KEY, ID, DSCD, SECS,EXCNTfrom company cojoinsecurity se on co.KEY=se.KEY where co.KEY=285313 There are strings in DSCD, and some numbers too. I want to sum in the number within the...
View ArticleReturn Recordset for Child Tables with a TVP
So, here is my problem and I am having a mind blank...I have created a Parent table (User_Accounts) and I have two child tables (User_Skills and User_Locations)The tables are as...
View ArticleMax Salary
I have two tables Employee, and Job_Title. I am suppose to calculate the MAX salary of all Exempt employees. I don't understand what I am suppose to be doing here? This is the table...
View ArticleUnlock a stored procedure
hi to all,we get a stored procedure from network but it is locked and we can only exec with parameters,its possible to see code?thanks.
View ArticleDifference in both the Scripts
Hi All,Check these two Scripts.Script 1 SELECT CASE WHEN City__C IN ('DELHI','MUMBAI') AND (REPLACE(REPLACE(month1_sal__c,' ',''),',','')>=100000 OR REPLACE(REPLACE(month2_sal__c,'...
View Articleset deadlock priority , has it got any consideration.
Hi, situation is , there is one generator which is complex, while it is running,some times we need to check some data on tables it is using. this some time creates dead lock.i want to put set deadlock...
View ArticleLogical read calculator
Hello,I am looking for logical read calculator.Everytime when i have to calculate Logical reads of the query and its quite a pain.Does anyone have a tool who can calculate the total logical reads of...
View Article