´ç½Å¿¡°Ô·Î ¶°³ª´Â ²Þ¼Ó¿©Çà - ²Þ¼Ó³ª¶ó(http://www.inyourdream.net) ÀÔ±¹Çϱâ | ¿µÁÖ±Ç ½Åû
  • ¸öºÎ¸² °ñ¶ó°ñ¶ó
  • ¼Ò±Ù¼Ò±Ù
  • µµ¶õµµ¶õ
  • ³«¼­¸¶´ç
  • Âø°¢ÇѾÆÀÌ
  • ¼ýÀÚ¸ÂÃß±â
  • ¼Ò¿øºô±â
  • ÈçÀû³²±â±â
  • ²Þ¼Ó¿©Çà
  • Ä£±¸Áý ³î·¯°¡±â
  • ¸ðµÎµå¸²´ÔÀÇ È¨
  • î¤éÞ´ÔÀÇ È¨
  • Çö¿ì´ÔÀÇ È¨
  • º°¾ÆÇØ´ÔÀÇ È¨
  • ÇÞ»ì´ÔÀÇ È¨
  • À̳ª´Ï´ÔÀÇ È¨
  • À¯¸®¾Ë´ÔÀÇ È¨
  • ³È³ÈÀÌ´ÔÀÇ È¨
  • ²ÀÁö´ÔÀÇ È¨
  • ´ë¼º´ÔÀÇ È¨
  • wowhoo / 2001-04-25 / ¿ÀÈÄ 9:24:25 / 61.73.28.59
    Á¶È¸¼ö : 151
    [Áú¹®] ÇÁ·Î½ÃÀú¿¡ °üÇÑ Áú¹® ..
    CREATE PROCEDURE Proc_GetMax

    @Board_Name Varchar(20) ,
    @Column Varchar(10) ,
    @TotalCount Varchar(10) Output

    AS

    Begin
    DECLARE @Str_MaxSQL Varchar(200)
    Set @Str_MaxSQL = 'Select @TotalCount = Max('+@Column+') From ' + @Board_Name
    EXEC(@Str_MaxSQL)

    if @TotalCount is Null select @TotalCount=0

    End
    GO

    À̶õÇÁ·Î½ÃÀú¸¦ ¸¸µé¾ú½À´Ï´Ù .

    ASP¶û ¿¬µ¿Çϱâ À§ÇÑ ÇÁ·Î½ÃÁ® ÀÌÁö¿ä ..

    @TotalCount ¶õ ÇÔ¼ö·Î .. Out PutÀ» ÇÏ°í ½ÍÀºµ¥ ..
    ÇÁ·Î½ÃÀú »ý¼ºÀº µÇÁö¸¸ ½ÇÇàÀº µÇÁö ¾Ê½À´Ï´Ù.

    ¹Ýµå½Ã .Declare Ç϶õ ¸Þ½ÃÁö¸¸ ³ª¿É´Ï´Ù .

    Ȥ½Ã .. ÀÌ·±½ÄÀ¸·Î EXEC¶õ ¸Þ¼Òµå¸¦ ÀÌ¿ëÇÏ¿© ¹®ÀÚ¿­·Î ó¸®ÇÒ¶§ ..
    Input °ªÀ̶û... OUP °ªÀÌ °°ÀÌ À־ ¿¡·¯°¡ ¶ß´Â°Ç ¾Æ´ÑÁö ..

    ¾î¶²½ÄÀ¸·ÎÇÏ¸é ¹®Á¦¸¦ ÇØ°á ÇÒ¼ö ÀÖÀ»·±Áö ±Ã±ÞÇÕ´Ï´Ù.

    Âü°í·Î

    Board_name = "freeBoard"

    Set Cmd=Server.CreateObject("ADODB.Command")
    With Cmd
    .ActiveConnection=DBconn
    .CommandText="Proc_GetMax"
    .CommandType=adCmdStoredProc
    .Parameters.Append .CreateParameter("@Board_name",adVarChar,adParamInput,10,Board_Name)
    .Parameters.Append .CreateParameter("@Column",adVarChar,adParamInput,10,"Ref")
    .Parameters.Append .CreateParameter("@TotalCount",adInteger,adParamOutput,0)
    .Execute , ,adExecuteNoRecords
    Max_Ref = Clng( .Parameters("@TotalCount").Value)+1
    End with
    Set Cmd = Nothing

    ¾Æ·¡ÀǼҽº´Â.. ASP ¿¡¼­ °ªÀ» ¹Þ±â À§ÇÑ ¼Ò½ºÀÔ´Ï´Ù .

    °í¼ö´ÔµéÀÇ Á¶¾ð ºÎŹ µå¸³´Ï´Ù .. ^^;;
    Byte * 200 Byte À̳»·Î ÀÔ·ÂÇϼ¼¿ä À̸§ : Æнº¿öµå :