Viewing 15 posts - 76 through 90 (of 568 total)
Hi,
Many methods are there to identify / delete the duplicate data from the table, Refer these articles
January 11, 2010 at 9:24 pm
Hi,
Repeated post, discussion already started here
http://www.sqlservercentral.com/Forums/Topic845782-338-1.aspx
January 11, 2010 at 9:04 pm
Hi,
This check may provide in various method, use the trigger in the Master table (#Territory ) to validate the combination are exists during add the record, and in the procedure...
January 11, 2010 at 8:58 pm
Hi David,
In first post you say the data type is int, but the account no having the 00 in front of the first 10 digit, this is confusion, check the...
January 11, 2010 at 8:45 pm
Chan Wai Yin (1/8/2010)
Any single SQL statement that can combine the above 2 sql into 1 sql?
Hi,
Instead of creating table tbl_a, you get directly from
select col1,col2 into tbl_a...
January 8, 2010 at 9:48 pm
Hi,
You mentioned same table, but different columns,
Post you full table schema with data to understand better.
January 8, 2010 at 8:33 pm
Hi,
Both gives you correct direction for what you post first, but now you needs, the id repeated and counts the genders.
DECLARE @data TABLE
(test_id INT ,
gender INT...
January 8, 2010 at 12:30 am
In the end, I'm looking to have this as the output:
SQL Server Instance | # DB's < 100GB | # DB's 100-500GB | DB's 500GB - 1TB | DB's >...
January 8, 2010 at 12:07 am
Hi,
The Cursors is not always bad, in there is no Option to using other method, that time the programmers uses the Cursors.
And you need to know the no of...
January 7, 2010 at 8:59 pm
Hi,
It’s very hard to assume the table schema in your statement, however the union operation says from first line data type is so must maintain to all union columns
Col1 ServiceLineID,...
January 7, 2010 at 8:40 pm
Hi, Try this
CREATE TABLE #TEMP
(
SLNO INT IDENTITY(1,1),
EID VARCHAR(5),
RDATE DATETIME
)
INSERT INTO #TEMP
SELECT '001','2009-01-01'
UNION ALL
SELECT '002','2009-01-05'
UNION ALL
SELECT '003','2009-01-10'
UNION ALL
SELECT '004','2009-01-15'
SELECT A.*,B.RDATE FROM
#TEMP A LEFT OUTER JOIN #TEMP B
ON A.SLNO = B.SLNO-1
January 7, 2010 at 4:23 am
select (case when ((a.SourceSegment= b.Segment)or(a.SourceTerritory= b.Territory)) then b.Terr_ID else '' end),
(case when ((a.TargetSegment = c.Segment) or (a.TargetTerritory = c.Territory)) then c.Terr_ID else '' end)
from #TER_TER_ALIGNMENT a , #Territory b, #Territory...
January 7, 2010 at 1:02 am
Hi Jeff,
I aware of that article, ok, I point it out the tally table.
January 6, 2010 at 11:58 pm
Hi Jeff,
Thanks, actually I need to put the tally table there, but most people ask the question, what the tally table is. That’s why the little numbers table.
January 6, 2010 at 11:25 pm
create table #TER_TER_ALIGNMENT
(
SourceSegment varchar(2),
SourceTerritory varchar(2),
TargetSegment varchar(2),
TargetTerritory varchar(2)
)
create table #Territory
(
Terr_ID varchar(5),
Segment varchar(2),
Territory varchar(2)
)
create table #Territory_Assoc
(
Terr_Assoc_ID int identity(1,1),
FromTerrID varchar(5),
ToTerrID varchar(5)
)
insert into #TER_TER_ALIGNMENT
select 'S1','T1','S3','T3'
union all
select 'S2','T2','S4','T4'
union all
select 'S3','T3','S2','T2'
union all
select 'S4','T4','S1','T1'
insert...
January 6, 2010 at 10:59 pm
Viewing 15 posts - 76 through 90 (of 568 total)