Forum Replies Created

Viewing 15 posts - 8,716 through 8,730 (of 8,731 total)

  • RE: Script to Search Through all Databases for a Table Name

    We just made a similar script but focusing on the columns and not using the schemas (as they don't use them in here).

    But because we're not dbas and we don't...

    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: Help me to select the records?

    SQLKnowItAll (6/28/2012)


    Luis Cazares (6/28/2012)


    Will something like this apply? (I'm learning how to use CROSS APPLY :blush: )

    SELECT DISTINCT y.*

    FROM Table x

    CROSS APPLY (SELECT TOP 3 * FROM Table y...

    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: Help me to select the records?

    Will something like this apply? (I'm learning how to use CROSS APPLY :blush: )

    SELECT DISTINCT y.*

    FROM Table x

    CROSS APPLY (SELECT TOP 3 * FROM Table y WHERE x.id =...

    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: Help me to select the records?

    Do you intend to show the first 3 values on SysCC for every ID?

    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: Restart Log Backups

    I was tempted with the first answer as it seemed correct. But a little bit of logic indicated me that there's no reason for the database backups to be incomplete...

    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: T-SQL Integer Data-Type Conversions

    As okbangas said, hex is used to represent the information. Your looking at the same thing:

    a = 01100001 (binary) = 61 (hex) = 97 (decimal)

    So you're looking at the binary...

    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: SELECT - with ORDER BY - but field not in SELECT list

    My mistake, I meant ORDER BY.

    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: SELECT - with ORDER BY - but field not in SELECT list

    peacesells (6/16/2012)


    balasach82 (6/16/2012)


    is it possible to give an SELECT statement ...ORDER BY but the field in ORDER BY clause would not be in SELECT list.

    Like ...

    SELECT F1, F2, F3...

    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 to simplify this script

    If your columns behave as bit columns instead of behaving as int, there's no need for the case, you can simply add the 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: Query tuning - Left Join vs. Inner Join vs. main table select

    For instance, there's no reason to use a JOIN if you use fields from one table. Instead of doing this:

    SELECT P.PodrobnostiAutoID

    FROM dbo.vwPodrobnosti P

    LEFT JOIN dbo.vwTableOfGenuss G ON P.GenusAutoID =...

    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: Tabbing Between Results Panel and Coding Panel in Management Studio

    anthony.green (6/1/2012)


    F6 will cycle through the query panel, results panel, messages panel if thats what you want.

    Shift + F6 will go in the opposite order.

    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: Find which rows have a column value that is less than the previous row's column value

    There can be a small problem with Jeffem and ColdCoffee's solution.

    If you miss an ID value (most common scenario is when you delete a record and the identity does...

    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: Logical Operators

    It sure was an easy question and a fact anyone using WHERE clauses should know. The difficulty is on understanding the question and reading carefully.

    I got it wrong because I...

    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: Unnecesary subquery and top?

    Thank you Paul and Celko, I appreciate the effort and time you made on answering this going even with more details.

    I didn't beleive that DDL would be necessary as 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: How to write a query for birthdays in the next two weeks?

    This could help you.

    DECLARE@nDate1int,

    @nDate2int,

    @dTodaydatetime

    SET@dToday = GETDATE()

    SET@nDate1 = DATEPART( y, @dToday)

    SET@nDate2 = DATEPART( y, DATEADD( ww, 2, @dToday))

    IF @nDate2 < @nDate1

    BEGIN

    SET @nDate2 = DATEPART( y, CAST( YEAR( @dToday) AS char(4)) +...

    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,716 through 8,730 (of 8,731 total)