Forum Replies Created

Viewing 15 posts - 1,996 through 2,010 (of 2,894 total)

  • RE: Left Join Issue

    Not very representable setup. May be if you supply exact result you are expecting from your setup, it will be easeier to answer...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Insert huge data from a views to one table

    There is "The One" here:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Select columns dynamically

    Cadavre (3/7/2012)


    ... The original question was reasonably interesting and the dynamic SQL for any table was an entertaining intellectual challenge.

    Have you heard about solving SUDOKU in T-SQL?

    http://www.sqlservercentral.com/scripts/67539/

    I guess...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Insert huge data from a views to one table

    Fasterst possible insert in T-SQL can be achieved when using SELECT INTO...

    You will need to drop your table before doing so.

    The next option is to batch your insert. Could you...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Erratic behaviour of function when invoked via sqlcmd

    Stephen Grimshaw (3/7/2012)


    I have a function that returns a string. The output is defined as varchar(max). The string returned usually contains fewer than 100 characters.

    When I select a number of...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Select columns dynamically

    Gentlemen, looks like you have a lot of free time...

    Can some one come up with the reasonable idea for doing it in the first place?

    I do not beleive it's a...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to get the Manager by Manager in SQL

    That is exactly what I was asking for!

    Here we are:

    I guess your setup should be changed to:

    CREATE TABLE #ReportingToPerson

    (

    Staff_ID INT,

    Staff_Name VARCHAR(50),

    Reporting_To_ID INT,

    Department_Head BIT

    )

    INSERT INTO #ReportingToPerson VALUES (1, 'Kumaran', NULL,...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Moving average for the last 4 records

    I don't understand the whole of your question, but I can see that the one of main problem for you is how to list previous four quarters for each of...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to get the Manager by Manager in SQL

    May be my question wasn't clear...

    How the record for 'Senthil' is different to record for 'Karthik'?

    Both have Id's, Name's and Report_To_Id's?

    What identifies Karthik being the user but Senthil -...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Triggers vs Cursors

    MuraliKrishnan1980 (3/7/2012)


    Absolutely correct Eugene. I believe it would be very difficult to load the history records for update without a trigger. I have already informed my team that loading history...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Select columns dynamically

    jcb (3/7/2012)


    Thanks Eugene a nice sugestion!:w00t:

    But I want to know if there any way to trick SP_ExecSQL to pass a object name as a varible do a dynamic SQL as...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Triggers vs Cursors

    What problem your team has with triggers? They don't like the name?

    Loading INSERT into history will be easy without a trigger, as it will need just copy into history...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: create index ... include (colx)

    elect c.name, ic.*

    from sys.index_columns ic

    join sys.indexes i

    on i.object_id = ic.object_id

    and i.index_id = ic.index_id

    join sys.columns c

    on c.object_id = i.object_id

    and c.column_id = ic.column_id

    where i.name = '[IndexName]'

    and i.object_id = object_id('[TableName]')

    and...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Reg: Find no of months for the present quarter given start date and end date.

    mohanbvs (3/7/2012)


    Hi,

    I need a query or function which returns number of months for the present quarter...

    Strange, I always thought that any quarter contains 3 months. You kind of need no...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Select columns dynamically

    jcb (3/7/2012)


    ...

    Is it possible to use the @tableName and @columnName in a safe way with sp_executeSQL?

    ...

    Simples:

    IF NOT EXISTS(SELECT 1 FROM sys.tables WHERE name = @tableName )

    BEGIN

    RAISERROR ...

    END

    IF...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 1,996 through 2,010 (of 2,894 total)