Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: Missing Data range in a set

    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...

  • RE: Missing Data range in a set

    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...

  • RE: Conditional Where clause which has 'in' .

    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...

  • RE: To Pivot or not to Pivot

    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

  • RE: Obtaining the name of machine you are running a SQL statement from

    is this you looking for?

    select host_name()

  • RE: Bulk load data conversion error (truncation) for row 1

    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...

  • RE: Updating Values Without Cursor

    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...

  • RE: Updating Values Without Cursor

    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...

  • RE: Updating Values Without Cursor

    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...

  • RE: Invalid Characters in XML

    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...

  • RE: Having problems calling a procedure which returns output variables from another proc.

    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 NVARCHAR(100)

    DECLARE @COUNTOUT...

  • RE: Create a dynamic query

    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...

Viewing 12 posts - 1 through 12 (of 12 total)