StringBuilder Equivalent type
-
08 Desember 2011 15:03
Is there any equivalent datatype in sql for .net StringBuilder
Raamakarthikeyan
Semua Balasan
-
08 Desember 2011 15:22Penjawab Pertanyaan
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
-
09 Desember 2011 1:49You 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 -
09 Desember 2011 6: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 -
09 Desember 2011 7:08
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- Ditandai sebagai Jawaban oleh Raamakarthikeyan 09 Desember 2011 7:18
-
09 Maret 2012 19:09Moderator
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