Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
marat
Yak Posting Veteran
85 Posts |
Posted - 2006-03-03 : 06:41:05
|
Hi,I am building dynamic query, something likeselect [a] as [a1],[b] as [b2], .... into tbl1 from tbl2I declared @sql varchar(8000)but final result of @sql is truncated to 4000 characters.What could cause a truncation? Thanks |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-03-03 : 06:56:00
|
| Sounds like something is using Nvarchar - which has a limit of 4,000 characters.If that isn't the answer pls post the exact code you are using and we can take a look.Kristen |
 |
|
|
marat
Yak Posting Veteran
85 Posts |
Posted - 2006-03-03 : 07:22:38
|
Actually,problem was with @tbl1 and @tbl2 variables.I declared then as "sysname"After changing to varchar(2000), everything start working.Thanks Kristen for the idea |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-03-03 : 07:53:00
|
Whenever asking the question post the code so that we will be able to point out error without guessing what the reason is MadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-03-03 : 07:56:12
|
| sysname is a synonym for nvarchar(128) - so that would explain it!Kristen |
 |
|
|
|
|
|