显示标签为“columns”的博文。显示所有博文
显示标签为“columns”的博文。显示所有博文

2012年3月29日星期四

Display .356 as a percentage

I have several columns of data in a report that have values like .743 or
.253, and I'd like them to display as 74.3% and 25.3%.
I'm a reporting services newbie - I didn't see a format option in the
properties of a textbox. Suggestions?
Thanks in advance.
MarkSorry - just found it.
Properties of Textbox- Format - enter "P2"
Mark
"Mark" <markfield88@.nospam.nospam> wrote in message
news:u3451E0fGHA.4004@.TK2MSFTNGP04.phx.gbl...
>I have several columns of data in a report that have values like .743 or
>.253, and I'd like them to display as 74.3% and 25.3%.
> I'm a reporting services newbie - I didn't see a format option in the
> properties of a textbox. Suggestions?
> Thanks in advance.
> Mark
>|||that works or you can set the value of the text box to
=Format(Fields!FieldName.value, "p")

2012年3月20日星期二

discrete domains in sql

I have a sql-table. The domain of one of my columns a fix number of string values (like "blue", "green" and "yellow"). However, there is a big likelyhood that the domain will be expanded by more string values in the future (however, none of the existing string values will ever be discluded from the domain). How would I go about enforcing that all strings added to my column in my table is within my domain?

Should I use a check constraint, or create a domain, or sholud a create another table with the domain values and use a foreign key? What would be best practise for my problem?

Any of the choices would work. The best choice will really depend on other things. Use the table or domain if that type of column could appear in other tables, otherwise use a Check constraint. The choice between the domain and the look-up table has more to do with the frequency of changes and who will be responsible. If changing the values is more of a business function, then the lookup table will be best.sql

2012年2月25日星期六

Disabling merge distribution change my table definitions at publisher

I have merge replication between sql 2005 SP1, and when I disable distribution from my publisher, my tables with identity columns change the property "Not for replication" to "NO", does somebody knows if this is a known problem ?

Other information : the compatibilty level for database is 2000.

Do you see a problem with that?

Typically when replication is involved, Not For Replication is needed because when the identity value is tried to insert on the other node, this constraint needs to be skipped. Now with no replication on the machine, it would not matter if this property is ON or OFF.

Disabling drill down functionality for a column

Hi,

I am creating an adhoc report using report builde in RS2005, now the created report has few columns and some if them have functonality of drillng diwn but is it possible to have a column where a particular column can not be drilled into >

prashant

i am sorry ...it was easy ..i found it out myself its in VS

2012年2月24日星期五

Disable triggers for a single update

Hello,
I have a trigger on a table (after update) which keeps track of modified
records / columns. I need to have a function wich can make updates to that
table without firing the trigger (i.e. I don't want to track changes made by
that function).
So, I need is to make the following statements "atomic" (otherwise I could
miss other updates I want to keep tracking)
- alter table disable trigger
- update table
- alter table enable trigger.
The first option I considered was using a lock on the whole table, which i'd
like to avoid due to the usual performance issues. Now I'm thinking about
using a transaction. I know that transactions ensure actions are atomic with
respecto to recovery, I'd like to know if they can solve this kind of issues
too.
Thank you,
Luca> The first option I considered was using a lock on the whole table, which
> i'd like to avoid due to the usual performance issues. Now I'm thinking
> about using a transaction. I know that transactions ensure actions are
> atomic with respecto to recovery, I'd like to know if they can solve this
> kind of issues too.
Wrapping the ALTER/UPDATE/ALTER in a transaction will ensure the operation
is atomic. However, the ALTER will acquire a Sch-M lock on the table so no
other users can access the table for the duration of the transaction.
If this is the sort of thing you do often, consider including code in your
trigger to conditionally bypass the update. This will improve concurrency
and provide an atomic transaction as well. The example below uses a temp
table existence check:
CREATE TRIGGER TR_MyTable
ON MyTable FOR UPDATE
AS
IF OBJECT_ID('tempdb..#BypassTrigger') IS NULL
BEGIN
UPDATE MyTable
SET MyAuditDate = CURRENT_TIMESTAMP
WHERE EXISTS
(
SELECT *
FROM inserted
WHERE MyTable.MyPK = inserted.MyPK
)
END
GO
You can then skip the trigger code for the current session by creating the
dummy temp table beforehand:
CREATE TABLE #BypassTrigger(Col1 int)
UPDATE MyTable
SET MyData = 'test'
WHERE MyPk = 1
DROP TABLE #BypassTrigger
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Luca" <luca@.none.net> wrote in message
news:Z3WXd.639929$b5.29135411@.news3.tin.it...
> Hello,
> I have a trigger on a table (after update) which keeps track of modified
> records / columns. I need to have a function wich can make updates to that
> table without firing the trigger (i.e. I don't want to track changes made
> by that function).
> So, I need is to make the following statements "atomic" (otherwise I could
> miss other updates I want to keep tracking)
> - alter table disable trigger
> - update table
> - alter table enable trigger.
> The first option I considered was using a lock on the whole table, which
> i'd like to avoid due to the usual performance issues. Now I'm thinking
> about using a transaction. I know that transactions ensure actions are
> atomic with respecto to recovery, I'd like to know if they can solve this
> kind of issues too.
> Thank you,
> Luca
>|||"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> ha scritto nel messaggio
news:eqTc$AXJFHA.2764@.tk2msftngp13.phx.gbl...
> --
> Hope this helps.
>
This was really helpful, thanks a lot.
Luca

2012年2月14日星期二

Disable auto mapping by matching column names?

Hi,

If you use a component that has a column mapping tab (most do) then you know that the component will try and map input and output columns automatically by name.

Is there a way to disable this feature when writing your own custom components? There is already a manual way to do this: rightmouse in the mappings tab of a component and chosen "Map Items By Matching Names". I find it is less helpful to auto-map initially because the designer tends to not think about the mappings.

A way of turning of auto-mapping in existing components would be cool too!

Cheers,

Martin

There is no way to turn it off currently You can easily remove all the mappings, though. This is the first request I hear for turning it off. Usually, people asked for additional smart mapping options.

Thanks,

Bob

|||

Bob,

Thanks for the reply. What I find is designers get lazy and don't question the auto-mapping. Then mistakes happen which they find hard to troubleshoot because their brains weren't involved in the mapping - it's not a step they try to replay as they look for problems.

Because it happens automatically when you switch to the map pane, I wonder if it's the SSIS equivalent of Clippy announcing your Word doc "looks like you're writing a letter" and reformatting it automatically without you getting a chance to say no! :-)

Further clever mapping options would be great, but I'd suggest the designer needs to make the conscious step of making it happen.

All the best,

Martin

Disable auto mapping by matching column names?

Hi,

If you use a component that has a column mapping tab (most do) then you know that the component will try and map input and output columns automatically by name.

Is there a way to disable this feature when writing your own custom components? There is already a manual way to do this: rightmouse in the mappings tab of a component and chosen "Map Items By Matching Names". I find it is less helpful to auto-map initially because the designer tends to not think about the mappings.

A way of turning of auto-mapping in existing components would be cool too!

Cheers,

Martin

There is no way to turn it off currently You can easily remove all the mappings, though. This is the first request I hear for turning it off. Usually, people asked for additional smart mapping options.

Thanks,

Bob

|||

Bob,

Thanks for the reply. What I find is designers get lazy and don't question the auto-mapping. Then mistakes happen which they find hard to troubleshoot because their brains weren't involved in the mapping - it's not a step they try to replay as they look for problems.

Because it happens automatically when you switch to the map pane, I wonder if it's the SSIS equivalent of Clippy announcing your Word doc "looks like you're writing a letter" and reformatting it automatically without you getting a chance to say no! :-)

Further clever mapping options would be great, but I'd suggest the designer needs to make the conscious step of making it happen.

All the best,

Martin