Forum Replies Created

Viewing 15 posts - 2,086 through 2,100 (of 7,164 total)

  • RE: My first UDF doesn't work. Thoughts?

    NineIron (2/7/2013)


    Pardon my ignorance but, I thought I was creating a TVF. I knew that I would be returning more than one value.

    The whole point of me creating this...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: My first UDF doesn't work. Thoughts?

    Here is a working version of your Scalar UDF:

    CREATE FUNCTION dbo.ufnCHFPatients

    (

    @StartDate DATETIME,

    @EndDate DATETIME

    ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: My first UDF doesn't work. Thoughts?

    ScottPletcher (2/7/2013)


    I strongly recommend fully qualifying all table names with the owning schema, typically "dbo" but of course could be different in your specific environment.

    For example:

    ...

    from dbo.AbstractData a

    inner join dbo.AbsDrgDiagnoses...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Granting sysadmin rights to local admin to a db

    worker bee (2/7/2013)


    worker bee (2/7/2013)


    opc.three (2/7/2013)


    worker bee (2/7/2013)


    dbo (database role) gives them access to that one and only one database.

    dbo is not a Database Role it is a Database User:

    You...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: If or case staement in a where?

    ChrisM@Work (2/7/2013)


    It can be easier to visualise complex filters by switching them into a CROSS APPLY for testing. Shamelessly nicking Orlando's setup, it might look like this;

    USE tempdb;

    IF OBJECT_ID(N'tempdb..#CLIENT_IDENTIFIER_TYPE') IS...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Granting sysadmin rights to local admin to a db

    worker bee (2/7/2013)


    dbo (database role) gives them access to that one and only one database.

    dbo is not a Database Role it is a Database User:

    You gave them dbo?[/url]

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: My first UDF doesn't work. Thoughts?

    We do not have access to your environment. If you would provide test tables (CREATE TABLE statements), test data (INSERT statements) and your expected results based on that test data...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: audit of locked / disabled users. sql & windows users.

    Sorry, forgot the second part of your question:

    SELECT name,

    is_disabled,

    LOGINPROPERTY(name, 'IsLocked') AS is_locked

    FROM ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: audit of locked / disabled users. sql & windows users.

    syslogins is deprecated as of SQL 2005.

    Mapping SQL Server 2000 System Tables to SQL Server 2005 System Views

    How about this:

    SELECT *

    FROM sys.server_principals

    WHERE is_disabled =...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: loading data from multiple tables to multiple tables in other database?

    It sounds like you are planning to implement something in SSIS already provided in SQL Server. Have you looked into SQL Server Replication?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Preprocessing Files SSIS

    I have had to deal with that in the past. They were flat files coming from an AS/400. My requirements said to replace NUL with a space (ASCII 32). I...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Intermittent Stored Proc long running issue.

    Recompilation would not take execution time from .05s to 30s unless there are some hellaciously complex queries in the proc. Can you post the code? sanitized to protect the guilty...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: If or case staement in a where?

    For the record it's a CASE expression not a CASE statement.

    USE tempdb;

    IF OBJECT_ID(N'tempdb..#CLIENT_IDENTIFIER_TYPE') IS NOT NULL

    DROP TABLE #CLIENT_IDENTIFIER_TYPE;

    GO

    CREATE TABLE #CLIENT_IDENTIFIER_TYPE (Code CHAR(3));

    INSERT INTO #CLIENT_IDENTIFIER_TYPE

    ...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Page Life Expectancy Extremely high

    PiMané (2/7/2013)


    Grant Fritchey (2/7/2013)


    That calculation is for a minimum healthy value but even that is to be measured against your server over time. But the biggest key word there is:...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • RE: Granting sysadmin rights to local admin to a db

    fluffydeadangel (2/6/2013)


    I don't know if you can restrict activity monitor to a single database...

    To my knowledge you cannot. See my previous comments about how SQL Server does not neatly segment...

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 15 posts - 2,086 through 2,100 (of 7,164 total)