Forum Replies Created

Viewing 15 posts - 421 through 435 (of 522 total)

  • RE: User Defined Function Execution

    Hm, I am having a blackout:

    Why is this function not deterministic?!?

    CREATE FUNCTION dbo.fnDateAdd()

    RETURNS int

    AS

    BEGIN

    RETURN 0

    END

    GO

    Do I need to have any special session settings enabled?

    SELECT objectpropertyex(object_id('dbo.fnDateAdd'), N'IsDeterministic')

    returns 0.

    I...

    Best Regards,

    Chris Büttner

  • RE: Concatenate numbers to form a 7 digit string

    Hm, sometimes I wish I would be reading the posts more thoroughly;-)

    In any case, here is something without zeros:

    SELECT

    CAST(CEILING(RAND() * 9) AS char(1))

    +CAST(CEILING(RAND() * 9) AS char(1))

    +CAST(CEILING(RAND() *...

    Best Regards,

    Chris Büttner

  • RE: User Defined Function Execution

    Hello Derek,

    I think in this context the CROSS APPLY clause isn't counted as part of the FROM!

    Of course it is part of the FROM clause. APPLY is an operator that...

    Best Regards,

    Chris Büttner

  • RE: User Defined Function Execution

    Hi Brandie,

    thanks for your response.

    I still am not sure whether your assumption is correct.

    When reading BOL I get the assumption that the TVF is evaluated for each and every row:

    The...

    Best Regards,

    Chris Büttner

  • RE: Concatenate numbers to form a 7 digit string

    Hello!

    Would something like this work for you?

    SELECT RIGHT('0000000' + LTRIM(STR(RAND()*10000000)),7)

    Best Regards,

    Chris Büttner

  • RE: User Defined Function Execution

    Um, question:

    Shouldn't it be executing once per row in the FROM clause too?

    Example:

    SELECT * FROM dbo.MyTable T CROSS APPLY dbo.MyFunction(T.fielda)

    Grazias!

    Best Regards,

    Chris Büttner

  • RE: Compare two Identical tables

    Hello,

    why at all do you need to make this process dynamic?

    Why not just create the INSERT & UPDATE statements per each table?

    And for what reason does he want to have...

    Best Regards,

    Chris Büttner

  • RE: Compare two Identical tables

    Thanks for the compliments!

    I like days that start like this:-)

    Best Regards,

    Chris Büttner

  • RE: Compare two Identical tables

    Since you are trying to make both tables equal, wouldn't something like this work?

    TRUNCATE TABLE Table2

    INSERT Table2 SELECT * FROM Table1

    Best Regards,

    Chris Büttner

  • RE: trigger problem

    Just as a note, PRINT statements sometimes apear in the errors collection.

    PRINT statements in SQL Server can also populate the ADO errors collection. However, PRINT statements are severity level zero...

    Best Regards,

    Chris Büttner

  • RE: Query Active Directory from SQL

    I am not sure, but I assume you are looking for SELECT SUSER_SID()

    Best Regards,

    Chris Büttner

  • RE: Anatomy of an Incremental Load

    Hello,

    As already mentioned by others, I also doubt that this is a method that works for importing data from a different server.

    The problems with data coming from a different server...

    Best Regards,

    Chris Büttner

  • RE: a select SQL uses join,subquery,and group by,PROBLEM

    Does this one work?

    SELECT APP.id_tender

    ,COUNT(*) as no_of_app

    ,TEN.titlename

    FROM applytender APP

    JOIN tenders TEN ON APP.id_tender=TEN.id

    WHERE TEN.owner1 = 2

    GROUP BY APP.id_tender

    ,TEN.titlename

    Best Regards,

    Chris Büttner

  • RE: Temp Tables and Dynamic SQL

    Good evening,

    http://support.microsoft.com/kb/305977/en-us

    You cannot use the EXEC statement or the sp_executesql stored procedure to run a dynamic SQL Server query that refers a table variable, if the table variable was created...

    Best Regards,

    Chris Büttner

  • RE: Problem creating a Maintenance Plan for Backup of one specific Database

    You might be able to find out whats going wrong using a trace.

    Use "Errors and Warnings" -> Exceptions in the events selection.

    I had an issue with a maint plan...

    Best Regards,

    Chris Büttner

Viewing 15 posts - 421 through 435 (of 522 total)