Viewing 15 posts - 76 through 90 (of 443 total)
CirquedeSQLeil (5/20/2010)
Atif Sheikh (5/20/2010)
Why dont you write the query as;
Select Sum(CPC)
from campaignclicks
where campaignID = 8
Throw in the isnull and it seems this would work as well.
Very right. But I...
May 20, 2010 at 10:23 pm
elutin (5/20/2010)
declare @pInput varchar(max)
set @pInput = 'A123,B123,C123,D123,E123,F123'
;with split
as
(
select CASE WHEN LEN(@pInput)= 0 THEN ''
...
May 20, 2010 at 5:27 am
If you dont have fnSplit function, here is the code;
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE function [dbo].[fnSplit]
(@pString nvarchar(max),@pSplitChar char(1))
returns @tblTemp table (tid int,value varchar(1000))
as
begin
declare @vStartPositionint
declare @vSplitPositionint
declare @vSplitValuevarchar(1000)
declare @vCounterint
set @vCounter=1
select @vStartPosition =...
May 20, 2010 at 5:02 am
I hope this will help;
Declare @StringInput varchar(100)
Declare @v-2 varchar(100)
Declare @v1 varchar(100)
Set @StringInput = '199:141,3,5,7,4:56,43,58,5:34,67r,234'
Declare @OutputTable TABLE ( [String1] VARCHAR(10),[String2] VARCHAR(10))
Declare C1 Cursor for Select [value] from dbo.fnSplit(@StringInput,',')
Open C1
Fetch...
May 20, 2010 at 5:02 am
Try fnSplit. Its a Table valued function. This function will return the character separated values in a table.
By using this function, there will be no need of creating temporary table....
May 20, 2010 at 4:09 am
Is there any userID so that you can identify which user is adding/updating/Deleting a row from his/her own pool? I think it should be done on the basis of...
May 20, 2010 at 3:55 am
I have executed the queries posted in the article. The table product.tblProduct have an index on Name Column. This column is used with LIKE operator in the query. If the...
May 20, 2010 at 2:03 am
Dynamic SQL is the last thing to do. I use and prefer the following way;
SELECT [Name],
[Color],
...
May 20, 2010 at 1:06 am
Why dont you write the query as;
Select Sum(CPC)
from campaignclicks
where campaignID = 8
May 20, 2010 at 12:49 am
I dont think that the Logic of both results will be same. What I mean is that the logic for Condition 1=1 would be different from the logic of 1=0...
May 20, 2010 at 12:40 am
Another Option;
Create Table #tempA
(
AID int,
ACol1 varchar(100),
ACol2 varchar(100)
)
Create Table #tempB
(
BID int,
BCol1 varchar(100),
BCol2 varchar(100),
BCol3 varchar(100)
)
IF 1 <> 1
BEGIN
Insert into #tempA
Select ID,Code,[Name] From dbo.countries
Select * from #tempA
--And Further Logic of on...
May 20, 2010 at 12:30 am
Are you looking for dependent Tables in SP / Function?
if Yes,
select distinct *
from
(
SELECT sd.object_id object_id,
OBJECT_NAME(sd.object_id) OBJECT_NAME,
OBJECT_NAME(referenced_major_id) Ref_OBJECT_NAME, referenced_major_id Ref_OBJECT_Id
FROM...
May 19, 2010 at 5:13 am
Can you please post some test data?
May 18, 2010 at 4:38 am
Viewing 15 posts - 76 through 90 (of 443 total)