Saturday, February 25, 2012
Add Formula for a column
but I'm not being allowed.
I want a column to be multiplication of two other columns, datatypes money
and decimal.
I'm typing SubTotal * TaxRate ...
What's the big deal with this?
Hi Calvin
As per my knowledge you cannot add formula to the table. You can do this in
your query.
If u feel you use the formula frequently, u can create a VIEW of UDF
Hope this will solve your problem.
Thanks and regards
Chandra
"Calvin" wrote:
> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
> I'm typing SubTotal * TaxRate ...
> What's the big deal with this?
>
>
|||Try using Query Analyzer and execute the CREATE TABLE statement instead, then you can post an error
message for us. Below work fine on my machine:
CREATE TABLE #t
(subtotal decimal(5,3)
,taxrate int
,x AS subtotal*taxrate)
An alternative is to present derived information in views instead of in the table...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Calvin" <calvin@.discussions.microsoft.com> wrote in message
news:BE975F7D.1622%calvin@.discussions.microsoft.co m...
> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
> I'm typing SubTotal * TaxRate ...
> What's the big deal with this?
>
|||Yeah... realized that would save the hassle after my post. Thanks for your
reply.
On 29/4/05 7:06 am, in article
5042C552-DDBF-4D63-BE77-C8B6ECDAF946@.microsoft.com, "Chandra"
<Chandra@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
> Hi Calvin
> As per my knowledge you cannot add formula to the table. You can do this in
> your query.
> If u feel you use the formula frequently, u can create a VIEW of UDF
> Hope this will solve your problem.
> Thanks and regards
> Chandra
>
> "Calvin" wrote:
|||Decided to change the query which updates the table instead, but thanks fr
your reply.
On 29/4/05 9:19 am, in article O6qYcQJTFHA.3056@.TK2MSFTNGP14.phx.gbl, "Tibor
Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote:
> Try using Query Analyzer and execute the CREATE TABLE statement instead, then
> you can post an error
> message for us. Below work fine on my machine:
> CREATE TABLE #t
> (subtotal decimal(5,3)
> ,taxrate int
> ,x AS subtotal*taxrate)
> An alternative is to present derived information in views instead of in the
> table...
Add Formula for a column
but I'm not being allowed.
I want a column to be multiplication of two other columns, datatypes money
and decimal.
I'm typing SubTotal * TaxRate ...
What's the big deal with this?Hi Calvin
As per my knowledge you cannot add formula to the table. You can do this in
your query.
If u feel you use the formula frequently, u can create a VIEW of UDF
Hope this will solve your problem.
Thanks and regards
Chandra
"Calvin" wrote:
> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
> I'm typing SubTotal * TaxRate ...
> What's the big deal with this?
>
>|||Try using Query Analyzer and execute the CREATE TABLE statement instead, the
n you can post an error
message for us. Below work fine on my machine:
CREATE TABLE #t
(subtotal decimal(5,3)
,taxrate int
,x AS subtotal*taxrate)
An alternative is to present derived information in views instead of in the
table...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Calvin" <calvin@.discussions.microsoft.com> wrote in message
news:BE975F7D.1622%calvin@.discussions.microsoft.com...
> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
> I'm typing SubTotal * TaxRate ...
> What's the big deal with this?
>|||Yeah... realized that would save the hassle after my post. Thanks for your
reply.
On 29/4/05 7:06 am, in article
5042C552-DDBF-4D63-BE77-C8B6ECDAF946@.microsoft.com, "Chandra"
<Chandra@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
> Hi Calvin
> As per my knowledge you cannot add formula to the table. You can do this
in
> your query.
> If u feel you use the formula frequently, u can create a VIEW of UDF
> Hope this will solve your problem.
> Thanks and regards
> Chandra
>
> "Calvin" wrote:
>|||Decided to change the query which updates the table instead, but thanks fr
your reply.
On 29/4/05 9:19 am, in article O6qYcQJTFHA.3056@.TK2MSFTNGP14.phx.gbl, "Tibor
Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote:
> Try using Query Analyzer and execute the CREATE TABLE statement instead, t
hen
> you can post an error
> message for us. Below work fine on my machine:
> CREATE TABLE #t
> (subtotal decimal(5,3)
> ,taxrate int
> ,x AS subtotal*taxrate)
> An alternative is to present derived information in views instead of in th
e
> table...
Add Formula for a column
but I'm not being allowed.
I want a column to be multiplication of two other columns, datatypes money
and decimal.
I'm typing SubTotal * TaxRate ...
What's the big deal with this?Hi Calvin
As per my knowledge you cannot add formula to the table. You can do this in
your query.
If u feel you use the formula frequently, u can create a VIEW of UDF
Hope this will solve your problem.
Thanks and regards
Chandra
"Calvin" wrote:
> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
> I'm typing SubTotal * TaxRate ...
> What's the big deal with this?
>
>|||Try using Query Analyzer and execute the CREATE TABLE statement instead, then you can post an error
message for us. Below work fine on my machine:
CREATE TABLE #t
(subtotal decimal(5,3)
,taxrate int
,x AS subtotal*taxrate)
An alternative is to present derived information in views instead of in the table...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Calvin" <calvin@.discussions.microsoft.com> wrote in message
news:BE975F7D.1622%calvin@.discussions.microsoft.com...
> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
> but I'm not being allowed.
> I want a column to be multiplication of two other columns, datatypes money
> and decimal.
> I'm typing SubTotal * TaxRate ...
> What's the big deal with this?
>|||Decided to change the query which updates the table instead, but thanks fr
your reply.
On 29/4/05 9:19 am, in article O6qYcQJTFHA.3056@.TK2MSFTNGP14.phx.gbl, "Tibor
Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote:
> Try using Query Analyzer and execute the CREATE TABLE statement instead, then
> you can post an error
> message for us. Below work fine on my machine:
> CREATE TABLE #t
> (subtotal decimal(5,3)
> ,taxrate int
> ,x AS subtotal*taxrate)
> An alternative is to present derived information in views instead of in the
> table...|||Yeah... realized that would save the hassle after my post. Thanks for your
reply.
On 29/4/05 7:06 am, in article
5042C552-DDBF-4D63-BE77-C8B6ECDAF946@.microsoft.com, "Chandra"
<Chandra@.discussions.microsoft.com> wrote:
> Hi Calvin
> As per my knowledge you cannot add formula to the table. You can do this in
> your query.
> If u feel you use the formula frequently, u can create a VIEW of UDF
> Hope this will solve your problem.
> Thanks and regards
> Chandra
>
> "Calvin" wrote:
>> I'm trying to add a formula to a column in a Table, in Enterprise Manager,
>> but I'm not being allowed.
>> I want a column to be multiplication of two other columns, datatypes money
>> and decimal.
>> I'm typing SubTotal * TaxRate ...
>> What's the big deal with this?
>>
Add Foreign Key Constraint in filegroup
I'd like to create a foreign key constraint and store it in a different
filegroup than "PRIMARY"
For this, I've created a new filegroup named "INDEX"
This is my script :
ALTER TABLE [dbo].[T_FILE] WITH NOCHECK ADD
CONSTRAINT [FK_T_FILE_IDFOL_T_FOLDER] FOREIGN KEY
(
[FIL_IDFOLDER]
) REFERENCES [dbo].[T_FOLDER] (
[FOL_IDFOLDER]
) ON DELETE CASCADE
ON [INDEX]
GO
And it doesn't work !
But what is very strange, is that I can create a primary key constraint
correctly on this filegroup :
ALTER TABLE [dbo].[T_FILE] WITH NOCHECK ADD
CONSTRAINT [PK_T_FILE] PRIMARY KEY CLUSTERED
(
[FIL_IDFILE]
) ON [INDEX]
GO
And this works !
It would be great if someone can telle me where my error is !
ThanxFilegroups are containers for storing data. Data are either data pages or in
dex pages. The reason
you can specify a filegroup when you define a primary key is that it automat
ically creates an index
for you,. so the file group you specify defines where that index will be sto
red. A foreign key
doesn't come with an index.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<jerome.avoustin@.gmail.com> wrote in message
news:1137404237.380973.84080@.g43g2000cwa.googlegroups.com...
> Hi,
> I'd like to create a foreign key constraint and store it in a different
> filegroup than "PRIMARY"
> For this, I've created a new filegroup named "INDEX"
> This is my script :
> ALTER TABLE [dbo].[T_FILE] WITH NOCHECK ADD
> CONSTRAINT [FK_T_FILE_IDFOL_T_FOLDER] FOREIGN KEY
> (
> [FIL_IDFOLDER]
> ) REFERENCES [dbo].[T_FOLDER] (
> [FOL_IDFOLDER]
> ) ON DELETE CASCADE
> ON [INDEX]
> GO
> And it doesn't work !
> But what is very strange, is that I can create a primary key constraint
> correctly on this filegroup :
> ALTER TABLE [dbo].[T_FILE] WITH NOCHECK ADD
> CONSTRAINT [PK_T_FILE] PRIMARY KEY CLUSTERED
> (
> [FIL_IDFILE]
> ) ON [INDEX]
> GO
> And this works !
> It would be great if someone can telle me where my error is !
> Thanx
>
Add filters dynamically
Hi,
I am using a ReportViewer control on the windows form to connect to Report Server, process the report remotely (ServerReport) and render the report in PDF format.
The user wants to add some fiter(criteria) each time before the report is rendered. The filter (criteria) is generated separately. The original content of RDL should not be changed. I know, Report Builder is an option available. But, the end-user doesnt want to use Report builder to design the report.
I need to know, is there anyway I can retrieve the dataset->commandtext of the report(published on REport Server), edit and set it back dynamically, before rendering to PDF or any API, which can allow to add filters programmatically.
Thanks in advance.
You can pass it as report parameter. But is must be done carefully to prevent SQL injections)Add filters dynamically
Hi,
I am using a ReportViewer control on the windows form to connect to Report Server, process the report remotely (ServerReport) and render the report in PDF format.
The user wants to add some fiter(criteria) each time before the report is rendered. The filter (criteria) is generated separately. The original content of RDL should not be changed. I know, Report Builder is an option available. But, the end-user doesnt want to use Report builder to design the report.
I need to know, is there anyway I can retrieve the dataset->commandtext of the report(published on REport Server), edit and set it back dynamically, before rendering to PDF or any API, which can allow to add filters programmatically.
Thanks in advance.
You can pass it as report parameter. But is must be done carefully to prevent SQL injections)ADD FILE __cannot be reused until after the next BACKUP LOG operation
I have a database containing a full text index, I am trying to add a file to
a filegroup but an exception occurred while execution.
the error:
File 'C:\FullTextCatalogs\CMS_sanayaFT_data.ndf' cannot be reused until
after the next BACKUP LOG operation.
File 'CMS_sanayaFT_data' cannot be reused until after the next BACKUP LOG
operation. (Microsoft SQL Server, Error: 1833)
Thanks in advanced
Backup the log and try to add the file.
relevantNoise - dedicated to mining blogs for business intelligence.
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
"yaser" <yaser.abu-khudier@.hotmail.com> wrote in message
news:%23LEiVZM3HHA.748@.TK2MSFTNGP04.phx.gbl...
> Hi all,
>
> I have a database containing a full text index, I am trying to add a file
> to a filegroup but an exception occurred while execution.
>
> the error:
>
> File 'C:\FullTextCatalogs\CMS_sanayaFT_data.ndf' cannot be reused until
> after the next BACKUP LOG operation.
> File 'CMS_sanayaFT_data' cannot be reused until after the next BACKUP LOG
> operation. (Microsoft SQL Server, Error: 1833)
>
> Thanks in advanced
>
|||thanks Hilary, the issue solved by taking a full backup then taking a log
back up.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%23ziAf8h3HHA.5984@.TK2MSFTNGP04.phx.gbl...
> Backup the log and try to add the file.
> --
> relevantNoise - dedicated to mining blogs for business intelligence.
> 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
> "yaser" <yaser.abu-khudier@.hotmail.com> wrote in message
> news:%23LEiVZM3HHA.748@.TK2MSFTNGP04.phx.gbl...
>