how to get difference of two rows as third row
hi..i want to calculate variance of row..for example salary of employeeemp_code month basic hra splall da ltaa001 jan100005000500080007000a001...
View ArticleEntity Framework ConCurrent Issue
Hi Everyone,I need to build an application that will have concurrent users access MS SQL records. I'm using EF 4.3.1 and have an entity call "apps_SystemInfo and one of the properties is call...
View ArticleProblems with date function
Hey guys, I have the following codein my Where clause I have the followingWhere Convert(Char(10), PlannedStart, 101) >= Convert(Char(10), Getdate(), 101)when I do this, it still returns back records...
View ArticleConditional Serial Number Generation
I need output for the below sample. the trip number has to be generated for each carrier, truck, trip eligibility combination. but if the trip eligibility has 'N' then the previous row trip number...
View ArticleDeadLocks issue
Hi All,We are having DeadLock issue on our application and we put a job on SQL and monitors on which SP the deadlock is happening and once the deadlock happens it sends the Store Procedure where it...
View ArticleTSQL Datediff(dd,MAX(p_effdt),CURRENT_TIMESTAMP)
Hi, OBJECTIVE: for a group of clients, report the average number of days in which they have been enrolled in a given program.PROBLEM: the clients are often dropped and later re-enrolled in our...
View Article'WHEN MATCHED' cannot appear more than once in a 'UPDATE' clause of a MERGE...
Hi All, Below is my stored proc which doesnt allow me to use multiple updates and when matched.Can someone please help me with this? USE [ODS] GO /****** Object: StoredProcedure...
View Articleexecute t-sql on ssrs 2012 with 3 parameters
I would like to know how to execute straight t-sql in sql server 2012 from ssis manager that passes 3 parameters to the sql listed below:Baiscally the sql looks like the following:Select * from...
View ArticleHow to get total DB size
I am using SQL 2005/2008/2012. I want to get such type of information:- Server NameTotal Number DBTotal DB Size in GBServer110100Server215200Any help would be highly appreciated. Thanks
View ArticleMerge Multiple row in one row (Self Join)
Hi , I have a data table like below :-C1 C2 C3 C4 C5 C6FL All Other Audis 0 012 16/5/2009 LT FL All Other...
View ArticleMicrosoft TechNet Wiki T-SQL Guru - Winners for December!!
The results for December's TechNet Guru competition have been posted!http://blogs.technet.com/b/wikininjas/archive/2014/01/16/technet-guru-awards-december-2013.aspxCongratulations to all our new Gurus...
View ArticleIs "with (nolock)" a good thing?
I've got an application that generates a report using Crystal Reports 9. It is timing out when it runs queries against the SQL Server. At this time I am trying to determine which query is causing this...
View ArticleSales Commission Calculator APP Visual Basic 2010
Items have a fixed price of $10 per unit. Use a Select Case statement to implement the following sales commission schedule:Fewer than 10 items sold = 1% commissionBetween 10 & 40 items sold = 2%...
View ArticleHow do I concatenate content query search in Presentation?
Sharepoint 2013 EnterpriseIt seems fairly simple. The directions I have found state that one simply separates the desired column names with a semi-colon. But I'm not getting any results except for...
View ArticleRetrieve info based on a list
I have a list of names and a separate address book. The address book contains the fields Name, Location and Title.The address book is a superset of the list of names.I need to display the Location and...
View ArticleReseed Identity Column
Hi,Actually i know that how to reseed identity column. But my doubt is that on what situations we need to reseed identity column?Recently we faced an issue:that while we inserting recording on this...
View Articledepartment-wise salary percentage
Create table #emp(empid int, deptno int, sal int) insert into #emp values(1001,10,12345) insert into #emp values(1002,10,22445) insert into #emp values(1003,10,33345) insert into #emp...
View Articlehow to get index fragmentation percentage by sql query
hi, experts, I built some indexes in my database. the database is not accessible by me. it is by DBA. I could not ask him to use interface on management studio to check every indexes fragmentation...
View ArticleGetting error while converting datetime to chracter string
Hiwhile executing below query having errorSelect convert(datetime,SUBSTRING('12/29/13',1,6))+ '20' + SUBSTRING('0434',1,4) + ':00' as DOS doing a bulk insert and selecting the date time getting...
View Articlesp_who2 does not return all connections in a contained database
If I login to SQL Server as an administrator and I run s_who2 I get all the connection information for all databases.If I login to SQL Server to a contained database (using a contained database user)...
View Article