Tuesday, March 27, 2012
Extra Trailing Whitespace Doesn't Violate Foreign Key Constrai
so, then the trailing blank spaces are lost
select ColumnProperty(object_id('ProductTable')
, 'Product One',
'UsesAnsiTrim')On Tue, 30 May 2006 07:43:03 -0700, Omnibuzz wrote:
> To check whether it was off, try this run this and see if the value is 1.
If
> so, then the trailing blank spaces are lost
> select ColumnProperty(object_id('ProductTable')
, 'Product One',
> 'UsesAnsiTrim')
Yes, the value of this is 1, so ANSI_PADDING is on. As far as I can tell,
ANSI_PADDING is ON per the default and I have never done anything to
change this.
Thanks,
Josh|||It would have been set at the time of the table creation.
Its set at runtime.
"Josh T" wrote:
> On Tue, 30 May 2006 07:43:03 -0700, Omnibuzz wrote:
>
>
> Yes, the value of this is 1, so ANSI_PADDING is on. As far as I can tell,
> ANSI_PADDING is ON per the default and I have never done anything to
> change this.
> Thanks,
> Josh
>
External_access/unsafe - system call
i need to make a system call from within the sqlserver (run an .exe file).
i do not want to define the db as trustworthy.
i've created a strong name key and related it to the code. i then created
asymetric key, granted access to the login and created the assembly but
failed.
what am i doing worng?Hello ????,
Here's folow I've solved this in the past:
http://www.sqljunkies.com/WebLog/kt...op.com/ktegels/|||Hi,
Tried it and it didn't help (p.s - we exchanged some mails last week
"Kent Tegels" wrote:
> Hello ????,
> Here's folow I've solved this in the past:
> http://www.sqljunkies.com/WebLog/kt...op.com/ktegels/
>
>|||Hello ????,
Right, I'm retrying it on my machine today and so far it is.
Have you tried the process as described in the the July 2006 BOL update. See
:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/a2bc503d-b6b2-4963-8beb-c1
1c323f18e0.htm
Thanks,
Kent Tegels, DevelopMentor
http://staff.develop.com/ktegels/|||couldn't reach the url can you send a valid one?
Galit.
"Kent Tegels" wrote:
> Hello ????,
> Right, I'm retrying it on my machine today and so far it is.
> Have you tried the process as described in the the July 2006 BOL update. S
ee:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/denet9/html/a2bc503d-b6b2-4963-8beb-
c11c323f18e0.htm
> Thanks,
> Kent Tegels, DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||Hi Kent,
managed to do it - thanks (not according to your note).
Thanks,
Galit.
"????" wrote:
[vbcol=seagreen]
> couldn't reach the url can you send a valid one?
> Galit.
> "Kent Tegels" wrote:
>sql
Friday, March 23, 2012
External Activation and Notification Services
Querying the [ExternalActivatorQueue] shows no rows.
Querying the [Inventory Queue] shows messages are waiting to be received.
Executing the 'activator' command in the ExternalActviator program shows
Notification service 'ExternalActivator' on SQL Server 'DBSERVER\' and Database 'In
ventory' is connected to the database and working.
Any Ideas?
Thanks,
-KuoAfter some browsing through code in the samples, I figured out the problem. The queue thats suppose to contain all the notification messages for the ExternalActivator program was checking the correct queue for messages, however no messages were being created in the [ExternalActivatorQueue] whenever a new message was sent to the [Inventory Queue].
So I, dDropped the event, 'en', and reran the create event notifcation:
drop event notification en on queue [Inventory Queue]
create event notification en
on queue [Inventory Queue]
for queue_activation
to service 'ExternalActivator', 'current database';
sent a few more messages and the ExternalActivatorQueue started getting messages in the queue whenever a new message was sent to the [Inventory Queue].
This is really strange. I know I must of ran the create event notification command a few times. Oh well, it works now.
-Mr.Kuo
Wednesday, March 21, 2012
Extended stored procedure performance tuning
procedures. When we run our application in house, or when most other
customers run it, they see performance of about X transactions per
second. One customer is seeing performance of about X/5, and I'm
having a hard time troubleshooting it. The performace bottleneck has
been narrowed to the execution of the extended stored procedures. Does
anyone know of tuneable SQL Server parameters that may specifically
affect the performance of extended stored procedures. I know the
procedures get run by a scheduler. Is there some way the priority or
frequency of the scheduler can be modified? Thanks for any advice.Are there lots of concurrent users in this one customer? This KB article
might be interesting
to you:
http://support.microsoft.com/?kbid=836839
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://blogs.msdn.com/weix
<bsandell@.gmail.com> wrote in message
news:1116439417.870512.217270@.g14g2000cwa.googlegr oups.com...
> We have an application that is based on several extended stored
> procedures. When we run our application in house, or when most other
> customers run it, they see performance of about X transactions per
> second. One customer is seeing performance of about X/5, and I'm
> having a hard time troubleshooting it. The performace bottleneck has
> been narrowed to the execution of the extended stored procedures. Does
> anyone know of tuneable SQL Server parameters that may specifically
> affect the performance of extended stored procedures. I know the
> procedures get run by a scheduler. Is there some way the priority or
> frequency of the scheduler can be modified? Thanks for any advice.|||Are you using synchronization objects inside the XP?
Loopback connections?
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2005 All rights reserved.
<bsandell@.gmail.com> wrote in message
news:1116439417.870512.217270@.g14g2000cwa.googlegr oups.com...
> We have an application that is based on several extended stored
> procedures. When we run our application in house, or when most other
> customers run it, they see performance of about X transactions per
> second. One customer is seeing performance of about X/5, and I'm
> having a hard time troubleshooting it. The performace bottleneck has
> been narrowed to the execution of the extended stored procedures. Does
> anyone know of tuneable SQL Server parameters that may specifically
> affect the performance of extended stored procedures. I know the
> procedures get run by a scheduler. Is there some way the priority or
> frequency of the scheduler can be modified? Thanks for any advice.|||Also check if you customer is running fibers or threads? exec sp_configure
'lightweight pooling'
Verify size of the MemToLeave area, maybe your customers runs with /3GB on
or off, of uses the -g startup parameter to set the MemToLeave area size in
SQL Server
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2005 All rights reserved.
"Gert E.R. Drapers" <gertdATsqldevDOTnet> wrote in message
news:428c7663$0$64595$e4fe514c@.news.xs4all.nl...
> Are you using synchronization objects inside the XP?
> Loopback connections?
> GertD@.SQLDev.Net
> Please reply only to the newsgroups.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> You assume all risk for your use.
> Copyright SQLDev.Net 1991-2005 All rights reserved.
> <bsandell@.gmail.com> wrote in message
> news:1116439417.870512.217270@.g14g2000cwa.googlegr oups.com...
>> We have an application that is based on several extended stored
>> procedures. When we run our application in house, or when most other
>> customers run it, they see performance of about X transactions per
>> second. One customer is seeing performance of about X/5, and I'm
>> having a hard time troubleshooting it. The performace bottleneck has
>> been narrowed to the execution of the extended stored procedures. Does
>> anyone know of tuneable SQL Server parameters that may specifically
>> affect the performance of extended stored procedures. I know the
>> procedures get run by a scheduler. Is there some way the priority or
>> frequency of the scheduler can be modified? Thanks for any advice.
>>sql
Monday, March 19, 2012
Extended Stored Procedure
I add the same to a stored proc my app hangs and I get a timeout.
Any help is greatly appreciated. I really don't want to create a job that
runs this.
EXEC @.hr = sp_OACreate 'MyLocalEXE.Host', @.object OUT, 4
IF @.hr <> 0 BEGIN EXEC sp_raiseoaerror @.object, @.hr RETURN (-1) ENDHi
At a guess as the application hangs it probably means it can't find the
object, which implies it is not being run in the same context and/or possibl
y
a lack of permissions. You also need to be sy
John
"Mark - HYPERe" wrote:
> When I run the below (sp_OACreate) in SQL Query Analyzer it runs fine. Wh
en
> I add the same to a stored proc my app hangs and I get a timeout.
> Any help is greatly appreciated. I really don't want to create a job that
> runs this.
> EXEC @.hr = sp_OACreate 'MyLocalEXE.Host', @.object OUT, 4
> IF @.hr <> 0 BEGIN EXEC sp_raiseoaerror @.object, @.hr RETURN (-1) END
Extended Property
property). I run the following query and SqlServer returns nothing. But
I see the description in enterprise manager. Am I missing anything here
please?
SELECT *
FROM ::fn_listextendedproperty (N'MS_Description',
N'user', N'dbo', N'table', N'ED_Account', N'column', 'AccountID')Your query looks okay. Can you try the query below,
this should return all column descriptions for your table.
select value,col_name(id, smallid)
from sysproperties
where name='MS_Description'
and id=object_id('dbo.ED_Account')|||Thanks that works
markc...@.hotmail.com wrote:
> Your query looks okay. Can you try the query below,
> this should return all column descriptions for your table.
> select value,col_name(id, smallid)
> from sysproperties
> where name='MS_Description'
> and id=object_id('dbo.ED_Account')|||Note that sysproperties isn't documented and was removed in 2005 (replaced b
y a documented catalog
view). So, I do not recommend that you use it. I have a feeling that Mark su
ggested you the query
just to troubleshoot, verifying that there actually has been defined extende
d properties for this
object (etc.).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"S Chapman" <s_chapman47@.hotmail.co.uk> wrote in message
news:1149091258.427862.291020@.f6g2000cwb.googlegroups.com...
> Thanks that works
> markc...@.hotmail.com wrote:
>
Monday, March 12, 2012
Expressions not always evaluated in correct order
Hello!
I have an SSIS package, run by the DTExec utility, each night. When I run my package, I assign a value to a variable (package scope) (/SET "\Package.Variables[User:: psRunNo]";0154). (Note: all the variables here are strings).
Value for variable psRunNo = 0154
In the package, I have another package variable called S_SOURCE_FILE_NAME, which is an expression and that uses the variable psRunNo.
Expression for S_SOURCE_FILE_NAME = @.[User:: psRunNo] + "_{TABLENAME}.txt"
So, at the beginning, the value of variable S_SOURCE_FILE_NAME is 0154_{TABLENAME}.txt with that example.
Then, I use the variable S_SOURCE_FILE_NAME in the expression used to assign the ConnectionString property of a Connection (a source file), like this:
REPLACE( @.[User:: S_REJECTED_ROWS_FILE_NAME] ,"{TABLENAME}", "STADDRES")
So here for example, the final value for ConnectionString would be 0154_STADDRES.txt
Everything works nice, most of the time. Sometimes (intermittent problem), the value of the ConnectionString for one of the many Connections I have in the package is not assigned with the right value of psRunNo. The ConnectionString gets the value of psRunNo which is saved into the package (when it was deployed) instead of the value of psRunNo passed with the DTExec.
It is like if the ConnectionString value was computed before the variable psRunNo (and S_SOURCE_FILE_NAME expression) was assigned to the new value, but only for one of the connections (all my connections use the same kind of expression for their ConnectionString property).
Does somebody had similar precedence problem? Is there some settings I could use to indicate a precedence in assignation of variables ? Where does the "natural" precedence in assignation comes from in SSIS ?
Thanks!
Isabelle_ wrote:
Does somebody had similar precedence problem? Is there some settings I could use to indicate a precedence in assignation of variables ? Where does the "natural" precedence in assignation comes from in SSIS ?
Thanks!
There isn't really a precedence. If VariableC depends on VariableB which depends on VariableA then all will get evaluated when VariableC gets used somewhere. The expressions are not pre-evaluated or anything like that.
This doesn't help explain the problem you are seeing. I confess I can't undersand why it might be happening. Can you post a repro?
-Jamie
|||I could not post a reproduction as is, because even if I would make up a small package with my case, this case is intermittent, so almost impossible to get it right... I was thinking maybe on making a script at the beginning of my package and "manually" assign the variable values, instead of using expressions.. Normally, the outcome would be the same, but maybe that would ensure that those variables always get their right values before being use... ?
|||
Isabelle_ wrote:
I could not post a reproduction as is, because even if I would make up a small package with my case, this case is intermittent, so almost impossible to get it right... I was thinking maybe on making a script at the beginning of my package and "manually" assign the variable values, instead of using expressions.. Normally, the outcome would be the same, but maybe that would ensure that those variables always get their right values before being use... ?
You could try that but this is just papering over the cracks. Something else is wrong here. Could it be that you haven't got EvaluateAsExpression=TRUE?
-Jamie
|||I've check, and I got the EvaluateAsExpression=TRUE. I guess also that if I wouldn't have it to true, it would never work. But it works, 90% of the time ...
Ok, thanks anyway. I've changed my thing so I just have one level of expression. I will let it run for few days/weeks and see if this problem still happen.
Thanks everybody for your input!
Expressions not always evaluated in correct order
Hello!
I have an SSIS package, run by the DTExec utility, each night. When I run my package, I assign a value to a variable (package scope) (/SET "\Package.Variables[User:: psRunNo]";0154). (Note: all the variables here are strings).
Value for variable psRunNo = 0154
In the package, I have another package variable called S_SOURCE_FILE_NAME, which is an expression and that uses the variable psRunNo.
Expression for S_SOURCE_FILE_NAME = @.[User:: psRunNo] + "_{TABLENAME}.txt"
So, at the beginning, the value of variable S_SOURCE_FILE_NAME is 0154_{TABLENAME}.txt with that example.
Then, I use the variable S_SOURCE_FILE_NAME in the expression used to assign the ConnectionString property of a Connection (a source file), like this:
REPLACE( @.[User:: S_REJECTED_ROWS_FILE_NAME] ,"{TABLENAME}", "STADDRES")
So here for example, the final value for ConnectionString would be 0154_STADDRES.txt
Everything works nice, most of the time. Sometimes (intermittent problem), the value of the ConnectionString for one of the many Connections I have in the package is not assigned with the right value of psRunNo. The ConnectionString gets the value of psRunNo which is saved into the package (when it was deployed) instead of the value of psRunNo passed with the DTExec.
It is like if the ConnectionString value was computed before the variable psRunNo (and S_SOURCE_FILE_NAME expression) was assigned to the new value, but only for one of the connections (all my connections use the same kind of expression for their ConnectionString property).
Does somebody had similar precedence problem? Is there some settings I could use to indicate a precedence in assignation of variables ? Where does the "natural" precedence in assignation comes from in SSIS ?
Thanks!
Isabelle_ wrote:
Does somebody had similar precedence problem? Is there some settings I could use to indicate a precedence in assignation of variables ? Where does the "natural" precedence in assignation comes from in SSIS ?
Thanks!
There isn't really a precedence. If VariableC depends on VariableB which depends on VariableA then all will get evaluated when VariableC gets used somewhere. The expressions are not pre-evaluated or anything like that.
This doesn't help explain the problem you are seeing. I confess I can't undersand why it might be happening. Can you post a repro?
-Jamie
|||I could not post a reproduction as is, because even if I would make up a small package with my case, this case is intermittent, so almost impossible to get it right... I was thinking maybe on making a script at the beginning of my package and "manually" assign the variable values, instead of using expressions.. Normally, the outcome would be the same, but maybe that would ensure that those variables always get their right values before being use... ?
|||
Isabelle_ wrote:
I could not post a reproduction as is, because even if I would make up a small package with my case, this case is intermittent, so almost impossible to get it right... I was thinking maybe on making a script at the beginning of my package and "manually" assign the variable values, instead of using expressions.. Normally, the outcome would be the same, but maybe that would ensure that those variables always get their right values before being use... ?
You could try that but this is just papering over the cracks. Something else is wrong here. Could it be that you haven't got EvaluateAsExpression=TRUE?
-Jamie
|||I've check, and I got the EvaluateAsExpression=TRUE. I guess also that if I wouldn't have it to true, it would never work. But it works, 90% of the time ...
Ok, thanks anyway. I've changed my thing so I just have one level of expression. I will let it run for few days/weeks and see if this problem still happen.
Thanks everybody for your input!
Expressions not always evaluated in correct order
Hello!
I have an SSIS package, run by the DTExec utility, each night. When I run my package, I assign a value to a variable (package scope) (/SET "\Package.Variables[User:: psRunNo]";0154). (Note: all the variables here are strings).
Value for variable psRunNo = 0154
In the package, I have another package variable called S_SOURCE_FILE_NAME, which is an expression and that uses the variable psRunNo.
Expression for S_SOURCE_FILE_NAME = @.[User:: psRunNo] + "_{TABLENAME}.txt"
So, at the beginning, the value of variable S_SOURCE_FILE_NAME is 0154_{TABLENAME}.txt with that example.
Then, I use the variable S_SOURCE_FILE_NAME in the expression used to assign the ConnectionString property of a Connection (a source file), like this:
REPLACE( @.[User:: S_REJECTED_ROWS_FILE_NAME] ,"{TABLENAME}", "STADDRES")
So here for example, the final value for ConnectionString would be 0154_STADDRES.txt
Everything works nice, most of the time. Sometimes (intermittent problem), the value of the ConnectionString for one of the many Connections I have in the package is not assigned with the right value of psRunNo. The ConnectionString gets the value of psRunNo which is saved into the package (when it was deployed) instead of the value of psRunNo passed with the DTExec.
It is like if the ConnectionString value was computed before the variable psRunNo (and S_SOURCE_FILE_NAME expression) was assigned to the new value, but only for one of the connections (all my connections use the same kind of expression for their ConnectionString property).
Does somebody had similar precedence problem? Is there some settings I could use to indicate a precedence in assignation of variables ? Where does the "natural" precedence in assignation comes from in SSIS ?
Thanks!
Isabelle_ wrote:
Does somebody had similar precedence problem? Is there some settings I could use to indicate a precedence in assignation of variables ? Where does the "natural" precedence in assignation comes from in SSIS ?
Thanks!
There isn't really a precedence. If VariableC depends on VariableB which depends on VariableA then all will get evaluated when VariableC gets used somewhere. The expressions are not pre-evaluated or anything like that.
This doesn't help explain the problem you are seeing. I confess I can't undersand why it might be happening. Can you post a repro?
-Jamie
|||I could not post a reproduction as is, because even if I would make up a small package with my case, this case is intermittent, so almost impossible to get it right... I was thinking maybe on making a script at the beginning of my package and "manually" assign the variable values, instead of using expressions.. Normally, the outcome would be the same, but maybe that would ensure that those variables always get their right values before being use... ?
|||
Isabelle_ wrote:
I could not post a reproduction as is, because even if I would make up a small package with my case, this case is intermittent, so almost impossible to get it right... I was thinking maybe on making a script at the beginning of my package and "manually" assign the variable values, instead of using expressions.. Normally, the outcome would be the same, but maybe that would ensure that those variables always get their right values before being use... ?
You could try that but this is just papering over the cracks. Something else is wrong here. Could it be that you haven't got EvaluateAsExpression=TRUE?
-Jamie
|||I've check, and I got the EvaluateAsExpression=TRUE. I guess also that if I wouldn't have it to true, it would never work. But it works, 90% of the time ...
Ok, thanks anyway. I've changed my thing so I just have one level of expression. I will let it run for few days/weeks and see if this problem still happen.
Thanks everybody for your input!
Friday, March 9, 2012
Expressions as a field value in a table
being pulled from the table to execute during run time? I want to dynamically
create an expression based on the value of a column of the table. Using the
IIF statement will work but it's going to be a very long nested IIF.... and
that brings to the second question -> is there a limit for the length of an
expression?
Thanks in advance.There is no limit on the length of an expression (other than limits imposed
by the VB.NET compiler).
In your case, you may want to look at alternatives to the IIF function:
* =Choose(...)
http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
* =Switch(...)
http://msdn.microsoft.com/library/en-us/vblr7/html/vafctswitch.asp
In addition, you may want to consider writing a function in custom code or
as custom assembly that contains your logic. You can then reuse the function
from RDL expressions.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"g3kamdbs" <g3kamdbs@.discussions.microsoft.com> wrote in message
news:2A1DC075-220C-4494-AF82-157760B3EBD5@.microsoft.com...
> Is there a way to store an expression inside a table, and have the
> expression
> being pulled from the table to execute during run time? I want to
> dynamically
> create an expression based on the value of a column of the table. Using
> the
> IIF statement will work but it's going to be a very long nested IIF....
> and
> that brings to the second question -> is there a limit for the length of
> an
> expression?
> Thanks in advance.|||Or a User Defined Function that the Stored Procedure calls.
GeoSynch
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:uO3ZYBwvFHA.252@.TK2MSFTNGP09.phx.gbl...
> There is no limit on the length of an expression (other than limits imposed by
> the VB.NET compiler).
> In your case, you may want to look at alternatives to the IIF function:
> * =Choose(...)
> http://msdn.microsoft.com/library/en-us/vblr7/html/vafctchoose.asp
> * =Switch(...)
> http://msdn.microsoft.com/library/en-us/vblr7/html/vafctswitch.asp
> In addition, you may want to consider writing a function in custom code or as
> custom assembly that contains your logic. You can then reuse the function from
> RDL expressions.
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "g3kamdbs" <g3kamdbs@.discussions.microsoft.com> wrote in message
> news:2A1DC075-220C-4494-AF82-157760B3EBD5@.microsoft.com...
>> Is there a way to store an expression inside a table, and have the expression
>> being pulled from the table to execute during run time? I want to dynamically
>> create an expression based on the value of a column of the table. Using the
>> IIF statement will work but it's going to be a very long nested IIF.... and
>> that brings to the second question -> is there a limit for the length of an
>> expression?
>> Thanks in advance.
>
Wednesday, March 7, 2012
Expression as a default value problem..
report whenever they feel like too. Can I put expressions in the default value entry? They don't seem to generate anything...
Here is the value I want to put in..
=CDate(IIF(datepart("w", Today) = 2, dateadd("d", -2, Today), dateadd("d", -1, Today)).ToString)
Can anyone see anything wrong with this?
Thanks
ScottWhere are you settting this expression? This should work if you pull up
Report Parameters dialog in report designer, enter this expression in
Default -> Non-queried textbox, and preview it (I just tried it to confirm.)
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Scott Meddows" <scott_meddows_no_spm@.tsged-removeme.com> wrote in message
news:u1j3alvWEHA.1888@.TK2MSFTNGP11.phx.gbl...
> I want to automatically run a report every day of the week. This isn't a
problem. However I want the users to be able to run the
> report whenever they feel like too. Can I put expressions in the default
value entry? They don't seem to generate anything...
> Here is the value I want to put in..
> =CDate(IIF(datepart("w", Today) = 2, dateadd("d", -2, Today),
dateadd("d", -1, Today)).ToString)
> Can anyone see anything wrong with this?
> Thanks
> Scott
>
Sunday, February 19, 2012
Exporting to Plain Text
do this automatically when the report is run via a schedule on the server.
Help!
RickYou need to have a custom rendering solution. This link is quite interesting
about custom rendering.
http://msdn.microsoft.com/msdnmag/issues/05/02/CustomRenderers/
Amarnath
"RLS" wrote:
> Has anyone found a way to export a report to plain text? I need to be able to
> do this automatically when the report is run via a schedule on the server.
> Help!
> Rick
Friday, February 17, 2012
exporting to CSV
I have a need to run an export of fields from a table into a CSV text file located on my e:\exports. Is there a simple way to do this?
Hi jim,
Why cant you use DTS service to transfer the tables datas into CSV file ?
|||
use the following query...
master..xp_cmdshell 'bcp "select * from master..sysobjects" queryout e:\exports\exported.csv -SMYSERVER -UMyUserName -pMyPassword -c -t "," -r "\n"'
|||thanks I will do!