StringBuilder Equivalent type
-
8 ธันวาคม 2554 15:03
Is there any equivalent datatype in sql for .net StringBuilder
Raamakarthikeyan
ตอบทั้งหมด
-
8 ธันวาคม 2554 15:22ผู้ตอบ
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
-
9 ธันวาคม 2554 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 -
9 ธันวาคม 2554 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 -
9 ธันวาคม 2554 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- ทำเครื่องหมายเป็นคำตอบโดย Raamakarthikeyan 9 ธันวาคม 2554 7:18
-
9 มีนาคม 2555 19:09ผู้ดูแล
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