Forum Replies Created

Viewing 15 posts - 106 through 120 (of 429 total)

  • RE: Column aliases

    Has anyone suggested this as a method?

    SELECT

    A, B, C

    FROM

    (

    SELECT

    1, 2, 3

    ) AS X (A, B, C)

  • RE: SELECT @local_variable

    SqlMel (7/29/2015)


    Good question and something to keep in mind always.

    I ALWAYS use Top 1 when assigning values to variables even though in all cases I can think of I use...

  • RE: NOT IN

    This behavior is a lot easier to understand if you think about NOT IN as a series of 'not equal' statements logically ANDed together:

    SELECT Value

    FROM #tmpNewValue

    WHERE Value != 3

    AND...

  • RE: What is the Output?

    Hugo Kornelis (6/24/2015)


    Correction: that code **MIGHT** not return an error. Or it might. The optimizer determines in what order to evaluate the expressions, so short-circuiting is not guaranteed.

    It is very...

  • RE: Pounds of Formatting Fun

    Interesting question, thanks Andy. 🙂

  • RE: Command Prompt Utility

    TomThomson (6/1/2015)


    Not a good question. The command line utilities using ODBC are SQLCMD and BCP and the deprecated OSQL. In fact BCP and SQLCMD are the two traditionally...

  • RE: CDC Administration

    Hugo Kornelis (4/30/2015)


    Stewart "Arturius" Campbell (4/30/2015)


    Interesting question, thanks...

    Now i'm wondering why this might be required, given the temporary nature of objects in tempdb...:-P

    I am convinced that it will never be...

  • RE: Filtered Indexes

    Interesting question! I don't use filtered indexes very often, and didn't know filtered indexes had these limitations.

  • RE: The CTE Problem

    Ugh, had a hard time choosing between the two correct answers.

    I went with the column name list, since the documentation seemed to favor that syntax. 🙁

  • RE: Legal/illegal characters in table name

    Lon-860191 (4/8/2015)


    My question is given I have a schema named tmp why would I want to create a table named like that in the real world, other than to prove...

  • RE: Legal/illegal characters in table name

    This is an interesting question. While I haven't run across this specific case before, I have had developers create tables with things like double-quotes or even square brackets in...

  • RE: Help Creating Trigger

    You want to select the deleted column values from the pseudo-table DELETED.

    INSERT INTO DeleteTracker (EventID, EventDate)

    SELECT deleted.EID, deleted.StartDate

    FROM deleted

    Here is a tutorial on creating an AFTER DELETE trigger that I...

  • RE: Need to Add DB Roles that Principals are In

    The database system view <database name>.Sys.Database_Role_Members is what you want.

    The view contains two columns:

    role_principal_id

    member_principal_id

    The role_principal_id is the principal_id of the role itself, and the member_principal_id is the principal_id of the...

  • RE: SQL Jobs

    I think whether the file gets created depends on if the syntax error causes the package to fail validation or not. I think the second question also depends on...

  • RE: Monitoring Scripts - SQL

    I agree with Lowell.

    I use T-SQL to shell out some Powershell scripting that checks our servers to make sure all the associated SQL Server services are running on each one....

Viewing 15 posts - 106 through 120 (of 429 total)