Friday, March 9, 2012
Largest string for execute
I have function that build sring to execute.
The function create string on 6000 characters size.
Because it's size i had to build it with two strings
How can i execute this size of string?
any help would be usefulYou should be able to execute strings like this:
declare @.sql1 varchar(8000),@.sql2 varchar(8000)
set @.sql1=dbo.your_udf(para1)
set @.sql2=dbo.your_udf(para2)
exec(@.sql1+@.sql2)
-oj
"Roy Goldhammer" <roygoldh@.hotmail.com> wrote in message
news:OKCY8OSAFHA.3424@.TK2MSFTNGP11.phx.gbl...
> Hello there
> I have function that build sring to execute.
> The function create string on 6000 characters size.
> Because it's size i had to build it with two strings
> How can i execute this size of string?
> any help would be useful
>
Largest character data type?
is (2^31)-1
But I can only fit 8000 characters in before it truncates, but even then it
is not exactly 8000 characters, but more like 1000.TEXT is the largest data type. Where do you see the truncation happening'
If it is in Query Analyzer, you need to expand the number of display
character (max is 8192). Your application will never truncate the content of
the TEXT data type.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Wayne M J" <not@.home.nor.bigpuddle.com> wrote in message
news:OSh09QhvDHA.2076@.TK2MSFTNGP09.phx.gbl...
> I thought "text" was the largest, as the documentation says the max length
> is (2^31)-1
> But I can only fit 8000 characters in before it truncates, but even then
it
> is not exactly 8000 characters, but more like 1000.
>|||"SriSamp" <ssampath@.sct.co.in> wrote in message
news:uTxYyohvDHA.2072@.TK2MSFTNGP10.phx.gbl...
> TEXT is the largest data type. Where do you see the truncation happening'
> If it is in Query Analyzer, you need to expand the number of display
> character (max is 8192). Your application will never truncate the content
of
> the TEXT data type.
I see this from the table view, when I 'return all rows' I can scroll
through the field, but it only seems to have stored to a certain point.
The result is visible here:
http://www.wmjackson.cable.nu/website/goto.aspx?id=0|||That must be a limitation with Enterprise Manager. The data will not be
truncated.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Wayne M J" <not@.home.nor.bigpuddle.com> wrote in message
news:eOaaYPjvDHA.1512@.TK2MSFTNGP10.phx.gbl...
> "SriSamp" <ssampath@.sct.co.in> wrote in message
> news:uTxYyohvDHA.2072@.TK2MSFTNGP10.phx.gbl...
> > TEXT is the largest data type. Where do you see the truncation
happening'
> > If it is in Query Analyzer, you need to expand the number of display
> > character (max is 8192). Your application will never truncate the
content
> of
> > the TEXT data type.
> I see this from the table view, when I 'return all rows' I can scroll
> through the field, but it only seems to have stored to a certain point.
> The result is visible here:
> http://www.wmjackson.cable.nu/website/goto.aspx?id=0
>|||"SriSamp" <ssampath@.sct.co.in> wrote in message
news:OEnSpbjvDHA.3256@.TK2MSFTNGP11.phx.gbl...
> That must be a limitation with Enterprise Manager. The data will not be
> truncated.
Actually, that makes sense.
large VarChar vs Text
We are using SQL 2K with SP4.
We have a char field which can potentially have up to 6,400 characters,
should we use Text instead. Is there a guideline to when we should use Text
vs Varchar? I am concerning which way will give us the best storage
management and performance.
wingmanIf you read Books Online (the reference materials that come with SQL Server)
you will probably come to the conclusion that you should use varchar.
Varchar is much more flexible, and it is easier to work with.
--
Keith Kratochvil
"Wingman" <Wingman@.discussions.microsoft.com> wrote in message
news:8EECDAFE-542C-4727-A106-AF96146CE22F@.microsoft.com...
> Hi,
> We are using SQL 2K with SP4.
> We have a char field which can potentially have up to 6,400 characters,
> should we use Text instead. Is there a guideline to when we should use
> Text
> vs Varchar? I am concerning which way will give us the best storage
> management and performance.
> wingman
large VarChar vs Text
We are using SQL 2K with SP4.
We have a char field which can potentially have up to 6,400 characters,
should we use Text instead. Is there a guideline to when we should use Tex
t
vs Varchar? I am concerning which way will give us the best storage
management and performance.
wingmanIf you read Books Online (the reference materials that come with SQL Server)
you will probably come to the conclusion that you should use varchar.
Varchar is much more flexible, and it is easier to work with.
Keith Kratochvil
"Wingman" <Wingman@.discussions.microsoft.com> wrote in message
news:8EECDAFE-542C-4727-A106-AF96146CE22F@.microsoft.com...
> Hi,
> We are using SQL 2K with SP4.
> We have a char field which can potentially have up to 6,400 characters,
> should we use Text instead. Is there a guideline to when we should use
> Text
> vs Varchar? I am concerning which way will give us the best storage
> management and performance.
> wingman
Wednesday, March 7, 2012
Large text Insert
Hi,
I have a large text which contains special characters and I need to insert it in "ErvTxt" field which is a varchar field.
I get an error:
Error:Line 1: Incorrect syntax near '1'.
Unclosed quotation mark before the character string ', 19 )'.
At line 4467SQL statement: INSERT INTO tbl1 (ZPERS, Status, ErvTxt, VENTS, DNR, ANAME, Fall, Zust, GER, Empf, BET, SSK, GA, JAHR, PZ, LAUFNR, RVLAUFNR, EDAT, ETIME, VDAT, UTLAUFNR, Bew, AINR, ErvNr, PrintStatus, FristNr, HDAT, HTIME, RVExportiert, CrDat, CrPers, GATT, AZ, NR) VALUES ( 'STS', -1, '0123\'1\'00\'0138-33/02(1)\'J\'F\'452\'R020311\'KL01\'ZB\'01\'C\'00001\'03\'i\'000000000\'430200001\'20030116\'0905\'\'000000460\'20030116\'1100\'\n0242\'3\'15\'00\'00000001000\'\'\'-\'00000000000100\'\'\'\'\'\'\'\'00100?¥00000000000100?¥00000000000100?¥0000000000010000000000015699200000\'0000000363?¥00000000001000?¥00000000001000 rrrrrrrrrrrr ssss\'\'RI20030\'101012003010\'1200301160\'0\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\n', '', 0, '0138-33/02(1)', 'J', 'F', 97, 'R020311', 'KL01', 'ZB', 1, 3, 'i', 0, 430200001, '2003-01-16 12:00:00', '1899-12-30 09:05:00', NULL, 460, 0, 2927, 1744, 0, 0, '2003-01-16 12:00:00', '1899-12-30 11:00:00', NULL, '2003-01-16 04:04:04', 'STS', 'C', '00001', 19 )
Can anyone tell me what's wrong?
Thanks.
You need to escape the single quotes inside the varchar/string value.Large Text
probably 10,000-20,000 characters.
what variable can I use?
thanks in advanceUse varchar(max)|||
Hi,
If you are using sql server 2000 then use 'text' datatype, if you are using sql server 2005 then you can use 'varchar(max)' as Arnie Rowland suggested.
Ravi