Viewing 15 posts - 1 through 15 (of 17 total)
Thanks okfine08, This is also working but the query is running forever on the main database which has around 200K records
February 4, 2019 at 3:47 am
Thanks Fahey...It works perfectly for my requirement.
February 1, 2019 at 1:31 am
This is Working :
select T1.ID,T1.Number,T1.Description,piv.[0000000822] AS GRADE_LENGTH,piv.[0000000823] AS GRADE_WIDTH
from [dbo].[Table1] T1 JOIN
(
select [ID],[Grade],[Value]
from [dbo].[Table2]
) T2
pivot
(
February 3, 2017 at 3:02 am
I tried like
SELECT T1.ID,T1.NUMBER,T1.DESCRIPTION,
CASE WHEN T2.GRADE='0000000822' THEN T2.VALUE END AS GRADE_LENGTH,
CASE WHEN T2.GRADE='0000000823' THEN T2.VALUE END AS GRADE_WIDTH
FROM [dbo].[Table1] T1 join [dbo].[Table2] T2...
February 2, 2017 at 6:44 am
Noted with thanks Thom...Please check below the statements:
--TABLE 1
CREATE TABLE [dbo].[Table1](
[ID] [int] NULL,
[Number] [INT] NULL,
[Description] [varchar](20) NULL
) ;
GO
--TABLE...
February 2, 2017 at 5:40 am
Apologies for the format....I couldn't explain in detail..
Thank You for the replies....
August 1, 2016 at 1:24 am
Hi Sean,
DDL for my target looks like:
CREATE TABLE Equipment_TGT(
[Equipment_ID] [bigint] NOT NULL,
[Code] [nvarchar](50) NOT NULL,
[Description] [nvarchar](100) NOT NULL,
[TreeLevel] [smallint] NOT NULL,
[Parent_Id] [int] NULL,
[Parent_Code] [nvarchar](50) NOT NULL,
CONSTRAINT [pk_Equipment] PRIMARY KEY CLUSTERED...
April 30, 2015 at 1:47 am
Hi ...I got sample DDL's
CREATE TABLE Equipment(
[Equipment_ID] [bigint] NOT NULL,
[Version] [int] NOT NULL,
[Code] [nvarchar](50) NOT NULL,
[Description] [nvarchar](100) NOT NULL,
[IsActive] [bit] NOT NULL,
[TreeLevel] [smallint] NOT NULL,
[Parent_Id] [int] NULL,
CONSTRAINT [pk_Equipment] PRIMARY KEY...
April 29, 2015 at 4:59 am
We do not have separate Parent table.
How do i join the child table with itself to get the Parent_ID codes?
Thanks,
March 25, 2015 at 10:17 am
Thanks andy...
We have like after 40 characters the unit of measure is place in the description field. We have more than one space between the description and unit of measure.
March 17, 2015 at 4:18 am
Thanks for the reply...for the queries:
its like Five tasks run parallelly under which we have other tasks.
The mappings all are there already, i need to try improve the performance.
Its always...
January 14, 2015 at 7:19 am
Hi Zzartin...
I am still getting the error
'Msg 241, Level 16, State 1, Line 1
Conversion failed when converting date and/or time from character string.'
the column has below sample records :
940930
941027
941205
950117
0
1001213
1001214
0
1141128
1141129
1141130
Thanks...
December 10, 2014 at 12:57 am
Thanks guys for the reply's
Thanks Jason...The one with Varchar is working for me. But In some of the Columns we have '0' for which the conversion is failing. Can you...
December 9, 2014 at 12:57 am
Hi Sean,
I tried writing the function
CREATE FUNCTION dbo.Convert_Date (@date_column decimal(7,0))
Returns date as begin
declare @date date
set @date = CONVERT(DATE,CASE WHEN LEFT(@date_column,1) = '1' THEN '20'
ELSE '19' END + RIGHT(@date_column,6), 112)
RETURN...
November 26, 2014 at 12:21 am
Viewing 15 posts - 1 through 15 (of 17 total)