Viewing 12 posts - 1 through 12 (of 12 total)
Sorry my misatke..I copied wrong data.
Here is the correct one:
CREATE TABLE #Data1
(
[a] [char] (2)NOT NULL,
[Char] (2)NOT NULL,
[Odate] [int] NOT NULL
)
INSERT INTO #Data1
SELECT 'a1','b1',20080129
UNION
Select 'a1','b1',20080226
--March month is missing
UNION
Select 'a1','b1',20080630
UNION
Select 'a1','b1',20080730
UNION
Select...
July 14, 2009 at 12:10 am
Hi,
I am able to find the missing months.What I am looking for is some fast way to roll up the data in a report I have shown in second table...
July 13, 2009 at 5:35 am
See if this is what you want.
select * from tbNames where nId in (select nId from tbOldNames where nParent=@nParent OR @nParent='ALL')
The above query will return all the records when you...
July 6, 2009 at 11:08 pm
Hi,
yes you can use pivot in the following way
SELECT Name,[1] as [1-2009],[2] as [2-2009]
FROM
(
SELECT NAME,Month,Year,Value
FROM #t
) p
PIVOT
(
MAX (Value)
FOR [MONTH] IN
([1],[2])
) AS pvt
Parul
June 29, 2009 at 5:37 am
is this you looking for?
select host_name()
June 29, 2009 at 5:22 am
John,
I checked the length of the field and column. They are in sync.Also when I re ran my package, it executed without any problem. I am looking for the reason...
June 29, 2009 at 2:04 am
You are correct Jeff.Seth's approach was the fastest.. I had some 280000000 + records in my tables wherein I have to populate the NULL values. Using seth's appraoch I was...
December 18, 2008 at 2:42 am
a big thank you to each one of you guys. All the solution provided are working for me. Only thing I have to check is to find the best performing...
October 24, 2008 at 6:26 am
Hi Seth
Thanks for sharing the link of the articale. I tried understanding but I was not able to understand it to the extent to implement in a way I...
October 24, 2008 at 1:22 am
This is coming from a free text box from the front end alongwith other text and it is stored in the database in a column
The value is something like this
"Ideally...
July 27, 2007 at 8:41 am
Use Northwind
ALTER PROC TEST(
@DATABASENAME VARCHAR(30),
@COUNTOUT INT OUTPUT
)
AS
BEGIN
DECLARE @v_SQL nVARCHAR(4000)
DECLARE @COUNT INT
SET @V_SQL='SELECT @COUNT=COUNT(*) FROM '+@DATABASENAME+'..Authors'
EXEC SP_EXECUTESQL @V_SQL,N'@COUNT INT OUTPUT',@COUNT OUTPUT
SET @COUNTOUT=@COUNT
RETURN @countout
END
Alter PROC CALL
AS
BEGIN
DECLARE @sql...
July 27, 2006 at 3:53 am
can you provide example??
BTW check this out. if it works for you
BEGIN
DECLARE @Col varchar(20)
DECLARE @val varchar(20)
SET @col='ABC'
SET @val='XYZ'
exec ('SELECT * FROM SUBJECT WHERE ' + @Col...
July 26, 2006 at 5:34 am
Viewing 12 posts - 1 through 12 (of 12 total)