Viewing 15 posts - 811 through 825 (of 1,923 total)
Try this:
Select
prdid as 'product number',
sum(quano) as 'quantity ordered'
from SalesOrderTable
where prdid = 'XYZ'
GROUP BY prdid -- Added this now
Guess you have left the GROUP BY clause 😛
May 2, 2011 at 3:39 pm
A 2-part INSERT might help you..
First INSERT - SourceTable data (only Name col) into Target
Second INSERT - JOIN SourceTable and TargetTable and insert into TargetConnection..
May 2, 2011 at 2:28 am
Got it; Now, as Dixie says, either Quirky Update or Cursor can save you. I am still pondering if it will be possible by a Recursive-CTE..Got to think..
May 1, 2011 at 11:40 pm
I couldnt get the logic behind the grouping.. can you please be more elaborate on your explanation?? This certainly is do-able with set-based code..
May 1, 2011 at 11:25 pm
You can utilize BCP commands and call xp_cmdshell to execute the BCP statements..
To read abt BCP, click here
April 28, 2011 at 3:41 pm
calvo (4/28/2011)
ColdCoffee (4/28/2011)
toddasd (4/28/2011)
@WayneS
: You write some great code.I totally concur 🙂 he is awesome, like how The Miz in WWE says, Wayne is awesome 🙂
lol...love it. You just worked...
April 28, 2011 at 2:56 pm
toddasd (4/28/2011)
@WayneS
: You write some great code.
I totally concur 🙂 he is awesome, like how The Miz in WWE says, Wayne is awesome 🙂
April 28, 2011 at 1:54 pm
Stefan Krzywicki (4/28/2011)
ColdCoffee (4/28/2011)
Stefan Krzywicki (4/28/2011)
Also, you don't have to use a CTE for this, you can just use a subquery
Aren't CTE and SubQuery synonymous except for the fact that...
April 28, 2011 at 1:31 pm
Stefan Krzywicki (4/28/2011)
Also, you don't have to use a CTE for this, you can just use a subquery
Aren't CTE and SubQuery synonymous except for the fact that CTE has an...
April 28, 2011 at 12:30 pm
Stefan Krzywicki (4/28/2011)
ColdCoffee (4/27/2011)
declare @table table
( catid int, catname varchar(25) , refid int )
insert into @table values
(1 ,'Lenovo', 21),
(2 ,'Sony', 22),
(2 ,'Sony', 22),
(3 ,'Dell', 23),
(4 ,'Toshiba', 24),
(4 ,'Toshiba', 24)
;...
April 28, 2011 at 12:07 pm
Change
SELECT DATEADD(MM, N,@StartDate) [Month]
FROM NumbersTable
WHERE N < @NumOfMonths
to
SELECT DATEADD(MM, N,@StartDate) [Month]
INTO dbo.TempTable -- Add this line alone
FROM NumbersTable
WHERE N < @NumOfMonths
Look into the commented line 🙂
April 28, 2011 at 3:00 am
No Usha, you CANNOT join 1 SPs.. only tables and views can be joined..
April 28, 2011 at 2:51 am
vicki528 (4/28/2011)
April 28, 2011 at 2:50 am
How about this?
DECLARE @StartYear INT
,@EndYear INT;
SET @StartYear = 2010
SET @EndYear = 2011
DECLARE...
April 28, 2011 at 2:09 am
It would help great up if you show the real data, as in, mock-up of ur real data instead of the column names.. and also all the columns in the...
April 27, 2011 at 9:52 pm
Viewing 15 posts - 811 through 825 (of 1,923 total)