Viewing 15 posts - 16 through 30 (of 89 total)
This might be because there is no record into the Source.
IF Object_id('LOAN_GROUP_INFO') IS NULL
CREATE TABLE LOAN_GROUP_INFO
(
LGI_GROUPLVR INT ,LGI_GROUPEXPOSURE INT ,LGI_DATECREATED DATETIMEOFFSET(3),LGI_CREATEDBY INT,LGI_DATEUPDATED DATETIMEOFFSET(3) ,LGI_UPDATEDBY INT ,LGI_ISACTIVE BIT,
LGI_GROUPID INT
)
GO
IF Object_id('LOAN_GROUPING') IS...
March 16, 2014 at 10:32 pm
DECLARE @tbl TABLE
(
ID INT IDENTITY(1,1),
Char1 NVARCHAR(100)
)
INSERT INTO @tbl
select 'ABC x.yz'
UNION
select 'A.BC X.*YZ'
UNION
select 'A.BC *X.YZ'
DECLARE @tblNumber TABLE
(
Number INT
)
INSERT INTO @tblNumber
SELECT TOP 1000 ROW_NUMBER() OVER(ORDER BY S.Object_id )
from sys.objects s,sys.objects s1
select...
March 13, 2014 at 9:57 pm
Use Master
GO
select su.name,p.name from sys.server_principals P
INNER JOIN sys.server_role_members sr
On P.principal_id = sr.role_principal_id
INNER JOIN (Select sr.Name,p.principal_id from sys.syslogins sr INNER JOIN sys.server_principals p
On P.sid = sr.sid)su
On sr.member_principal_id...
March 11, 2014 at 10:52 pm
DECLARE @tbl TABLE
(
Col1 NVARCHAR(100),
Col2 NVARCHAR(100),
Col3 NVARCHAR(100),
Col4 NVARCHAR(100),
Col5 NVARCHAR(100),
Col6 NVARCHAR(100)
)
INSERT INTO @tbl
SELECT '2013', NULL, NULL, NULL,NULL, NULL UNION
SELECT 'JED', 'Jan', 'Feb', 'Mar','Apr', 'May'UNION
SELECT 'WT', '24', '9', '11', '10', '9' UNION
SELECT 'L/B',...
March 6, 2014 at 11:25 pm
DECLARE @COMP_RATINGS TABLE
(
EID INT,
RATING VARCHAR(20),
AbsenceStartDate DATETIME,
AbsenceEndDate DATETIME
)
INSERT INTO @COMP_RATINGS VALUES
(5364914, 'b+', '2011-09-30 00:00:00', '2011-12-31 00:00:00'),
(5364914, 'bb', '2011-06-30 00:00:00' , '2011-09-30 00:00:00'),
(5364914, 'bb', '2011-12-31 00:00:00' , '2012-03-31 00:00:00'),
(5364914, 'bb',...
February 21, 2014 at 4:24 am
SELECT distinct p.dbPatID,
p.dbAddDate,
ISNULL(r.dbStaffLastName, 'No Ref - Staff') AS dbStaffLastName,
ISNULL(r.RefTypeWord, 'No Ref') AS RefTypeWord
FROM TEST2RefStaff s, TEST2Patient p
LEFT OUTER JOIN TEST2ReferralKPIs r ON p.dbPatID = r.dbPatID
...
February 21, 2014 at 2:40 am
with Companyloyalty as (
select 1 as idloyalty, 1000 as company, 100 as IdClient, '2014-01-12' as loyaltystartdate, null as loyaltyenddate, 10 as cashback union all
select 2 as idloyalty, 1000 as company,...
February 20, 2014 at 11:30 pm
DECLARE @tbl TABLE
(
ID INT IDENTITY(1,1),
Name VARCHAR(100),
Name1 AS CASE WHEN Name LIKE '%corporation' THEN SUBSTRING(Name,1,LEN(Name)-11) ELSE Name END
)
INSERT INTO @tbl(Name)
SELECT 'Oracle Corporation'
UNION
SELECT 'Union Corporation'
UNION
SELECT 'Union Corporate'
select * from @tbl
Regards,
Mitesh Oswal
+918698619998
February 10, 2014 at 12:21 am
select COALESCE(t1.date1,t2.date1),
t1.wsh as wsh,t1.ITN,
t1.Executions,t2.MCG,t2.Positions
from #Tbl1 t1 full outer join #Tbl2 t2 on t1.date1 = t2.date1
Order by 1
Regards,
Mitesh Oswal
+8698619998
February 3, 2014 at 1:50 am
DROP TABLE #Installments;
create table #Installments (idno int, payYear int, payMonth int,Payments decimal (10,2))
insert into #Installments
select 566232, 2006, 1 ,3568.67 union
select 566232 ,2006, 2, 3542.76 union
select 566232, 2006, 3, 3517.03...
January 27, 2014 at 3:22 am
USE Master
GO
DECLARE @dt DATETIME
SELECT @dt = '2014/01/27 01:00 PM'
select REPLACE(CONVERT(VARCHAR(10),@dt,111),'/','')+CASE WHEN DATEPART(HH,@dt) >= 6 AND DATEPART(HH,@dt) < 18 THEN '1' ELSE '2'...
January 26, 2014 at 11:44 pm
IF OBJECT_ID('OrderDetails') IS NOT NULL
DROP TABLE OrderDetails;
IF OBJECT_ID('Products') IS NOT NULL
DROP TABLE Products;
CREATE TABLE dbo.Products
(
ProductID INT PRIMARY KEY,
Name NVARCHAR(255) NOT NULL UNIQUE
/* other columns */
);
INSERT dbo.Products VALUES
(1, N'foo'),
(2, N'bar'),
(3, N'kin');
CREATE...
January 23, 2014 at 11:03 pm
Update dbo.Main_Item
SET Item_type = 0
where Item_type = 1
January 23, 2014 at 10:09 pm
I am using the Date from the getdate and used below where clause to find out the last 7 days data
DECLARE @dt Date
SET @dt...
January 6, 2014 at 7:29 am
DECLARE @COMP_RATINGS TABLE
(
EID INT,
RATING VARCHAR(20),
AbsenceStartDate DATETIME,
AbsenceEndDate DATETIME
)
INSERT INTO @COMP_RATINGS VALUES
(769,'BBB','2011-06-30','2011-09-30'),
(769,'BBB','2011-12-31','2012-03-31'),
(769,'BBB','2012-03-31','2012-06-30')
SELECT * FROM
(
select C.EID,C.RATING,C.AbsenceStartDate,ISNULL(C1.AbsenceEndDate,C.AbsenceEndDate)AbsenceEndDate from @COMP_RATINGS C
LEFT JOIN @COMP_RATINGS C1
On C.EID =C1.EID
AND C.RATING = C1.RATING
AND (C.AbsenceStartDate = C1.AbsenceEndDate...
January 3, 2014 at 4:50 am
Viewing 15 posts - 16 through 30 (of 89 total)