none
StringBuilder Equivalent type

答案

  • 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
    2011年12月9日 7:08

全部回复

  • 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

    2011年12月8日 15:22
    答复者
  • 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
    2011年12月9日 1:49
  • 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
    2011年12月9日 6:47
  • 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
    2011年12月9日 7:08
  • 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

    2012年3月9日 19:09
    版主