Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

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 Article


Entity 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 Article


Problems 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 Article

Conditional 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 Article

DeadLocks 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 Article


TSQL 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 Article

execute 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 Article


How 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 Article


Merge 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 Article

Image may be NSFW.
Clik here to view.

Microsoft 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 Article

Is "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 Article

Sales 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 Article


Image may be NSFW.
Clik here to view.

How 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 Article

Retrieve 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 Article


Reseed 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 Article

department-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 Article


how 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 Article

Getting 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 Article

sp_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
Browsing all 23857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>