Click here to Skip to main content
15,887,411 members
Home / Discussions / Database
   

Database

 
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 
Questionconverting from varbinary(max) to xml Pin
amer shammout12-Apr-09 22:48
amer shammout12-Apr-09 22:48 
QuestionRe: converting from varbinary(max) to xml Pin
Eddy Vluggen13-Apr-09 0:02
professionalEddy Vluggen13-Apr-09 0:02 
AnswerRe: converting from varbinary(max) to xml Pin
amer shammout13-Apr-09 0:17
amer shammout13-Apr-09 0:17 
GeneralRe: converting from varbinary(max) to xml Pin
Eddy Vluggen13-Apr-09 1:38
professionalEddy Vluggen13-Apr-09 1:38 
GeneralRe: converting from varbinary(max) to xml Pin
amer shammout20-Apr-09 2:47
amer shammout20-Apr-09 2:47 
QuestionData base notification Pin
anishkannan12-Apr-09 20:26
anishkannan12-Apr-09 20:26 
AnswerRe: Data base notification Pin
Giorgi Dalakishvili12-Apr-09 21:12
mentorGiorgi Dalakishvili12-Apr-09 21:12 
QuestionNeed a Query... [modified] Pin
Jamal Abdul Nasir12-Apr-09 5:22
Jamal Abdul Nasir12-Apr-09 5:22 
AnswerRe: Need a Query... Pin
Henry Minute12-Apr-09 8:03
Henry Minute12-Apr-09 8:03 
AnswerRe: Need a Query... Pin
Le centriste14-Apr-09 5:13
Le centriste14-Apr-09 5:13 
QuestionMerging rows from different tables to form a single row. Pin
Abhilash Raja11-Apr-09 22:42
Abhilash Raja11-Apr-09 22:42 
AnswerRe: Merging rows from different tables to form a single row. [modified] Pin
Eddy Vluggen12-Apr-09 0:08
professionalEddy Vluggen12-Apr-09 0:08 
GeneralRe: Merging rows from different tables to form a single row. Pin
Abhilash Raja12-Apr-09 1:49
Abhilash Raja12-Apr-09 1:49 
GeneralRe: Merging rows from different tables to form a single row. Pin
Eddy Vluggen12-Apr-09 4:32
professionalEddy Vluggen12-Apr-09 4:32 

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.