Forum Replies Created

Viewing 15 posts - 8,131 through 8,145 (of 8,731 total)

  • RE: How to use two tables , each from different database into one stored procdure

    Does your linked server is named by its IP address?

    Here's an example:

    SELECT *

    FROM [192.168.0.1].[Adventureworks].[Production].[Product] AS p

    You could also post the code you're using and the error you're getting. You can...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to use two tables , each from different database into one stored procdure

    Use a fully qualified name,

    such as server_name.[database_name].[schema_name].object_name

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Flagging Records within a table of sequenced numbers

    Here's another possible solution.

    SELECT number

    FROM @numbers n1

    WHERE am_sw = 1

    AND 7 = ( SELECT COUNT(*)

    FROM @numbers n2

    WHERE n2.number = n1.number

    AND n2.cc_sw = 0

    AND n2.sequence_number > n1.sequence_number

    AND n2.sequence_number <= n1.sequence_number...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Divide the result of count function

    There's a small mistake on Jack's code. A simple tweak on line 19 will correct it.

    --Corrected line

    CONVERT(INT, CEILING(quantity / CAST( @quanityPerRow AS decimal(10,2)))) AS rowsDesired,

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Convert integer to 4-character alphnumeric representation

    I don't understand why would you want to do that. However, I made a small excercise that might give you an idea.

    WITH cteTally AS(SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL))...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Order by date not by alphabatical order but by usual jan - Feb etc required

    Instead of MONTH( startdatetime) use convert(char(6), startdatetime, 112)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: NOLOCK hint.

    To add something, this serie of articles can help you to understand about locks and some limitations of nolock to prevent them.

    http://aboutsqlserver.com/2011/09/28/locking-in-microsoft-sql-server-table-of-content/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: is it possible to union all two CTEs?

    KoldCoffee (5/1/2013)


    please don't take the sample scripts to literally. They are over simplified, so my question is still... how to combine the results of two scripts sharing identical columns,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: need help in creating a procedure which uses cursor and variables

    I wish I could help you, but I don't understand what you're trying to do.

    Please take a look at the article linked in my signature to obtain better help.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Ok, so it sort of is about SQL....

    Sean Lange (4/18/2013)


    Maybe you should keep that resume handy? That is really scary!!! There are so many things wrong with that it is hard to know where to start. Let's...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Ok, so it sort of is about SQL....

    I was just going to post about some nonsense I've heard an seen in my new job (and it's only my second day)

    I'm changing the code, but I leave the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Convert IP address to Binary (32)

    I'm now correcting my original post to give an alternative solution that runs 6 times slower (aprox) but I'm including the test I did to confirm it.

    --CREATE TABLE BinTest(

    --ip_addressvarchar(15))

    --INSERT INTO...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: send me dowload link for SSIS

    It is included on SQL Server Standard edition or higher.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: timeline in cross-tab??

    You don't need to use INSERT, that's a different instruction.

    Take a look at this link http://msdn.microsoft.com/en-us/library/ms190750(v=sql.100).aspx

    and this one http://msdn.microsoft.com/en-us/library/ms188263(v=sql.100).aspx

    To find the differences between both.

    Avoid using a generic table name as...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: timeline in cross-tab??

    Use the PRINT output to look for the error, I suspect that is something really simple.

    If you can't find it, copy it and paste it here.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 8,131 through 8,145 (of 8,731 total)