Viewing 15 posts - 271 through 285 (of 568 total)
Hi,
search with WILDCARD is working well in the varchar/char columns
and if the @log_number is null then
try this
where
username like ('%' + @username + '%')
[sys] like ('%' + @sys+...
August 20, 2009 at 2:44 am
Hi,
Also try this
create table #temp
(
slno int,
GRI int,
JUMPSTART int,
REMASTERS int
)
insert into #temp
select 11,1,2,3
union all
select 22,2,3,4
union all
select 33,3,4,5
union all
select 44,4,5,6
declare @result varchar(10)
set @result = 'GRI'
select * from #temp
where GRI = (case when...
August 19, 2009 at 2:26 am
hi,
nice coding by Dave and clive
suppose the count occure same for 2 cars then?
like
insert into #cars values('ford')
insert into #cars values('ford')
insert into #cars values('ford')
insert into #cars values('ford')
insert into #cars values('honda')
insert...
August 18, 2009 at 3:23 am
DATETIME to INT
declare @time1 datetime
set @time1 = getdate()
select convert(int,@time1)
print @time1
INT to DATETIME
declare @time int
set @time = 40042
select convert(datetime,@time,112)
print @time
August 18, 2009 at 3:04 am
Hi,
try this
select convert(datetime,40010/*your int value*/,112/*your format*/)
August 18, 2009 at 2:59 am
Hi,
Are you sure this int column having 10 digit characters?
August 18, 2009 at 2:50 am
Hi,
Ref this Topic related to the SETUSER (user can process with the other user name)
http://www.sqlservercentral.com/Forums/Topic767655-146-1.aspx
August 17, 2009 at 4:33 am
hI,
Also Try this
DECLARE @values VARCHAR(500)
SELECT @values = coalesce(@values+',','')+GENDER_DESC
FROM MST_GENDER
GROUP BY GENDER_DESC
SELECT @values
August 17, 2009 at 4:12 am
The TEST table having some the duplicate records
So that the variance occurs
create table #main
(
slno int,
col1 varchar(10),
col2 varchar(10)
)
insert into #main
select 1,'10','10'
union all
select 2,'20','20'
union all
select 2,'30','30'
union all
select 2,'30','30'
select avg(cast(col2 as decimal(9,2))) from...
August 14, 2009 at 1:31 am
create table test
(
EmpID int,
EmpName varchar(20)
)
insert into test
select 1,'Ashly'
union all
select 2,'Bob'
union all
select 3,'Charles'
CREATE procedure Emp_name_proc
(
@emp_id varchar(100)
)
as
begin
declare @abc varchar(100)
select @abc = @emp_id
select @abc = 'select '''...
August 14, 2009 at 12:41 am
From the codes i am getting the following results
select AVG(cast(mrks as int)) AVER from TEST
AVER
504
select AVG(cast(mrks as decimal(9,2))) AVER from TEST
AVER
504.271448
August 13, 2009 at 10:47 pm
create procedure Emp_name_proc
(
@emp_id int
)
as
begin
1) output like
‘Bob’
‘Charles’
select EmpName from Employee/*with lock options*/
where EmpID = @emp_id
union
select EmpName from Employee/*with lock options*/
where EmpID = @emp_id+1
2) output like ‘Bob,Charles’
declare @concat nvarchar(1000)
select @concat= COALESCE(@concat+','...
August 13, 2009 at 10:25 pm
A1)
create procedure Emp_name_proc
(
@emp_id int
)
as
begin
select EmpName from Employee/*with lock options*/
where EmpID = @emp_id
end
A2)
insert into TempEmployee
exec Emp_name_proc 2
And it’s not advisable to create the procedure with SP_
Because it’s also reflects/access to...
August 13, 2009 at 9:34 pm
Viewing 15 posts - 271 through 285 (of 568 total)