Forum Replies Created

Viewing 15 posts - 976 through 990 (of 2,894 total)

  • RE: Need help for update query

    CELKO (11/2/2012)


    ... This is a job for a MERGE INTO statement. Here is a guess:

    UPDATE Something_Destination AS D

    USING Something_Staging AS S

    ...

    You wanted to use MERGE, didn't you:

    MERGE Something_Destination...

    _____________________________________________
    "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: Give Varibale as column name

    Jeff Moden (11/3/2012)


    ... Take the negativity out and you could probably get it down to 6 months or so.

    +100

    _____________________________________________
    "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 many rows in a table before using a clustered index?

    GSquared (11/2/2012)


    GilaMonster (11/2/2012)


    Stewart "Arturius" Campbell (11/2/2012)


    Clustered indexes are best suited for those columns most frequently used in range-based searches.

    I would tend to disagree with that, but that's just me.

    Not just...

    _____________________________________________
    "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: Give Varibale as column name

    It's possible with using Dynamic Sql. Here just a small sample, but you should be able to get your one from here:

    -- that could be your proc input parameter:

    DECLARE @ColumnName...

    _____________________________________________
    "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: T-SQL to call the SQL Parse "function"

    Jason Selburg (11/2/2012)


    Eugene Elutin (11/2/2012)


    Try this:

    DECLARE @sql VARCHAR(8000) = 'SELECT * FROM FROM sys.objects'

    SET @sql = 'SET NOEXEC ON;

    ' + @sql + '

    SET NOEXEC OFF;'

    BEGIN TRY

    EXEC...

    _____________________________________________
    "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: New Function

    What I can say? Have you tried to search this site?

    Check it here:

    http://www.sqlservercentral.com/Forums/Topic796803-338-1.aspx#bm796805

    As I said, you don't need to create function for this, especially the one you have which unnecessary...

    _____________________________________________
    "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: WHERE condition..

    kapil190588 (11/2/2012)


    Jason,

    I am getting the data when i run the query that you sent..

    I have added condition in where statement like this:

    where Compare1=Compare2

    But it gives an error that:

    Msg 207,...

    _____________________________________________
    "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: T-SQL to call the SQL Parse "function"

    Try this:

    DECLARE @sql VARCHAR(8000) = 'SELECT * FROM FROM sys.objects'

    SET @sql = 'SET NOEXEC ON;

    ' + @sql + '

    SET NOEXEC OFF;'

    BEGIN TRY

    EXEC (@SQL)

    END TRY

    BEGIN CATCH

    ...

    _____________________________________________
    "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: Removing Null Columns

    Just output the content of your @Command before executing so you can see the built SQL statement.

    You can debug it and find what is wrong with it.

    _____________________________________________
    "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: New Function

    You don't need a function for this.

    Just use Datediff:

    select DATEDIFF(year,@in_DOB,GetDate())

    _____________________________________________
    "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: Order by is not effective. please provide solution

    what is inside of

    @SortFieldIndex and @OrderBy ?

    Looks like you are mixing dynamic and static sql together, it's not going to work...

    _____________________________________________
    "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: RE:- HELP! Cursor results displayed in table

    Sean Lange (10/31/2012)


    Mackers (10/31/2012)


    Hi Chris,

    The SQL is quite hard to read (and I have never come across case statements & cursors used like that before) but rather than using 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: Time out

    Change SqlCommand.CommandTimeout to higher number. Default is 30 sec...

    _____________________________________________
    "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: Get the min,max Time

    Is any rule for a splitting by Rid?

    Will you pass Rid range boundaries as input parameters into stored proc or you will have them stored in some other table?

    _____________________________________________
    "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: A maths puzzle for anyone up for a challenge!

    ...

    So, it does look like I'm asking the impossible - it isn't mathematically possible to turn that many characters into an integer datatype which will fit into a bigint.

    Yes, exactly...

    _____________________________________________
    "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 - 976 through 990 (of 2,894 total)