Viewing 15 posts - 16 through 30 (of 81 total)
I hope you are looking for this query
SELECT TOP 100 WITH TIES NameField
FROM table
GROUP BY NameField
ORDER BY COUNT(NameField) DESC
October 28, 2006 at 7:45 pm
Hope this helps
DECLARE @tbl TABLE
(RowId VARCHAR(20),
RValue VARCHAR(30),
Lineage VARCHAR(3000) DEFAULT '',
Depth INT)
insert into @tbl(RowId,RValue) values('WV', 'Kanawha')
insert into @tbl(RowId,RValue) values('WV', 'Putnam')
insert into @tbl(RowId,RValue) values('WV', 'Dodridge')
insert into @tbl(RowId,RValue) values('WV', 'Rhone')
insert into @tbl(RowId,RValue) values('OH',...
October 24, 2006 at 4:40 pm
Also you could try this.
SELECT PARSENAME('9.200.12.13', 3) AS 'SecondOctet' UNION ALL
SELECT PARSENAME('11.200.12.13', 3) AS 'SecondOctet' UNION ALL
SELECT PARSENAME('120.200.12.13', 3) AS 'SecondOctet' UNION ALL
SELECT PARSENAME('10.0.12.13', 3) AS 'SecondOctet' UNION ALL
SELECT PARSENAME('10.10.12.13',...
October 24, 2006 at 10:02 am
I hope you are looking for this
Give a try
DECLARE @tbl TABLE
(RowId VARCHAR(20),
RValue VARCHAR(30),
Lineage VARCHAR(3000) DEFAULT '',
Depth INT)
insert into @tbl(RowId,RValue) values('WV', 'Kanawha')
insert into @tbl(RowId,RValue) values('WV', 'Putnam')
insert into @tbl(RowId,RValue) values('WV', 'Dodridge')
insert into @tbl(RowId,RValue) values('WV', 'Rhone')
insert into @tbl(RowId,RValue) values('OH', 'Buckeye')
insert...
October 24, 2006 at 8:32 am
Try this
DECLARE @STR VARCHAR(20)
SELECT @STR = 'HELLO'+CHAR(10)+'HELLO'+CHAR(13)+'DDD FFF'
PRINT @STR
PRINT REPLACE(REPLACE(@STR,CHAR(10),''),CHAR(13),'')
Ram
October 24, 2006 at 7:19 am
You may try like this.
SET DATEFORMAT dmy
GO
SELECT CONVERT(VARCHAR(10),CAST('24-10-2006' AS DATETIME),112)
Ram
October 24, 2006 at 7:07 am
Hi John,
Appreacited, If you have really answered the below error at first sight.
Server: Msg 2812, Level 16, State 62, Line 46
Could not find stored procedure 'Insert into #tempTrained EmpID...
October 19, 2006 at 12:58 pm
Hope this link help you out
http://www.sqlservercentral.com/memberservices/updatescript.asp?Approve=y&scriptid=1789
Ram
October 19, 2006 at 7:06 am
If some body has questions and gets stranded, please try to help them out and then start giving big big lectures!
October 18, 2006 at 1:45 pm
Try this
DECLARE @tbl TABLE
(RowId INT IDENTITY(1,1),
Col1 INT,
Col2 INT,
Col3 INT,
Col4 INT)
INSERT INTO @tbl VALUES(5,10,12,0)
INSERT INTO @tbl VALUES(4,2,12,15)
INSERT INTO @tbl VALUES(6,3,0,5)
SELECT RowId,
MinValues=
(SELECT MIN(D1) FROM
(SELECT CASE WHEN Col1 = 0 THEN NULL ELSE Col1 END AS D1
UNION...
October 18, 2006 at 1:02 pm
Hello,
It is a syntax error.
Replace "Wink" face with ")", then it will work
October 18, 2006 at 12:08 pm
Ok, Got it
declare @table table (ad_str1 varchar(50))
insert @table
select 'apple avenue w' union all
select 'melon road e' union all
select 'watermelon circle n'union all
select 'banana durian crossing s'
UPDATE @table
SET ad_str1=
REPLACE(ad_str1,
(
CASE WHEN CHARINDEX(' W',ad_str1) >...
October 18, 2006 at 9:07 am
Try this
declare @table table (ad_str1 varchar(50))
insert @table
select 'apple avenue w' union all
select 'melon road e' union all
select 'watermelon circle n'union all
select 'banana durian crossing s'
select * from @table
UPDATE @Table
SET ad_Str1 =...
October 18, 2006 at 8:12 am
October 17, 2006 at 1:05 pm
Hi
Try this
DECLARE @ProdList VARCHAR(100)
SET @ProdList = 'regulations leaves employee'
SELECT *
FROM Regulations AS REG
INNER JOIN Reason AS REAS
ON REG.Reg_ID = REAS.Reason_Reg_Id
AND ((CHARINDEX(CONVERT(NVARCHAR,REG.Reg_Name),@ProdList) > 0)
OR (CHARINDEX(CONVERT(NVARCHAR,REG.MaxDuration),@ProdList) > 0)
OR (CHARINDEX(CONVERT(NVARCHAR,REG.Reason_Text),@ProdList) > 0))
INNER JOIN Eligibility AS ELIG
ON REG.Reg_ID = ELIG.Elig_Reg_ID
AND (CHARINDEX(CONVERT(NVARCHAR,ELIG.Eligibility_Text),@ProdList) >...
October 17, 2006 at 12:49 pm
Viewing 15 posts - 16 through 30 (of 81 total)