Forum Replies Created

Viewing 15 posts - 9,031 through 9,045 (of 26,490 total)

  • RE: Generate Months from unique records with different date ranges

    Kyalo (1/7/2013)


    Thank you Folks, yes I am brand new in this forum. From the two questions, it appears as if I have already included the suggested test data (the two...

  • RE: T-SQL

    Since everyone is playing word games why don't we look at this one:

    by default a Primary key creates a Clustered Index

    This should really say:

    by default a Primary key creates a...

  • RE: Compare one row with another in a Table !

    nitin_456 (1/5/2013)


    Is there any other way to achieve this without CTE.

    Not sure why you don't want the cte version, but this works (though untested):

    SELECT A.House_acc ,

    ...

  • RE: T-SQL

    L' Eomot Inversé (1/4/2013)


    Dineshbabu (1/3/2013)


    I think few days back same conversation happened... Unique constraint is different from unique index. While creating unique index we can create with filter and that...

  • RE: Assigning current date without time value to column

    Cadavre (1/4/2013)


    Lynn Pettis (1/4/2013)


    Actually:

    DELETE FROM TABLE WHERE (CREATION_D = DATEADD(DAY, DATEDIFF(DAY, 0, ?? ), 0));

    SET NOCOUNT ON;

    DECLARE @a DATETIME;

    SET @a = GETDATE();

    --First

    SELECT DATEADD(DAY, 0, DATEDIFF(DAY, 0, @a ));

    --Second

    SELECT DATEADD(DAY, DATEDIFF(DAY,...

  • RE: Assigning current date without time value to column

    Cadavre (1/4/2013)


    Lynn Pettis (1/4/2013)


    Actually:

    DELETE FROM TABLE WHERE (CREATION_D = DATEADD(DAY, DATEDIFF(DAY, 0, ?? ), 0));

    SET NOCOUNT ON;

    DECLARE @a DATETIME;

    SET @a = GETDATE();

    --First

    SELECT DATEADD(DAY, 0, DATEDIFF(DAY, 0, @a ));

    --Second

    SELECT DATEADD(DAY, DATEDIFF(DAY,...

  • RE: Assigning current date without time value to column

    Cadavre (1/4/2013)


    10e5x (1/4/2013)


    So if i have an sql statement in my execute sql task that looks something like this:

    Delete from TABLE where (CREATION_D = ?)

    CREATION_D is the column i am...

  • RE: cte - error 'has fewer columnns than were specified in the column list

    Not enough single quotes in your dynamic sql:

    DECLARE @sql VARCHAR(max)

    SET @sql = '

    ; WITH list_cte (table_name,field_name,fld_id,sql_value,field_value,exporttype)

    AS

    (

    SELECT table_name,field_name,fld_id,CAST('''' AS VARCHAR(8000)) as sql_value, CAST('''' AS VARCHAR(8000)) AS field_value,exporttype

    FROM #configdetail

    WHERE LEN(LTRIM(RTRIM(table_name))) >...

  • RE: T-SQL

    SQLRNNR (1/3/2013)


    dineshbabus (1/3/2013)


    oh.. unique constraint can allow more than one null value.. I don't think so.. Please give me some xample...

    Here is the example

    http://www.sqlservercentral.com/Forums/FindPost1398825.aspx

    Took this a bit further. You...

  • RE: Assigning current date without time value to column

    Sean Lange (1/4/2013)


    Agreed. Your best option is to use datetime. I would strongly urge you not to do something you will regret like using a varchar for datetime. If you...

  • RE: Want to Calculate Business Working hours

    karthik_ayyagari (1/4/2013)


    Yes Maz,

    For the time being can you write a procedure which can calculate number of weekends between two datetimes so that i can delete the n*48 hrs from the...

  • RE: Function taking long time

    I don't have time right now to do anything real with the code, but if anyone is interested I have reformatted the code to make it a little bit easier...

  • RE: Turning raw data into a grid layout

    Bhuvnesh (1/3/2013)


    i tried it with PIVOT but its more resource intensive (as compared to other provided solution ) . can we avoid UNION here

    SELECT CompanyName, 'Low' as Type,

    [Sunday],...

  • RE: String REPLACEMENT Question

    zombieisdead2020 (1/3/2013)


    The recursive CTE may not scale well as the length of the strings increase. Both sets of options really need to be tested to determine which is better...

  • RE: String REPLACEMENT Question

    zombieisdead2020 (1/3/2013)


    declare @t table(id int, string varchar(500))

    insert @t values (1,'abcABC,0123456789~!@'),(2,'123abcdefghijklmnopqrstuvwzyz');

    with cte1 as

    (

    select id,

    0 nbr,

    cast(string as...

Viewing 15 posts - 9,031 through 9,045 (of 26,490 total)