none
StringBuilder Equivalent type

Answers

  • 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
    Friday, December 09, 2011 7:08 AM

All replies

  • 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

    Thursday, December 08, 2011 3:22 PM
  • 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
    Friday, December 09, 2011 1:49 AM
  • 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
    Friday, December 09, 2011 6:47 AM
  • 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
    Friday, December 09, 2011 7:08 AM
  • 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

    Friday, March 09, 2012 7:09 PM