Answered StringBuilder Equivalent type

  • jeudi 8 décembre 2011 15:03
     
     

    Is there any equivalent datatype in sql for .net StringBuilder


    Raamakarthikeyan

Toutes les réponses

  • jeudi 8 décembre 2011 15:22
    Auteur de réponse
     
     

    Hello Raamakarthikeyan,

    A StringBuilder object can dynamically resize itself larger and smaller. There is no datatype in SQL Server that will dynamically make itself larger in terms of data type storage, though we have ones that can be smaller. For example, VARCHAR(100) can hold up to 100 characters of ascii but will only take up as much space as there is data. If you were to insert a value of 'abc123' it would (minus overhead) take up 6 bytes of space. NVARCHAR acts the same way except it will hold unicode data at two bytes per character.

    I'm not sure where you are going with this, but if you could tell us what you are looking as your end result we could help you a bit more.

    I'm assuming you were talking about this: http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx

    -Sean

  • vendredi 9 décembre 2011 01:49
     
     
    You can use VARCHAR(MAX) or NVARCHAR(MAX) which will dynamically grow or shrink depending on their contents.
    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker
  • vendredi 9 décembre 2011 06:47
     
     

    Hi Sean Gallardy

    Actually what iam looking out is for DoingBulkInsert

    BulkInsert expects filename as a parameter, instead is there any way where i could send the file content itself as parameter for bulkinsert. And my content is not an xml content, it is an tab delimitted content.

     


    Raamakarthikeyan
  • vendredi 9 décembre 2011 07:08
     
     Traitée
    No there isn't a way to send the contents of a file as a parameter to BulkInsert.  I also don't believe there's any other method which accepts the contents of a file as a parameter.
    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    MC ID: Microsoft Transcript

    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker
  • vendredi 9 mars 2012 19:09
    Modérateur
     
     

    You could take a look at FileTable feature in SQL 2012 http://msdn.microsoft.com/en-us/library/ff929144(v=sql.110).aspx 

    You can download SQL 2012 Trial from http://www.microsoft.com/sqlserver/en/us/get-sql-server/try-it.aspx 

    Thanks

    Sethu Srinivasan [MSFT]

    SQL Server

    http://blogs.msdn.com/sqlagent