Click here to Skip to main content
15,897,187 members
Home / Discussions / Database
   

Database

 
AnswerRe: Any shorter way to total this? Pin
Mycroft Holmes15-Apr-09 1:21
professionalMycroft Holmes15-Apr-09 1:21 
GeneralRe: Any shorter way to total this? Pin
Muammar©15-Apr-09 10:30
Muammar©15-Apr-09 10:30 
AnswerRe: Any shorter way to total this? Pin
i.j.russell15-Apr-09 9:06
i.j.russell15-Apr-09 9:06 
GeneralRe: Any shorter way to total this? Pin
Muammar©15-Apr-09 10:30
Muammar©15-Apr-09 10:30 
QuestionRewrite recursive proc so we can do this in UDF instead? (and more efficient) Pin
devvvy14-Apr-09 18:02
devvvy14-Apr-09 18:02 
AnswerRe: Rewrite recursive proc so we can do this in UDF instead? (and more efficient) Pin
Ashfield14-Apr-09 21:00
Ashfield14-Apr-09 21:00 
GeneralGot recursive CTE sql but... two more questions. Pin
devvvy15-Apr-09 0:07
devvvy15-Apr-09 0:07 
GeneralRe: Got recursive CTE sql but... two more questions. Pin
Giorgi Dalakishvili15-Apr-09 1:13
mentorGiorgi Dalakishvili15-Apr-09 1:13 
GeneralRe: Got recursive CTE sql but... two more questions. Pin
i.j.russell15-Apr-09 9:10
i.j.russell15-Apr-09 9:10 
GeneralRe: Got recursive CTE sql but... two more questions. Pin
devvvy15-Apr-09 13:25
devvvy15-Apr-09 13:25 
QuestionTABLE VALUE FUNCTION for MySQL? Pin
devvvy14-Apr-09 16:20
devvvy14-Apr-09 16:20 
QuestionFile logging. Pin
Ivan200914-Apr-09 8:50
Ivan200914-Apr-09 8:50 
AnswerRe: File logging. Pin
Ashfield14-Apr-09 21:03
Ashfield14-Apr-09 21:03 
GeneralRe: File logging. Pin
Ivan200915-Apr-09 6:09
Ivan200915-Apr-09 6:09 
QuestionQuery Pin
CodingYoshi14-Apr-09 6:23
CodingYoshi14-Apr-09 6:23 
AnswerRe: Query Pin
Eddy Vluggen14-Apr-09 10:10
professionalEddy Vluggen14-Apr-09 10:10 
Questiondatacolumn boxing Pin
Maverickcool13-Apr-09 22:02
Maverickcool13-Apr-09 22:02 
AnswerRe: datacolumn boxing Pin
Mycroft Holmes14-Apr-09 17:05
professionalMycroft Holmes14-Apr-09 17:05 
GeneralRe: datacolumn boxing Pin
Maverickcool14-Apr-09 23:55
Maverickcool14-Apr-09 23:55 
GeneralRe: datacolumn boxing Pin
Mycroft Holmes15-Apr-09 1:18
professionalMycroft Holmes15-Apr-09 1:18 
AnswerRe: datacolumn boxing Pin
jai_10124-Apr-09 21:49
jai_10124-Apr-09 21:49 
Questionmultiline dynamic tsql - recognize line break? Pin
devvvy13-Apr-09 20:22
devvvy13-Apr-09 20:22 
hello

How can you get a complex multiline dynamic T-SQL to execute, I tried ";" don't work, SQL Anaylzer doesn't recognize line breaks.
SET @SQL =
       'DECLARE @ThisParentId bigint;
        DECLARE @ThisParentType varchar(255);
        DECLARE @CountParent int;

        DECLARE $CURSOR_NAME$ CURSOR FOR
        SELECT ParentId,ParentType
        FROM HIERARCHYMAP
        WHERE
            ChildId = $OBJECTID$
            AND ChildType = ''$OBJECTCLASSIFIER$'';

            OPEN $CURSOR_NAME$;
            FETCH $CURSOR_NAME$ INTO @ThisParentId, @ThisParentType;

            WHILE @@FETCH_STATUS = 0;
            BEGIN

                SELECT @CountParent = count(1) FROM HIERARCHYMAP WHERE ChildId = @ThisParentId AND ChildType = @ThisParentType;
                IF (@CountParent>0)
                    BEGIN
                    EXEC spRecursiveGetParents @ThisParentId, @ThisParentType, ''$TEMPID$'';
                    END;
                FETCH $CURSOR_NAME$ INTO @ThisParentId, @ThisParentType;
            END;

            CLOSE $CURSOR_NAME$;
            DEALLOCATE $CURSOR_NAME$;
            '
    SET @SQL = REPLACE(@SQL, '$CURSOR_NAME$', @CursorName)
    SET @SQL = REPLACE(@SQL, '$OBJECTID$', CAST(@ObjectId as varchar(20)) )
    SET @SQL = REPLACE(@SQL, '$OBJECTCLASSIFIER$', CAST(@ObjectClassifier as varchar(70)) )
    SET @SQL = REPLACE(@SQL, '$TEMPID$', CAST(@TempId as varchar(36)) )

    PRINT @SQL

    EXECUTE @SQL

Thanks

dev

AnswerRe: multiline dynamic tsql - recognize line break? Pin
devvvy13-Apr-09 20:46
devvvy13-Apr-09 20:46 
QuestionDifference between datatype uniqueidentifier and int for a primary key? Pin
pzn3xq13-Apr-09 10:07
pzn3xq13-Apr-09 10:07 
AnswerRe: Difference between datatype uniqueidentifier and int for a primary key? Pin
Colin Angus Mackay13-Apr-09 12:16
Colin Angus Mackay13-Apr-09 12:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.