Viewing 15 posts - 346 through 360 (of 569 total)
Hi Shaw,
Another topic having the same issue
See the link
http://www.sqlservercentral.com/Forums/Topic743085-149-1.aspx
I will edit the link there.
ARUN SAS
June 27, 2009 at 3:53 am
Duplicate post
Ans the post in : http://www.sqlservercentral.com/Forums/Topic743086-149-1.aspxARUN SAS
June 27, 2009 at 2:30 am
Hi,
insert the table value as null,don't pass the value like '',' '
or
put the table column as null
like
CREATE TABLE #TEMP
(
DATE1 DATETIME NOT NULL,
DATE2 DATETIME NULL
)
INSERT INTO #TEMP
SELECT '2008-05-05',NULL
UNION ALL
SELECT '','2008-05-06'
SELECT *FROM...
June 27, 2009 at 2:27 am
manikandan (6/26/2009)
DECLARE @var intDECLARE @db_name varchar(128)
DECLARE @cmd varchar(1280)
DECLARE @tsql VARCHAR(128)
DECLARE @table VARCHAR(128)
Hi,
use the Nvarchar date type in Declare statements and then try,
like..
DECLARE @db_name Nvarchar(128)
DECLARE @cmd Nvarchar(1280)
DECLARE @tsql NVARCHAR(128)
DECLARE...
June 27, 2009 at 2:10 am
Grinja (6/26/2009)
The result should look similar to the result from the SELECT query (in the sample data below) except for the following:
1. I need to provide for upto 5...
June 26, 2009 at 10:42 pm
Hi,
Try this
create table #TableA
(
ID int,
Name varchar(10)
)
insert into #TableA
select 1,'Sunil'
union all
select 2,'Anil'
union all
select 3,'Amit'
union all
select 4,'Raj'
create table #TableB
(
ID int,
Address Varchar(20)
)
insert into #TableB
select 1,'Mumbai'
union all
select 2,'pune'
select a.ID,a.Name
from #TableA a ,
#TableB b
where...
June 26, 2009 at 12:58 am
ZA_Crafty (6/25/2009)
you can either pass an ID, or null to return all records. But the boolean will only select true records.
Hi,
try this
where
SomeID = case when @SomeID is not null then...
June 25, 2009 at 4:16 am
descentflower (6/25/2009)
csv values in rows without using a while loop
Hi,
try this
--create table #temp (name1 varchar(5))
declare @s-2 varchar(500)
set @s-2='1,2,3,4,5'
select @s-2 = 'select ''' + replace (@s,',',''' union select ''')+''''
insert into #temp...
June 25, 2009 at 2:13 am
Grinja (6/25/2009)
In my real world scenario it may happen that there are more than 2 Banks linked to the client but I only need two.
Hi,
This may be similar requirement,
Please...
June 25, 2009 at 1:11 am
Saravanan_tvr (6/23/2009)
10 , 0 , 20
0 , 5 , 0
here I...
June 24, 2009 at 12:18 am
Hi,
Try this
Create Table #temp
(
slno int identity(1,1),
LASTNAME varchar(20),
FIRSTNAME varchar(20),
CITY varchar(20),
PHONE varchar(20),
STARTDATE datetime,
ENDDATE datetime
)
insert into #temp
select 'Doe','John','Houston','2817321432','02/01/09','02/02/09'
union all
select 'Doe','John','Houston','2817321432','02/03/09','02/06/09'
union all
select 'Mao','John','Houston','2817321432','02/03/09','02/06/09'
union all
select 'Mao','John','Houston','2817321432','02/03/09','02/06/09'
select LASTNAME,FIRSTNAME,CITY,PHONE,
min(STARTDATE)STARTDATE,
min(ENDDATE)ENDDATE,
max(STARTDATE)STARTDATE2,
max(ENDDATE)ENDDATE2
from #temp
group by LASTNAME,FIRSTNAME,CITY,PHONE
ARUN SAS
June 23, 2009 at 9:32 pm
Hi,
Try the another method
Create procedure UPDATE_TABLE
(
@PK_TableID int,
@para1 int = NULL,
@para2 nvarchar(15) = NULL
...
as
begin
set nocount on
update dbo.MyTable
set Col1 = isnull(@para1,Col1),
Col2 = isnull(@para2,Col2),
Col3 = isnull(@para3,Col3)
...
...
where TableID = @PK_TableID
ARUN SAS
June 22, 2009 at 5:17 am
Hi,
try this
declare @searchfield nvarchar(100),
@searchtext nvarchar(100)
SET @searchfield = '1,2'
SET @searchtext = '5'
SELECT * FROM @temp
where Assesmentname = (case when @searchfield like '%1%' then @searchtext else null end)
or
NoOfQuestions =...
June 22, 2009 at 2:46 am
June 16, 2009 at 4:00 am
Viewing 15 posts - 346 through 360 (of 569 total)