Monday, March 19, 2012
Last Name Only
Any help would be greatly appreciated.
Thanks,
Hanseleg. Create a formula and write this
stringVar sp;
sp:="Test1 test2";
mid(sp,instr(sp," ",1)+1,len(sp))
Last Modified Field
UPDATE s
SET LastModified = getdate()
FROM secUser s
join inserted i on s.UID = i.UID
Any suggestions would be appreciated.
Thanks,
Nate BaxleyIn this case, the best choice is instead of update trigger.
Good luck!
Last GASP on "Insert row in table with Identity field, and get new Identity back " ?
While I have learned a lot from this thread I am still basically confused about the issues involved.
.I wanted to INSERT a record in a parent table, get the Identity back and use it in a child table. Seems simple.
To my knowledge, mine would be the only process running that would update these tables. I was told that there is no guarantee, because the OLEDB provider could write the second destination row before the first, that the proper parent-child relationship would be generated as expected. It was recommended that I create my own variable in memory to hold the Identity value and use that in my SSIS package.
1. A simple example SSIS .dts example illustrating the approach of using a variable for identity would be helpful.
2. Suppose I actually had two processes updating these tables, running at the same time. Then it seems the "variable" method will also have its problems. Is there a final solution other than locking the tables involved prior to updating them or doing something crazy like using a GUID for the primary key!
3. We have done the type of parent-child inserts I originally described from t-sql for years without any apparent problems. (Maybe we were just lucky.) Is the entire issue simply a t-sql one or does SSIS add a layer of complexity beyond t-sql that needs to be addressed?
TIA,
Barkingdog
SSIS processes data in a different way than T-SQL. The "pipleine" processes differently than batch oriented SQL and differently than cursor based SQL. This is by design of course and has certain benefits and trade-offs, and requires a different way of implementing a solution.
Whether you want to characterize that as an additional "layer of complexity" or not is up to you. I guess if you now have differing options for processing data, that have different advantages and disadvantages, with different costs and benefits, where previously you had only one option , you might consider that more complexity.
I consider it more options - and glad to have 'em...
|||
This post includes examples of how to create surrogate keys using SSIS, effectively the same problem as you are trying to solve: http://sqljunkies.com/WebLog/sqlbi/archive/2005/05/30/15684.aspx
We do not have a packaged solution for highly parallel loads in this version, but we will be releasing a paper on this subject in coming months.
Donald
|||Thanks,
I will read through the paper.
I am starting to think that, because of parallesim in SSIS, that the sql uniqueidentifier may be a more suitable "primary key" for a table than the traditional Identity value (integer) used in the past.
But I do believe the problem relates to paralellism in SSIS. I don't think this problem would likely occur from a stored proc call that used the "insert a new record, get the identity value, populate the child" approach. (Though I guess it could happen if one had a server farm..... Why is everything so complicated?!)
TIA,
Barkingdog
|||It's not because of parallelism in SSIS. We have seen this same problem with inserting and immediately retrieving an identity over many years. Unfortunately, everyone thinks they can guarantee the result, and sooner or later they trip up because of some glitch. Unfortunately, because these values are your unique identifiers, such a trip up can be quite serious.
Read:
http://www.aspfaq.com/show.asp?id=2499
http://www.databasejournal.com/features/mssql/article.php/3307541
Donald
|||>> We have seen this same problem with inserting and immediately retrieving an identity over many years"
The problem I face is that we will be running a single program or SSIS package that is the only program which updates these tables. Nothing else will update them. There are no multiple users, no server farm. I can hear the developers saying that the "problem" mentioned can not happen in that of environemnt. Are they correct or can someone come up with a simple t-sql script that forces the problem to happen in any sql environment?
TIA,
Barkingdog
|||
>The problem I face is that we will be running a single program or SSIS package that is the only program which updates these tables. Nothing else will update them. There are no multiple users, no server farm.
The problem I face is that I have heard this many times from many users - and yet somewhere, somehow, somewhen, the world turns out to be not quite this tidy.
If you think this will work for you, I guess I can only say good luck. But I have an uneasy feeling that in a few months time we'll be reading the "how do I rekey all my child records?" post. ![]()
Donald
|||Thanks Donald. I will follow your sage advice!
I'm just preparing for the bruises\abuse I'm going to get from developers who will think I'm wrong and crazy on this point. I'm sure the URL's you listed will dull their bite.
Barkingdog
|||Here's what I have learned about this issue so far:
1. This issue has always existed. It is now aggravated by multi-processor systems, server farms, and the parellelism introduced in SSIS.
2. The best thought seems to be to generate one's own counter and use it instead of relying upon an Identity field.
3. While better to use SCOPE_IDENTITY than @.@.Identity or IDENT_CURRENT, even that will not guarantee a correct parent-child linkage. (The problem is if one t-sql operaiton starts before another their is no guarantee it will complete and commit before the other. Forget sequential processing.)
4. I think the only available way to get the proper linkage is to use GUID (from NEWID()) to generate the "identity" key for tables. (But that approach won't be quick for use in JOINS unless I index the GUIDs!)
In summary, I don't think there is a GOOD solution to thie fundamental issue yet. It was mentioned that MicroSoft is working on a best-practices document regarding surrogate keys generation . I can hardly wait for it to be released!
Barkingdog
|||Actually, I can tell you the technique I have used, and don't recollect ever having a problem with it:
1: ALL rtables must have a _natural_ key defined, and enforced as a unique index.
2: Now after inserting a row into an rtable that uses a system generated surrogate key, you can use the _natural key_ to find the row, therefore it is guaranteed to be the correct row, and retrieve whatever surrogate system generated key was inserted in that row. Obviously there is a performance price to pay to getting the right answer, but typically that's better than a fast wrong answer...
3:now you can use that _guaranteed correct_ surrogate key in further processing as needed.
It has been many years since I have built an rtable that did not enforce uiqueness based on a _natural_ key. It is the only way to go...
Last GASP on "Insert row in table with Identity field, and get new Identity back "
While I have learned a lot from this thread I am still basically confused about the issues involved.
.I wanted to INSERT a record in a parent table, get the Identity back and use it in a child table. Seems simple.
To my knowledge, mine would be the only process running that would update these tables. I was told that there is no guarantee, because the OLEDB provider could write the second destination row before the first, that the proper parent-child relationship would be generated as expected. It was recommended that I create my own variable in memory to hold the Identity value and use that in my SSIS package.
1. A simple example SSIS .dts example illustrating the approach of using a variable for identity would be helpful.
2. Suppose I actually had two processes updating these tables, running at the same time. Then it seems the "variable" method will also have its problems. Is there a final solution other than locking the tables involved prior to updating them or doing something crazy like using a GUID for the primary key!
3. We have done the type of parent-child inserts I originally described from t-sql for years without any apparent problems. (Maybe we were just lucky.) Is the entire issue simply a t-sql one or does SSIS add a layer of complexity beyond t-sql that needs to be addressed?
TIA,
Barkingdog
SSIS processes data in a different way than T-SQL. The "pipleine" processes differently than batch oriented SQL and differently than cursor based SQL. This is by design of course and has certain benefits and trade-offs, and requires a different way of implementing a solution.
Whether you want to characterize that as an additional "layer of complexity" or not is up to you. I guess if you now have differing options for processing data, that have different advantages and disadvantages, with different costs and benefits, where previously you had only one option , you might consider that more complexity.
I consider it more options - and glad to have 'em...
|||
This post includes examples of how to create surrogate keys using SSIS, effectively the same problem as you are trying to solve: http://sqljunkies.com/WebLog/sqlbi/archive/2005/05/30/15684.aspx
We do not have a packaged solution for highly parallel loads in this version, but we will be releasing a paper on this subject in coming months.
Donald
|||Thanks,
I will read through the paper.
I am starting to think that, because of parallesim in SSIS, that the sql uniqueidentifier may be a more suitable "primary key" for a table than the traditional Identity value (integer) used in the past.
But I do believe the problem relates to paralellism in SSIS. I don't think this problem would likely occur from a stored proc call that used the "insert a new record, get the identity value, populate the child" approach. (Though I guess it could happen if one had a server farm..... Why is everything so complicated?!)
TIA,
Barkingdog
|||It's not because of parallelism in SSIS. We have seen this same problem with inserting and immediately retrieving an identity over many years. Unfortunately, everyone thinks they can guarantee the result, and sooner or later they trip up because of some glitch. Unfortunately, because these values are your unique identifiers, such a trip up can be quite serious.
Read:
http://www.aspfaq.com/show.asp?id=2499
http://www.databasejournal.com/features/mssql/article.php/3307541
Donald
|||>> We have seen this same problem with inserting and immediately retrieving an identity over many years"
The problem I face is that we will be running a single program or SSIS package that is the only program which updates these tables. Nothing else will update them. There are no multiple users, no server farm. I can hear the developers saying that the "problem" mentioned can not happen in that of environemnt. Are they correct or can someone come up with a simple t-sql script that forces the problem to happen in any sql environment?
TIA,
Barkingdog
|||
>The problem I face is that we will be running a single program or SSIS package that is the only program which updates these tables. Nothing else will update them. There are no multiple users, no server farm.
The problem I face is that I have heard this many times from many users - and yet somewhere, somehow, somewhen, the world turns out to be not quite this tidy.
If you think this will work for you, I guess I can only say good luck. But I have an uneasy feeling that in a few months time we'll be reading the "how do I rekey all my child records?" post. ![]()
Donald
|||Thanks Donald. I will follow your sage advice!
I'm just preparing for the bruises\abuse I'm going to get from developers who will think I'm wrong and crazy on this point. I'm sure the URL's you listed will dull their bite.
Barkingdog
|||Here's what I have learned about this issue so far:
1. This issue has always existed. It is now aggravated by multi-processor systems, server farms, and the parellelism introduced in SSIS.
2. The best thought seems to be to generate one's own counter and use it instead of relying upon an Identity field.
3. While better to use SCOPE_IDENTITY than @.@.Identity or IDENT_CURRENT, even that will not guarantee a correct parent-child linkage. (The problem is if one t-sql operaiton starts before another their is no guarantee it will complete and commit before the other. Forget sequential processing.)
4. I think the only available way to get the proper linkage is to use GUID (from NEWID()) to generate the "identity" key for tables. (But that approach won't be quick for use in JOINS unless I index the GUIDs!)
In summary, I don't think there is a GOOD solution to thie fundamental issue yet. It was mentioned that MicroSoft is working on a best-practices document regarding surrogate keys generation . I can hardly wait for it to be released!
Barkingdog
|||Actually, I can tell you the technique I have used, and don't recollect ever having a problem with it:
1: ALL rtables must have a _natural_ key defined, and enforced as a unique index.
2: Now after inserting a row into an rtable that uses a system generated surrogate key, you can use the _natural key_ to find the row, therefore it is guaranteed to be the correct row, and retrieve whatever surrogate system generated key was inserted in that row. Obviously there is a performance price to pay to getting the right answer, but typically that's better than a fast wrong answer...
3:now you can use that _guaranteed correct_ surrogate key in further processing as needed.
It has been many years since I have built an rtable that did not enforce uiqueness based on a _natural_ key. It is the only way to go...
Monday, March 12, 2012
Last Day of Month Function
I am trying to avoid using wordy logic to get date values meeting criteria
for the last day of the each month in a date field. Is anyone aware of a
last day of the month function? I know that Oracle offers this.
Thanks for your help.
J.Hi,
There is no direct function in SQL Server to get last day of the month. You
will have to use Datepart and DateAdd function to achive this.
Thanks
Hari
SQL Server MVP
"j" <j@.discussions.microsoft.com> wrote in message
news:82F8CA8D-18EF-476B-8006-A14C0DE20586@.microsoft.com...
> Hello all,
> I am trying to avoid using wordy logic to get date values meeting criteria
> for the last day of the each month in a date field. Is anyone aware of a
> last day of the month function? I know that Oracle offers this.
> Thanks for your help.
> J.|||If you use SQL Server 2000, you can write your own LastDayOfMonth(month) UDF
easily.
"j" <j@.discussions.microsoft.com> wrote in message
news:82F8CA8D-18EF-476B-8006-A14C0DE20586@.microsoft.com...
> Hello all,
> I am trying to avoid using wordy logic to get date values meeting criteria
> for the last day of the each month in a date field. Is anyone aware of a
> last day of the month function? I know that Oracle offers this.
> Thanks for your help.
> J.|||Unfortunately you have to do it yourself... Easiest way is to take one day
prior to first day of next month
Declare @.D DateTime
Set @.D = getdate()
Select DateAdd(day, -1, convert(varchar(6),
DateAdd(month,1,@.D),112) + '01')
"j" wrote:
> Hello all,
> I am trying to avoid using wordy logic to get date values meeting criteria
> for the last day of the each month in a date field. Is anyone aware of a
> last day of the month function? I know that Oracle offers this.
> Thanks for your help.
> J.|||There is no such function directly, but you can use the following:
DECLARE @.dt SMALLDATETIME
SET @.dt = GETDATE()
SELECT DATEADD(dd, -1, DATEADD(mm, 1, DATEADD(dd,1-DAY(@.dt), @.dt)))
Or you can use a calendar table: http://www.aspfaq.com/show.asp?id=2519
Jacco Schalkwijk
SQL Server MVP
"j" <j@.discussions.microsoft.com> wrote in message
news:82F8CA8D-18EF-476B-8006-A14C0DE20586@.microsoft.com...
> Hello all,
> I am trying to avoid using wordy logic to get date values meeting criteria
> for the last day of the each month in a date field. Is anyone aware of a
> last day of the month function? I know that Oracle offers this.
> Thanks for your help.
> J.|||Use a Calender table.
Or use dateadd and datepart:
select dateadd(d, -datepart(d, getdate()), dateadd(m, 1, getdate()))
"j" <j@.discussions.microsoft.com> wrote in message
news:82F8CA8D-18EF-476B-8006-A14C0DE20586@.microsoft.com...
> Hello all,
> I am trying to avoid using wordy logic to get date values meeting criteria
> for the last day of the each month in a date field. Is anyone aware of a
> last day of the month function? I know that Oracle offers this.
> Thanks for your help.
> J.|||Thank you everyone so very much!! ;->
"j" wrote:
> Hello all,
> I am trying to avoid using wordy logic to get date values meeting criteria
> for the last day of the each month in a date field. Is anyone aware of a
> last day of the month function? I know that Oracle offers this.
> Thanks for your help.
> J.
Friday, March 9, 2012
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
large varchar update fails on sql 2000 server, works on dev. machine
service pack 4 won't update a sort of large varchar field, which works
fine on my development machine, (xp pro sql 2000).
try this in the query analyzer:
CREATE TABLE [dbo].[tbl_why] (
[pr_id] [int] IDENTITY (1, 1) NOT NULL ,
[pr_user_snapshot] [varchar] (2000) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
--create a row by entering something in the snapshot field like
"what the fu!$*!?"
--test this
declare @.pr_user_snapshot varchar(2000)
set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
associated with these applications:</td><td class=InputLabel
>Elevator</td></tr><tr><td>The renewal cycle is:</td><td
class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
starting on:</td><td class=InputLabel >JAN 1</td></
tr><tr><td>There is a cost per item of:</td><td class=InputLabel
>200.00 </td></tr><tr><td>There is a fixed cost of:</td><td
class=InputLabel > </td></tr><tr><td>There is a minimum cost of:</
td><td class=InputLabel > </td></tr><tr><td>There is a maximum
cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
tr><tr><td>Proceeds applied to Financial Account:</td><td
class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
applied to Financial Account:</td><td class=InputLabel >20256200
Building Legalization (Penalty) </td></tr>'
print len(@.pr_user_snapshot)
UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id =
1
...not brain surgery...
It updates to a blank, not null result. Somewhere around 800
characters the thing starts working on the server. Increasing the
field size makes no difference.
Is there some server setting I've missed that is set on my dev. box?
I can't find anything.
What's with this' Is this me'
ThanksOn Apr 11, 3:26 pm, "tkent" <t...@.aceinc.com> wrote:
> A production system (server 2003 enterprise edition) sql 2000 server,
> service pack 4 won't update a sort of large varchar field, which works
> fine on my development machine, (xp pro sql 2000).
> try this in the query analyzer:
> CREATE TABLE [dbo].[tbl_why] (
> [pr_id] [int] IDENTITY (1, 1) NOT NULL ,
> [pr_user_snapshot] [varchar] (2000) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> --create a row by entering something in the snapshot field like
> "what the fu!$*!?"
> --test this
> declare @.pr_user_snapshot varchar(2000)
> set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
> class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
> associated with these applications:</td><td class=InputLabel>Elevator</td>
</tr><tr><td>The renewal cycle is:</td><td
> class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
> starting on:</td><td class=InputLabel >JAN 1</td></
> tr><tr><td>There is a cost per item of:</td><td class=InputLabel>200.00&am
p;nbsp;</td></tr><tr><td>There is a fixed cost of:</td><td
> class=InputLabel > </td></tr><tr><td>There is a minimum cost of:<
/
> td><td class=InputLabel > </td></tr><tr><td>There is a maximum
> cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
> basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
> colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
> Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
> td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
> Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
> colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
> td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
> td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
> td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
> tr><tr><td>Proceeds applied to Financial Account:</td><td
> class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
> applied to Financial Account:</td><td class=InputLabel >20256200
> Building Legalization (Penalty) </td></tr>'
> print len(@.pr_user_snapshot)
> UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id =
> 1
> --
> ...not brain surgery...
> It updates to a blank, not null result. Somewhere around 800
> characters the thing starts working on the server. Increasing the
> field size makes no difference.
> Is there some server setting I've missed that is set on my dev. box?
> I can't find anything.
> What's with this' Is this me'
> Thanks
[vbcol=seagreen]
Perhaps, did you notice that the table is empty? This means you can't
update can you?
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||On Apr 11, 3:26 pm, "tkent" <t...@.aceinc.com> wrote:
> A production system (server 2003 enterprise edition) sql 2000 server,
> service pack 4 won't update a sort of large varchar field, which works
> fine on my development machine, (xp pro sql 2000).
> try this in the query analyzer:
> CREATE TABLE [dbo].[tbl_why] (
> [pr_id] [int] IDENTITY (1, 1) NOT NULL ,
> [pr_user_snapshot] [varchar] (2000) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> --create a row by entering something in the snapshot field like
> "what the fu!$*!?"
> --test this
> declare @.pr_user_snapshot varchar(2000)
> set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
> class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
> associated with these applications:</td><td class=InputLabel>Elevator</td>
</tr><tr><td>The renewal cycle is:</td><td
> class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
> starting on:</td><td class=InputLabel >JAN 1</td></
> tr><tr><td>There is a cost per item of:</td><td class=InputLabel>200.00&am
p;nbsp;</td></tr><tr><td>There is a fixed cost of:</td><td
> class=InputLabel > </td></tr><tr><td>There is a minimum cost of:<
/
> td><td class=InputLabel > </td></tr><tr><td>There is a maximum
> cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
> basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
> colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
> Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
> td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
> Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
> colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
> td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
> td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
> td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
> tr><tr><td>Proceeds applied to Financial Account:</td><td
> class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
> applied to Financial Account:</td><td class=InputLabel >20256200
> Building Legalization (Penalty) </td></tr>'
> print len(@.pr_user_snapshot)
> UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id =
> 1
> --
> ...not brain surgery...
> It updates to a blank, not null result. Somewhere around 800
> characters the thing starts working on the server. Increasing the
> field size makes no difference.
> Is there some server setting I've missed that is set on my dev. box?
> I can't find anything.
> What's with this' Is this me'
> Thanks
I added this before the update
insert tbl_why
select 'bla'
and had no problem
So again are you sure the table is not empty?
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||Thanks for checking.
I am sure the table is not empty.
As I said, it will start updating at around 800 characters, but the
string I'm using is showing a len of around 1550.
Are YOU on a server? - this works for me on my local machine but not
on either of 2 servers (as described) I need to get this going on.
Seems like a setting but what?
> I added this before the update
> insert tbl_why
> select 'bla'
> and had no problem
> So again are you sure the table is not empty?|||Script the entire DDL for the table, including triggers. I suspect either a
poorly written trigger or multiple tables with the same name but different
owners. Both are a frequent cause of unexpected behavior. Your own
statements did not fully qualify the table.
If you still can't figure it out, then I suggest you create/run a complete
script to reproduce the problem. This includes the table creation DDL,
which you yourself run on the "server" in question and verify as acting in
the manner described. A script similar to the one your posted (but with
an insert statement and fully qualified tablenames) works correctly on 2000
sp3a. I seriously doubt that the version of sql server or the OS has
anything to do with the issue.
large varchar update fails on sql 2000 server, works on dev. machine
service pack 4 won't update a sort of large varchar field, which works
fine on my development machine, (xp pro sql 2000).
try this in the query analyzer:
CREATE TABLE [dbo].[tbl_why] (
[pr_id] [int] IDENTITY (1, 1) NOT NULL ,
[pr_user_snapshot] [varchar] (2000) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
--create a row by entering something in the snapshot field like
"what the fu!$*!?"
--test this
declare @.pr_user_snapshot varchar(2000)
set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
associated with these applications:</td><td class=InputLabel
>Elevator</td></tr><tr><td>The renewal cycle is:</td><td
class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
starting on:</td><td class=InputLabel >JAN 1</td></
tr><tr><td>There is a cost per item of:</td><td class=InputLabel
>200.00 </td></tr><tr><td>There is a fixed cost of:</td><td
class=InputLabel > </td></tr><tr><td>There is a minimum cost of:</
td><td class=InputLabel > </td></tr><tr><td>There is a maximum
cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
tr><tr><td>Proceeds applied to Financial Account:</td><td
class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
applied to Financial Account:</td><td class=InputLabel >20256200
Building Legalization (Penalty) </td></tr>'
print len(@.pr_user_snapshot)
UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id =
1
...not brain surgery...
It updates to a blank, not null result. Somewhere around 800
characters the thing starts working on the server. Increasing the
field size makes no difference.
Is there some server setting I've missed that is set on my dev. box?
I can't find anything.
What's with this? Is this me?
Thanks
On Apr 11, 3:26 pm, "tkent" <t...@.aceinc.com> wrote:
> A production system (server 2003 enterprise edition) sql 2000 server,
> service pack 4 won't update a sort of large varchar field, which works
> fine on my development machine, (xp pro sql 2000).
> try this in the query analyzer:
> CREATE TABLE [dbo].[tbl_why] (
> [pr_id] [int] IDENTITY (1, 1) NOT NULL ,
> [pr_user_snapshot] [varchar] (2000) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> --create a row by entering something in the snapshot field like
> "what the fu!$*!?"
> --test this
> declare @.pr_user_snapshot varchar(2000)
> set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
> class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
> associated with these applications:</td><td class=InputLabel>Elevator</td></tr><tr><td>The renewal cycle is:</td><td
> class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
> starting on:</td><td class=InputLabel >JAN 1</td></
> tr><tr><td>There is a cost per item of:</td><td class=InputLabel>200.00 </td></tr><tr><td>There is a fixed cost of:</td><td
> class=InputLabel > </td></tr><tr><td>There is a minimum cost of:</
> td><td class=InputLabel > </td></tr><tr><td>There is a maximum
> cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
> basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
> colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
> Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
> td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
> Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
> colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
> td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
> td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
> td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
> tr><tr><td>Proceeds applied to Financial Account:</td><td
> class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
> applied to Financial Account:</td><td class=InputLabel >20256200
> Building Legalization (Penalty) </td></tr>'
> print len(@.pr_user_snapshot)
> UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id =
> 1
> --
> ...not brain surgery...
> It updates to a blank, not null result. Somewhere around 800
> characters the thing starts working on the server. Increasing the
> field size makes no difference.
> Is there some server setting I've missed that is set on my dev. box?
> I can't find anything.
> What's with this? Is this me?
> Thanks
[vbcol=seagreen]
Perhaps, did you notice that the table is empty? This means you can't
update can you?
Denis the SQL Menace
http://sqlservercode.blogspot.com/
|||On Apr 11, 3:26 pm, "tkent" <t...@.aceinc.com> wrote:
> A production system (server 2003 enterprise edition) sql 2000 server,
> service pack 4 won't update a sort of large varchar field, which works
> fine on my development machine, (xp pro sql 2000).
> try this in the query analyzer:
> CREATE TABLE [dbo].[tbl_why] (
> [pr_id] [int] IDENTITY (1, 1) NOT NULL ,
> [pr_user_snapshot] [varchar] (2000) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> --create a row by entering something in the snapshot field like
> "what the fu!$*!?"
> --test this
> declare @.pr_user_snapshot varchar(2000)
> set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
> class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
> associated with these applications:</td><td class=InputLabel>Elevator</td></tr><tr><td>The renewal cycle is:</td><td
> class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
> starting on:</td><td class=InputLabel >JAN 1</td></
> tr><tr><td>There is a cost per item of:</td><td class=InputLabel>200.00 </td></tr><tr><td>There is a fixed cost of:</td><td
> class=InputLabel > </td></tr><tr><td>There is a minimum cost of:</
> td><td class=InputLabel > </td></tr><tr><td>There is a maximum
> cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
> basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
> colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
> Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
> td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
> Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
> colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
> td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
> td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
> td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
> tr><tr><td>Proceeds applied to Financial Account:</td><td
> class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
> applied to Financial Account:</td><td class=InputLabel >20256200
> Building Legalization (Penalty) </td></tr>'
> print len(@.pr_user_snapshot)
> UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id =
> 1
> --
> ...not brain surgery...
> It updates to a blank, not null result. Somewhere around 800
> characters the thing starts working on the server. Increasing the
> field size makes no difference.
> Is there some server setting I've missed that is set on my dev. box?
> I can't find anything.
> What's with this? Is this me?
> Thanks
I added this before the update
insert tbl_why
select 'bla'
and had no problem
So again are you sure the table is not empty?
Denis the SQL Menace
http://sqlservercode.blogspot.com/
|||Thanks for checking.
I am sure the table is not empty.
As I said, it will start updating at around 800 characters, but the
string I'm using is showing a len of around 1550.
Are YOU on a server? - this works for me on my local machine but not
on either of 2 servers (as described) I need to get this going on.
Seems like a setting but what?
> I added this before the update
> insert tbl_why
> select 'bla'
> and had no problem
> So again are you sure the table is not empty?
|||Script the entire DDL for the table, including triggers. I suspect either a
poorly written trigger or multiple tables with the same name but different
owners. Both are a frequent cause of unexpected behavior. Your own
statements did not fully qualify the table.
If you still can't figure it out, then I suggest you create/run a complete
script to reproduce the problem. This includes the table creation DDL,
which you yourself run on the "server" in question and verify as acting in
the manner described. A script similar to the one your posted (but with
an insert statement and fully qualified tablenames) works correctly on 2000
sp3a. I seriously doubt that the version of sql server or the OS has
anything to do with the issue.
large varchar update fails on sql 2000 server, works on dev. machine
service pack 4 won't update a sort of large varchar field, which works
fine on my development machine, (xp pro sql 2000).
try this in the query analyzer:
CREATE TABLE [dbo].[tbl_why] (
[pr_id] [int] IDENTITY (1, 1) NOT NULL ,
[pr_user_snapshot] [varchar] (2000) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
--create a row by entering something in the snapshot field like
"what the fu!$*!?"
--test this
declare @.pr_user_snapshot varchar(2000)
set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
associated with these applications:</td><td class=InputLabel
>Elevator</td></tr><tr><td>The renewal cycle is:</td><td
class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
starting on:</td><td class=InputLabel >JAN 1</td></
tr><tr><td>There is a cost per item of:</td><td class=InputLabel
>200.00 </td></tr><tr><td>There is a fixed cost of:</td><td
class=InputLabel > </td></tr><tr><td>There is a minimum cost of:</
td><td class=InputLabel > </td></tr><tr><td>There is a maximum
cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
tr><tr><td>Proceeds applied to Financial Account:</td><td
class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
applied to Financial Account:</td><td class=InputLabel >20256200
Building Legalization (Penalty) </td></tr>'
print len(@.pr_user_snapshot)
UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id = 1
--
...not brain surgery...
It updates to a blank, not null result. Somewhere around 800
characters the thing starts working on the server. Increasing the
field size makes no difference.
Is there some server setting I've missed that is set on my dev. box?
I can't find anything.
What's with this' Is this me'
ThanksOn Apr 11, 3:26 pm, "tkent" <t...@.aceinc.com> wrote:
> A production system (server 2003 enterprise edition) sql 2000 server,
> service pack 4 won't update a sort of large varchar field, which works
> fine on my development machine, (xp pro sql 2000).
> try this in the query analyzer:
> CREATE TABLE [dbo].[tbl_why] (
> [pr_id] [int] IDENTITY (1, 1) NOT NULL ,
> [pr_user_snapshot] [varchar] (2000) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> --create a row by entering something in the snapshot field like
> "what the fu!$*!?"
> --test this
> declare @.pr_user_snapshot varchar(2000)
> set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
> class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
> associated with these applications:</td><td class=InputLabel>Elevator</td></tr><tr><td>The renewal cycle is:</td><td
> class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
> starting on:</td><td class=InputLabel >JAN 1</td></
> tr><tr><td>There is a cost per item of:</td><td class=InputLabel>200.00 </td></tr><tr><td>There is a fixed cost of:</td><td
> class=InputLabel > </td></tr><tr><td>There is a minimum cost of:</
> td><td class=InputLabel > </td></tr><tr><td>There is a maximum
> cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
> basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
> colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
> Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
> td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
> Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
> colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
> td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
> td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
> td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
> tr><tr><td>Proceeds applied to Financial Account:</td><td
> class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
> applied to Financial Account:</td><td class=InputLabel >20256200
> Building Legalization (Penalty) </td></tr>'
> print len(@.pr_user_snapshot)
> UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id => 1
> --
> ...not brain surgery...
> It updates to a blank, not null result. Somewhere around 800
> characters the thing starts working on the server. Increasing the
> field size makes no difference.
> Is there some server setting I've missed that is set on my dev. box?
> I can't find anything.
> What's with this' Is this me'
> Thanks
>>What's with this' Is this me'
Perhaps, did you notice that the table is empty? This means you can't
update can you?
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||On Apr 11, 3:26 pm, "tkent" <t...@.aceinc.com> wrote:
> A production system (server 2003 enterprise edition) sql 2000 server,
> service pack 4 won't update a sort of large varchar field, which works
> fine on my development machine, (xp pro sql 2000).
> try this in the query analyzer:
> CREATE TABLE [dbo].[tbl_why] (
> [pr_id] [int] IDENTITY (1, 1) NOT NULL ,
> [pr_user_snapshot] [varchar] (2000) COLLATE
> SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> --create a row by entering something in the snapshot field like
> "what the fu!$*!?"
> --test this
> declare @.pr_user_snapshot varchar(2000)
> set @.pr_user_snapshot = '<tr><td>This renewal type named:</td><td
> class=InputLabel >Annual Elevator Permit</td></tr><tr><td>is
> associated with these applications:</td><td class=InputLabel>Elevator</td></tr><tr><td>The renewal cycle is:</td><td
> class=InputLabel >Fixed Starting Date</td></tr><tr><td>Annual renewal,
> starting on:</td><td class=InputLabel >JAN 1</td></
> tr><tr><td>There is a cost per item of:</td><td class=InputLabel>200.00 </td></tr><tr><td>There is a fixed cost of:</td><td
> class=InputLabel > </td></tr><tr><td>There is a minimum cost of:</
> td><td class=InputLabel > </td></tr><tr><td>There is a maximum
> cost of:</td><td class=InputLabel > </td></tr><tr><td>Late charge
> basis:</td><td class=InputLabel >Per Item</td></tr><tr><td
> colspan=2><table border=0 width=100%><tr><td colspan=4>1st Late
> Window</td></tr><tr><td>1 Day</td><td>And Later</td><td>$200.00</
> td><td>Late fee per elevator</td></tr><tr><td colspan=4>2nd Late
> Window</td></tr><tr><td></td><td></td><td>$</td><td></td></tr><tr><td
> colspan=4>3rd Late Window</td></tr><tr><td></td><td></td><td>$</
> td><td></td></tr><tr><td colspan=4>4th Late Window</td></tr><tr><td></
> td><td></td><td>$</td><td></td></tr><tr><td colspan=4>5th Late Window</
> td></tr><tr><td></td><td></td><td>$</td><td></td></tr></table></td></
> tr><tr><td>Proceeds applied to Financial Account:</td><td
> class=InputLabel >20255001 Elevator </td></tr><tr><td>Penalties
> applied to Financial Account:</td><td class=InputLabel >20256200
> Building Legalization (Penalty) </td></tr>'
> print len(@.pr_user_snapshot)
> UPDATE tbl_why SET pr_user_snapshot = @.pr_user_snapshot WHERE pr_id => 1
> --
> ...not brain surgery...
> It updates to a blank, not null result. Somewhere around 800
> characters the thing starts working on the server. Increasing the
> field size makes no difference.
> Is there some server setting I've missed that is set on my dev. box?
> I can't find anything.
> What's with this' Is this me'
> Thanks
I added this before the update
insert tbl_why
select 'bla'
and had no problem
So again are you sure the table is not empty?
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||Thanks for checking.
I am sure the table is not empty.
As I said, it will start updating at around 800 characters, but the
string I'm using is showing a len of around 1550.
Are YOU on a server? - this works for me on my local machine but not
on either of 2 servers (as described) I need to get this going on.
Seems like a setting but what?
> I added this before the update
> insert tbl_why
> select 'bla'
> and had no problem
> So again are you sure the table is not empty?|||Script the entire DDL for the table, including triggers. I suspect either a
poorly written trigger or multiple tables with the same name but different
owners. Both are a frequent cause of unexpected behavior. Your own
statements did not fully qualify the table.
If you still can't figure it out, then I suggest you create/run a complete
script to reproduce the problem. This includes the table creation DDL,
which you yourself run on the "server" in question and verify as acting in
the manner described. A script similar to the one your posted (but with
an insert statement and fully qualified tablenames) works correctly on 2000
sp3a. I seriously doubt that the version of sql server or the OS has
anything to do with the issue.
Wednesday, March 7, 2012
Large Textboxes and paging in PDF files
paragraphs of information. When I export to pdf the page breaks don't work
correctly. It starts a new page unless the entire contents of the field will
fit on the existing page. I would like it to fit what it can on the existing
page and then flow over to the next page as one would expect.
Another thing I noticed is that if I shrink the textbox to about 3.5 inches
then it works as I would like except that it's in a narrow column. Anything
wider than that and the page break issue pops up again. Thanks.I am currently struggling with exactly the same issue. The reason that
making the textbox narrower seems to fix the page break issue is, I believe,
because the resultant narrow column of text is longer than one page can
accommodate, therefore RS knows it has to break the field anyway and so it
just renders it without throwing a new page first. If the textbox can fit
completely on one page then RS bumps it over to the next page. This would be
fine as long as you can turn it off from a property but it doesn't seem like
you can.
Has anyone out there got a way of fixing this or working around it?
Cs.
"MR" wrote:
> I've got a textbox bound to a text sql server field that contains about four
> paragraphs of information. When I export to pdf the page breaks don't work
> correctly. It starts a new page unless the entire contents of the field will
> fit on the existing page. I would like it to fit what it can on the existing
> page and then flow over to the next page as one would expect.
> Another thing I noticed is that if I shrink the textbox to about 3.5 inches
> then it works as I would like except that it's in a narrow column. Anything
> wider than that and the page break issue pops up again. Thanks.
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 FIeld: Easy Way to Copy and Paste Into?
file. For testing purposes before our .Net program is written, I would
like to populate that column in a few rows with some actual
text-representation of XML files. I thought I would just open the XML
file in a text editor (ultraedit) and then paste it in somehow.
Normaly I can go into Enterprise Manager and paste information into
columns from other apps - as long as the column can accept the data, no
problem.
However, there seems to be a limit on how much text I can paste into a
column via Enterprise Manager. It's not based on linefeeds
necessarily, because it handles multiple lines OK, just as long as you
don't try to paste too much.
Is there any other tool that I could use to slam some data quickly into
some columns. Insert statements using Query Analyzer are a pain (not
to mention needing to worry about apostrophes, etc.) - I was looking
for something rather visual and quick.
I tried this QA Lite tool which showed some promise
(http://www.rac4sql.net/qalite_main.asp) - but the limitation seems to
be similar there as well...
Any hints?
Thanks,
spedlists@.erstads.com
Try bulk insert.
It's just a matter of setting the end tags for the entries.
There are a few bugs associated with bulk inserting into text column though
so post again if you have problems - it might not be your code.
"Sped" wrote:
> I have a column that I want to store the entire contents of an XML
> file. For testing purposes before our .Net program is written, I would
> like to populate that column in a few rows with some actual
> text-representation of XML files. I thought I would just open the XML
> file in a text editor (ultraedit) and then paste it in somehow.
> Normaly I can go into Enterprise Manager and paste information into
> columns from other apps - as long as the column can accept the data, no
> problem.
> However, there seems to be a limit on how much text I can paste into a
> column via Enterprise Manager. It's not based on linefeeds
> necessarily, because it handles multiple lines OK, just as long as you
> don't try to paste too much.
> Is there any other tool that I could use to slam some data quickly into
> some columns. Insert statements using Query Analyzer are a pain (not
> to mention needing to worry about apostrophes, etc.) - I was looking
> for something rather visual and quick.
> I tried this QA Lite tool which showed some promise
> (http://www.rac4sql.net/qalite_main.asp) - but the limitation seems to
> be similar there as well...
> Any hints?
> Thanks,
> spedlists@.erstads.com
>
Large text block into ntext
out of Notepad into field in Enterprise Manager? But it truncates.
Is there a command line that will put text into specific field in specific
table?
Use the ado stream object or textcopy
have a look at this link for more info on how to do this.
http://www.indexserverfaq.com/SQLLoadADO.htm
http://www.indexserverfaq.com/TextCopy.htm
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"EdwardH" <EdwardH@.discussions.microsoft.com> wrote in message
news:C3C68066-04B7-4C81-A7C1-E95EF0FC4E8A@.microsoft.com...
> How can I get a block of text into an ntext field. Have tried copy and
paste
> out of Notepad into field in Enterprise Manager? But it truncates.
> Is there a command line that will put text into specific field in specific
> table?
>
Large table query 99% results streamed quickly, huge pause for las
select * from table
where field = 'abc'
In SQL Server 2005 I see that there is some new data retrieval mechanism in
the query analyser tool so that results are streamed in. What I mean is that
if I do a query on my large table I get first 1000 rows in about 1 seconds,
and next 1000 in the next 1s and this continues right up to about 2 mins ,
where I have about 29000 rows sitting in query analyser, but it hasn't
finished yet, it sits there churning for another 10 mins before it finishes
and the total row count is 29052 records.
I don't understand why 99% of results are returned quickly (15% of the time)
and then the last 1% of the results are returned in a huge amount of time
(85%)
In SQL 2000 doing this query has query analyser sitting there bored for
quite a while.
I have changed the query to return a smaller set of data like 15000 records
and the same thing happens where it returns 99% of records quite quickly but
the last 1% of data still takes about 10 mins to return.
I have tried creating a stored procedure to do this thinking it might work
better but no, and have tried doing a top 100 PERCENT with no success either.
It's difficult to speculate without knowing what your query and data look
like. A likely possibility is you're returning 29000 records out of a few
million and the records you selected are toward the front of the table scan
order. When you retrieve that many records the query processor likely will
be doing a table scan and unless there's something in the query to indicate
when it's done, every row in the table will be read. Looking at the query
plan will help you understand what the query processor is doing.
How are you determining how many records have been returned? Are you
actually scrolling through the data so you know the records have been
returned and rendered in the UI? Do you get different results if you
display the results as text?
I have to ask - do you really read 29000 records in Management Studio? Even
if you read a record a second that's almost an hour of reading. If you're
pulling back that many records to page through a look at a few records, you
using a lot of processing power, memory, and bandwidth on the server for no
reason.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:4F777E81-4736-4E8F-BDFF-C203CE50A6D2@.microsoft.com...
> My Query looks like this.
> select * from table
> where field = 'abc'
> In SQL Server 2005 I see that there is some new data retrieval mechanism
> in
> the query analyser tool so that results are streamed in. What I mean is
> that
> if I do a query on my large table I get first 1000 rows in about 1
> seconds,
> and next 1000 in the next 1s and this continues right up to about 2 mins ,
> where I have about 29000 rows sitting in query analyser, but it hasn't
> finished yet, it sits there churning for another 10 mins before it
> finishes
> and the total row count is 29052 records.
> I don't understand why 99% of results are returned quickly (15% of the
> time)
> and then the last 1% of the results are returned in a huge amount of time
> (85%)
> In SQL 2000 doing this query has query analyser sitting there bored for
> quite a while.
> I have changed the query to return a smaller set of data like 15000
> records
> and the same thing happens where it returns 99% of records quite quickly
> but
> the last 1% of data still takes about 10 mins to return.
> I have tried creating a stored procedure to do this thinking it might work
> better but no, and have tried doing a top 100 PERCENT with no success
> either.
|||Thanks for the reply, I agree ... I think it is doing a full table scan.
I am determining the number of records being returned by looking at the
bottom of the management studio where it tells you how many records are
returned, also when it has a record id column, which I see increments for
each new row of data is returned. Yes I am scrolling through the data.
Display the results as text? Not sure what you mean there sorry.
I am not reading the records. Just wanting to see how long it takes to
retrieve different sets of data from this table.
"Roger Wolter[MSFT]" wrote:
> It's difficult to speculate without knowing what your query and data look
> like. A likely possibility is you're returning 29000 records out of a few
> million and the records you selected are toward the front of the table scan
> order. When you retrieve that many records the query processor likely will
> be doing a table scan and unless there's something in the query to indicate
> when it's done, every row in the table will be read. Looking at the query
> plan will help you understand what the query processor is doing.
> How are you determining how many records have been returned? Are you
> actually scrolling through the data so you know the records have been
> returned and rendered in the UI? Do you get different results if you
> display the results as text?
> I have to ask - do you really read 29000 records in Management Studio? Even
> if you read a record a second that's almost an hour of reading. If you're
> pulling back that many records to page through a look at a few records, you
> using a lot of processing power, memory, and bandwidth on the server for no
> reason.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Peter" <Peter@.discussions.microsoft.com> wrote in message
> news:4F777E81-4736-4E8F-BDFF-C203CE50A6D2@.microsoft.com...
>
|||If you're not actually looking at the results as they come in, you may be
seeing a UI painting delay. The results may all be retrieved and in memory
but not rendered in the grid yet. If you look at the Management Studio
options and change the result display option to text or a file instead of
grid, the results will appear significantly faster. Bottom line is that
with that many results, creating and formatting the grid cells generally
takes more time than retrieving the results.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:89E01783-910F-4549-94BB-1567701DB175@.microsoft.com...[vbcol=seagreen]
> Thanks for the reply, I agree ... I think it is doing a full table scan.
> I am determining the number of records being returned by looking at the
> bottom of the management studio where it tells you how many records are
> returned, also when it has a record id column, which I see increments for
> each new row of data is returned. Yes I am scrolling through the data.
> Display the results as text? Not sure what you mean there sorry.
> I am not reading the records. Just wanting to see how long it takes to
> retrieve different sets of data from this table.
> "Roger Wolter[MSFT]" wrote:
Large table query 99% results streamed quickly, huge pause for las
select * from table
where field = 'abc'
In SQL Server 2005 I see that there is some new data retrieval mechanism in
the query analyser tool so that results are streamed in. What I mean is that
if I do a query on my large table I get first 1000 rows in about 1 seconds,
and next 1000 in the next 1s and this continues right up to about 2 mins ,
where I have about 29000 rows sitting in query analyser, but it hasn't
finished yet, it sits there churning for another 10 mins before it finishes
and the total row count is 29052 records.
I don't understand why 99% of results are returned quickly (15% of the time)
and then the last 1% of the results are returned in a huge amount of time
(85%)
In SQL 2000 doing this query has query analyser sitting there bored for
quite a while.
I have changed the query to return a smaller set of data like 15000 records
and the same thing happens where it returns 99% of records quite quickly but
the last 1% of data still takes about 10 mins to return.
I have tried creating a stored procedure to do this thinking it might work
better but no, and have tried doing a top 100 PERCENT with no success either.It's difficult to speculate without knowing what your query and data look
like. A likely possibility is you're returning 29000 records out of a few
million and the records you selected are toward the front of the table scan
order. When you retrieve that many records the query processor likely will
be doing a table scan and unless there's something in the query to indicate
when it's done, every row in the table will be read. Looking at the query
plan will help you understand what the query processor is doing.
How are you determining how many records have been returned? Are you
actually scrolling through the data so you know the records have been
returned and rendered in the UI? Do you get different results if you
display the results as text?
I have to ask - do you really read 29000 records in Management Studio? Even
if you read a record a second that's almost an hour of reading. If you're
pulling back that many records to page through a look at a few records, you
using a lot of processing power, memory, and bandwidth on the server for no
reason.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:4F777E81-4736-4E8F-BDFF-C203CE50A6D2@.microsoft.com...
> My Query looks like this.
> select * from table
> where field = 'abc'
> In SQL Server 2005 I see that there is some new data retrieval mechanism
> in
> the query analyser tool so that results are streamed in. What I mean is
> that
> if I do a query on my large table I get first 1000 rows in about 1
> seconds,
> and next 1000 in the next 1s and this continues right up to about 2 mins ,
> where I have about 29000 rows sitting in query analyser, but it hasn't
> finished yet, it sits there churning for another 10 mins before it
> finishes
> and the total row count is 29052 records.
> I don't understand why 99% of results are returned quickly (15% of the
> time)
> and then the last 1% of the results are returned in a huge amount of time
> (85%)
> In SQL 2000 doing this query has query analyser sitting there bored for
> quite a while.
> I have changed the query to return a smaller set of data like 15000
> records
> and the same thing happens where it returns 99% of records quite quickly
> but
> the last 1% of data still takes about 10 mins to return.
> I have tried creating a stored procedure to do this thinking it might work
> better but no, and have tried doing a top 100 PERCENT with no success
> either.|||Thanks for the reply, I agree ... I think it is doing a full table scan.
I am determining the number of records being returned by looking at the
bottom of the management studio where it tells you how many records are
returned, also when it has a record id column, which I see increments for
each new row of data is returned. Yes I am scrolling through the data.
Display the results as text? Not sure what you mean there sorry.
I am not reading the records. Just wanting to see how long it takes to
retrieve different sets of data from this table.
"Roger Wolter[MSFT]" wrote:
> It's difficult to speculate without knowing what your query and data look
> like. A likely possibility is you're returning 29000 records out of a few
> million and the records you selected are toward the front of the table scan
> order. When you retrieve that many records the query processor likely will
> be doing a table scan and unless there's something in the query to indicate
> when it's done, every row in the table will be read. Looking at the query
> plan will help you understand what the query processor is doing.
> How are you determining how many records have been returned? Are you
> actually scrolling through the data so you know the records have been
> returned and rendered in the UI? Do you get different results if you
> display the results as text?
> I have to ask - do you really read 29000 records in Management Studio? Even
> if you read a record a second that's almost an hour of reading. If you're
> pulling back that many records to page through a look at a few records, you
> using a lot of processing power, memory, and bandwidth on the server for no
> reason.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Peter" <Peter@.discussions.microsoft.com> wrote in message
> news:4F777E81-4736-4E8F-BDFF-C203CE50A6D2@.microsoft.com...
> > My Query looks like this.
> > select * from table
> > where field = 'abc'
> >
> > In SQL Server 2005 I see that there is some new data retrieval mechanism
> > in
> > the query analyser tool so that results are streamed in. What I mean is
> > that
> > if I do a query on my large table I get first 1000 rows in about 1
> > seconds,
> > and next 1000 in the next 1s and this continues right up to about 2 mins ,
> > where I have about 29000 rows sitting in query analyser, but it hasn't
> > finished yet, it sits there churning for another 10 mins before it
> > finishes
> > and the total row count is 29052 records.
> >
> > I don't understand why 99% of results are returned quickly (15% of the
> > time)
> > and then the last 1% of the results are returned in a huge amount of time
> > (85%)
> >
> > In SQL 2000 doing this query has query analyser sitting there bored for
> > quite a while.
> >
> > I have changed the query to return a smaller set of data like 15000
> > records
> > and the same thing happens where it returns 99% of records quite quickly
> > but
> > the last 1% of data still takes about 10 mins to return.
> >
> > I have tried creating a stored procedure to do this thinking it might work
> > better but no, and have tried doing a top 100 PERCENT with no success
> > either.
>|||If you're not actually looking at the results as they come in, you may be
seeing a UI painting delay. The results may all be retrieved and in memory
but not rendered in the grid yet. If you look at the Management Studio
options and change the result display option to text or a file instead of
grid, the results will appear significantly faster. Bottom line is that
with that many results, creating and formatting the grid cells generally
takes more time than retrieving the results.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:89E01783-910F-4549-94BB-1567701DB175@.microsoft.com...
> Thanks for the reply, I agree ... I think it is doing a full table scan.
> I am determining the number of records being returned by looking at the
> bottom of the management studio where it tells you how many records are
> returned, also when it has a record id column, which I see increments for
> each new row of data is returned. Yes I am scrolling through the data.
> Display the results as text? Not sure what you mean there sorry.
> I am not reading the records. Just wanting to see how long it takes to
> retrieve different sets of data from this table.
> "Roger Wolter[MSFT]" wrote:
>> It's difficult to speculate without knowing what your query and data look
>> like. A likely possibility is you're returning 29000 records out of a
>> few
>> million and the records you selected are toward the front of the table
>> scan
>> order. When you retrieve that many records the query processor likely
>> will
>> be doing a table scan and unless there's something in the query to
>> indicate
>> when it's done, every row in the table will be read. Looking at the
>> query
>> plan will help you understand what the query processor is doing.
>> How are you determining how many records have been returned? Are you
>> actually scrolling through the data so you know the records have been
>> returned and rendered in the UI? Do you get different results if you
>> display the results as text?
>> I have to ask - do you really read 29000 records in Management Studio?
>> Even
>> if you read a record a second that's almost an hour of reading. If
>> you're
>> pulling back that many records to page through a look at a few records,
>> you
>> using a lot of processing power, memory, and bandwidth on the server for
>> no
>> reason.
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> Use of included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>> "Peter" <Peter@.discussions.microsoft.com> wrote in message
>> news:4F777E81-4736-4E8F-BDFF-C203CE50A6D2@.microsoft.com...
>> > My Query looks like this.
>> > select * from table
>> > where field = 'abc'
>> >
>> > In SQL Server 2005 I see that there is some new data retrieval
>> > mechanism
>> > in
>> > the query analyser tool so that results are streamed in. What I mean
>> > is
>> > that
>> > if I do a query on my large table I get first 1000 rows in about 1
>> > seconds,
>> > and next 1000 in the next 1s and this continues right up to about 2
>> > mins ,
>> > where I have about 29000 rows sitting in query analyser, but it hasn't
>> > finished yet, it sits there churning for another 10 mins before it
>> > finishes
>> > and the total row count is 29052 records.
>> >
>> > I don't understand why 99% of results are returned quickly (15% of the
>> > time)
>> > and then the last 1% of the results are returned in a huge amount of
>> > time
>> > (85%)
>> >
>> > In SQL 2000 doing this query has query analyser sitting there bored for
>> > quite a while.
>> >
>> > I have changed the query to return a smaller set of data like 15000
>> > records
>> > and the same thing happens where it returns 99% of records quite
>> > quickly
>> > but
>> > the last 1% of data still takes about 10 mins to return.
>> >
>> > I have tried creating a stored procedure to do this thinking it might
>> > work
>> > better but no, and have tried doing a top 100 PERCENT with no success
>> > either.
Large table query 99% results streamed quickly, huge pause for las
select * from table
where field = 'abc'
In SQL Server 2005 I see that there is some new data retrieval mechanism in
the query analyser tool so that results are streamed in. What I mean is tha
t
if I do a query on my large table I get first 1000 rows in about 1 seconds,
and next 1000 in the next 1s and this continues right up to about 2 mins ,
where I have about 29000 rows sitting in query analyser, but it hasn't
finished yet, it sits there churning for another 10 mins before it finishes
and the total row count is 29052 records.
I don't understand why 99% of results are returned quickly (15% of the time)
and then the last 1% of the results are returned in a huge amount of time
(85%)
In SQL 2000 doing this query has query analyser sitting there bored for
quite a while.
I have changed the query to return a smaller set of data like 15000 records
and the same thing happens where it returns 99% of records quite quickly but
the last 1% of data still takes about 10 mins to return.
I have tried creating a stored procedure to do this thinking it might work
better but no, and have tried doing a top 100 PERCENT with no success either
.It's difficult to speculate without knowing what your query and data look
like. A likely possibility is you're returning 29000 records out of a few
million and the records you selected are toward the front of the table scan
order. When you retrieve that many records the query processor likely will
be doing a table scan and unless there's something in the query to indicate
when it's done, every row in the table will be read. Looking at the query
plan will help you understand what the query processor is doing.
How are you determining how many records have been returned? Are you
actually scrolling through the data so you know the records have been
returned and rendered in the UI? Do you get different results if you
display the results as text?
I have to ask - do you really read 29000 records in Management Studio? Even
if you read a record a second that's almost an hour of reading. If you're
pulling back that many records to page through a look at a few records, you
using a lot of processing power, memory, and bandwidth on the server for no
reason.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:4F777E81-4736-4E8F-BDFF-C203CE50A6D2@.microsoft.com...
> My Query looks like this.
> select * from table
> where field = 'abc'
> In SQL Server 2005 I see that there is some new data retrieval mechanism
> in
> the query analyser tool so that results are streamed in. What I mean is
> that
> if I do a query on my large table I get first 1000 rows in about 1
> seconds,
> and next 1000 in the next 1s and this continues right up to about 2 mins ,
> where I have about 29000 rows sitting in query analyser, but it hasn't
> finished yet, it sits there churning for another 10 mins before it
> finishes
> and the total row count is 29052 records.
> I don't understand why 99% of results are returned quickly (15% of the
> time)
> and then the last 1% of the results are returned in a huge amount of time
> (85%)
> In SQL 2000 doing this query has query analyser sitting there bored for
> quite a while.
> I have changed the query to return a smaller set of data like 15000
> records
> and the same thing happens where it returns 99% of records quite quickly
> but
> the last 1% of data still takes about 10 mins to return.
> I have tried creating a stored procedure to do this thinking it might work
> better but no, and have tried doing a top 100 PERCENT with no success
> either.
Friday, February 24, 2012
Large String Parameters Causing Performance Issues
Bit of strange one this. I have a key field in one of my databases that is a
Char(18). I use this as a parameter field in one of my reports.
When I run the report and specify the key field parameter manually the
report runs instantly. If I attempt to set this as a parameter variable and
enter the criteria in the parameter box, the report takes over a minute to
run. The 2 statements are as follows.
1) select sum(sales_value) as sales from production.dbo.epos_transactions
where transaction_ref = '085505010500074995'
When run as above, the report runs instantly.
2) select sum(sales_value) as sales from production.dbo.epos_transactions
where transaction_ref = @.TREF
When I enter the parameter and run the report it takes over a minute to run.
Running the query through query analyser causes no issues on any of the
servers involved and the response time on all servers is instant.
I'd be grateful if anyone can shed any light on this.
Many thanks for any help.
--
Nick Colebourn
DBA
United Coop LtdHi Nick,
Could you supply a generic repro for this issue. An RDL for Northwind or a
simple DB. I would love to take a look at it.
| Thread-Topic: Large String Parameters Causing Performance Issues
| thread-index: AcUC1GzdZAw/tJ+RRciPnzP3TypLNA==| X-WBNR-Posting-Host: 213.146.135.115
| From: "=?Utf-8?B?TmljayBDb2xlYm91cm4=?="
<NickColebourn@.discussions.microsoft.com>
| Subject: Large String Parameters Causing Performance Issues
| Date: Tue, 25 Jan 2005 03:53:03 -0800
| Lines: 29
| Message-ID: <EFE8F146-E9CC-49C8-A5B8-4E29E3F57EC2@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.reportingsvcs:40737
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Hi All,
| Bit of strange one this. I have a key field in one of my databases that
is a
| Char(18). I use this as a parameter field in one of my reports.
| When I run the report and specify the key field parameter manually the
| report runs instantly. If I attempt to set this as a parameter variable
and
| enter the criteria in the parameter box, the report takes over a minute
to
| run. The 2 statements are as follows.
|
| 1) select sum(sales_value) as sales from production.dbo.epos_transactions
| where transaction_ref = '085505010500074995'
|
| When run as above, the report runs instantly.
|
| 2) select sum(sales_value) as sales from production.dbo.epos_transactions
| where transaction_ref = @.TREF
|
| When I enter the parameter and run the report it takes over a minute to
run.
|
| Running the query through query analyser causes no issues on any of the
| servers involved and the response time on all servers is instant.
|
| I'd be grateful if anyone can shed any light on this.
|
| Many thanks for any help.
|
| --
| Nick Colebourn
| DBA
| United Coop Ltd
||||Hi Brad,
Many thanks for your reply. I'll see if I can get it to do the same
with a northwind query and post back asap. For your info, I've created an
in-line table valued function containing the sql with the parameter and
called this as the dataset instead of the sql text itself. This works ok
either with static criteria or using a parameter passed across to the
function. The performance issue only seems to happen when you pass the
parameter value directly across to the sql text.
Many thanks
Nick
""Brad Syputa - MS"" wrote:
> Hi Nick,
> Could you supply a generic repro for this issue. An RDL for Northwind or a
> simple DB. I would love to take a look at it.
>
> --
> | Thread-Topic: Large String Parameters Causing Performance Issues
> | thread-index: AcUC1GzdZAw/tJ+RRciPnzP3TypLNA==> | X-WBNR-Posting-Host: 213.146.135.115
> | From: "=?Utf-8?B?TmljayBDb2xlYm91cm4=?="
> <NickColebourn@.discussions.microsoft.com>
> | Subject: Large String Parameters Causing Performance Issues
> | Date: Tue, 25 Jan 2005 03:53:03 -0800
> | Lines: 29
> | Message-ID: <EFE8F146-E9CC-49C8-A5B8-4E29E3F57EC2@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.reportingsvcs:40737
> | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> |
> | Hi All,
> | Bit of strange one this. I have a key field in one of my databases that
> is a
> | Char(18). I use this as a parameter field in one of my reports.
> | When I run the report and specify the key field parameter manually the
> | report runs instantly. If I attempt to set this as a parameter variable
> and
> | enter the criteria in the parameter box, the report takes over a minute
> to
> | run. The 2 statements are as follows.
> |
> | 1) select sum(sales_value) as sales from production.dbo.epos_transactions
> | where transaction_ref = '085505010500074995'
> |
> | When run as above, the report runs instantly.
> |
> | 2) select sum(sales_value) as sales from production.dbo.epos_transactions
> | where transaction_ref = @.TREF
> |
> | When I enter the parameter and run the report it takes over a minute to
> run.
> |
> | Running the query through query analyser causes no issues on any of the
> | servers involved and the response time on all servers is instant.
> |
> | I'd be grateful if anyone can shed any light on this.
> |
> | Many thanks for any help.
> |
> | --
> | Nick Colebourn
> | DBA
> | United Coop Ltd
> |
>