|
How can I achieve this:
I'm creating an SSRS and I have a matrix on which the aggregate data depends on the parameter.
Eg: if parameter is A then the aggregate data is Sum(Fields!weight.value)
but if the parameter is B then the aggregate data should be Sum(Fields!volume.value)
and if the parameter is A and B (multiple value allowed), then the aggregate data is Sum(Fields!volume.value + Fields!weight.value)
I've tried to just simply put in iif(Parameters!myPar.value = "A", Sum(Fields!weight.value), Sum(fields!volume.value)) with no success.
Any help would be appreciated.
Thanks
modified on Thursday, September 25, 2008 3:06 AM
|
|
|
|
|
Hello,
I've a SQL Server error when I'm runnig a query. The query contains 24 Tables.
The error is written below:
---------------------------
SQL Server Enterprise Manager
---------------------------
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not allocate space for object '(SYSTEM table id: -255639869)' in database 'TEMPDB' because the 'DEFAULT' filegroup is full.
---------------------------
OK Help
---------------------------
Any one can tell me the solution of this problem.
Thanks
Syed Shahid Hussain
|
|
|
|
|
maybe the disk that TempDB is on is full or maybe the TempDB database has fixed size and is full ?
|
|
|
|
|
Ok Thanks, Let me check.
Syed Shahid Hussain
|
|
|
|
|
i am working on Sql Server 2005 BI (Integration Services) can anyone help me how to set and get value of user defiend variables.I want to passed some variables like connection string,login,password and paramerters to Integration Task and i want to used that paramerter value in where clouse of my query......very welcome for quick reply...
Ghazanfar Ali
Software Engineer (MSTS,MCPD,MCITP)
|
|
|
|
|
Hi,
Please take a look at the following article:
ARTICLE2[^]
ARTICLE1[^]
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi,
Apologies if this is the wrong location for this post.
I have a set of tables say Table A, B & C for simplicity. Table A relates to table B. Table B relates to Table C. No problems so far, however Table A also has related records in Table C. Those records in Table C are marked by not having a value for the the Table B key field.
Now in SQL we can write procedures that handle that but how can we get a .Net DataSet to have a defined relationship when one element is 'the column contains null'?
Obviously we can define another table (D) which just reads in the appropriate records so Table A then joins to Table D but that feels like overkill given that the rest of the table structure is the same.
Regards
Ian Cox
|
|
|
|
|
Perhaps I missed the point but you can define two separate relations using DataRelation class:
- one for table C -> table B
- one for table C -> table A
By default child column can have NULL value unless you define it NOT NULL.
Mika
The need to optimize rises from a bad design
|
|
|
|
|
May be I did not get the picture drawn clearly. Using your notation
Table A -> Table B -> Table C
Table A -> Table C
So
Using KeyA, KeyB and KeyC as field names
TableA
KeyA
TableB
KeyA
KeyB
TableC
KeyA
KeyB // Null for records related directly to TableA
KeyC
The first relationship to Table C is therefore possible using KeyA and KeyB from table B
The second is KeyA and null.
Are you saying that I can define the following relationship
ds.Relations.Add("Table A to B",
tableA.Columns["KeyA"], tableB.Columns["KeyA"]);
ds.Relations.Add("Table B to C",
new DataColumn[] {tableB.Columns["KeyA"], tableB.Columns["KeyB"]},
new DataColumn[] {tableC.Columns["KeyA"], tableC.Columns["KeyB"]);
ds.Relations.Add("Table A to C",
new DataColumn[] {tableA.Columns["KeyA"], null},
new DataColumn[] {tableC.Columns["KeyA"], tableC.Columns["KeyB"]);
Hope this better defines my issue.
|
|
|
|
|
Okay, I jumped into conclusions and didn't think that you would have primary keys that are combined from several fields (if each table would have only one primary key column this wouldn't be any problem).
Anyhow, it could work, but I think that the last relation should be (may have typos):
ds.Relations.Add("Table A to C",
new DataColumn[] {tableA.Columns["KeyA"], new DataColumn("AlwaysNull", relevantDataType, "NULL")},
new DataColumn[] {tableC.Columns["KeyA"], tableC.Columns["KeyB"]);
The idea is to create a calculated column which always has a vale of null. Haven't tested this though...
Mika
The need to optimize rises from a bad design
|
|
|
|
|
I see your logic. Did not think about calculated columns at all. I will try that out later, just looking at something else.
Many thanks
Ian Cox
|
|
|
|
|
You're welcome.
Mika
The need to optimize rises from a bad design
|
|
|
|
|
Listen,
i see you have a column that accepts nulls and is a foregn key?
if so try to use something like this:
SELECT id_client,first_name,isnull(middle_name,'noname'),
last_name FROM dbo.clients
As you see in this case middle_name is varchar like 'noname'.
But sometimes that doesn´t happen
SELECT cl.id_client,cl.first_name,cl.last_name,
isnull(ct.city_postalcode,'nocode')
FROM dbo.clients as cl inner join dbo.cities as ct
on ct.id_city = cl.id_city
Here isnull() doesn´t work,(int VS varchar) and you will not get the rows with null values in!!!
What i advice you to do to create a temp table (or not temp), fill the table and display the result, after that delete the table. You code will be larger.
It works fine
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
HI,
I want to install SQL server 2000 in my system.But always iam getting one message it showing
Another instance fo setup is already running
And iam not be able trace what is the reason.
And i want to remove all previous installation entries from Registry.
Through Add/Remove programs i deleted SQL SERVER. From registry how can i delete sql entries.
Thanks in advance.
Rayalu
|
|
|
|
|
This could be any setup (not necessarily SQL Server). Check processes from Task Manager to see if there's some setup running.
The need to optimize rises from a bad design
|
|
|
|
|
I am a beginner in designing database. I tried to create 2 tables Users and Topics for a tiny demo forum. The tables are like this:
[tbl_Users]
username
password
email
...
[tbl_Topics]
topicID
title
content
...
1 user can post 0..M topics, 1 topic belongs to only 1 user.
1 user can view 0..M topics (including other's topics). 1 topic can be viewed by 1..M users
I have some questions:
1. Do I have to create a small table name [tbl_User_Topic] between those 2 tables?
2. Do I need to create a UserID field for [tbl_Users] and use this as a primary key instead of username field
3. Should topicID field be auto increament number or just an integer number?
4. If topicID is not an auto number, then what mechanism should I use to create topicID?
Thanks for helping,
|
|
|
|
|
oohungoo wrote: 1. Do I have to create a small table name [tbl_User_Topic] between those 2 tables?
If this is one-to-many relationshot, no
oohungoo wrote: 2. Do I need to create a UserID field for [tbl_Users] and use this as a primary key instead of username field
Depends on your design. I would prefer using UserID
oohungoo wrote: 3. Should topicID field be auto increament number or just an integer number?
Again depends on your design. You need the key value so it must get the value from somewhere (identity, custom logic, lookup table...). Identity should be the easiest.
oohungoo wrote: 4. If topicID is not an auto number, then what mechanism should I use to create topicID?
See previous.
Hope this helps,
Mika
The need to optimize rises from a bad design
|
|
|
|
|
put a id(int) for the user table, and id_user in topic table as well(foregn key). PUT a int id in EVERY table ALLWAYS.
remove password and user name, you are not going to process it are you?
your questions are quite simply i don´t know what to say really.
are you sure that database is that short? if yes keep it can see anything wrong.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Dear ALL,
I am not getting SQL Server Databse files in the installer
It gives only 2 options of SQL Server Native Client & SQL server Setup support files,
i have checked the files & it was installed over my home PC Easily but its not getting successful over my office PC, i have 4, 5 different DVD's of it & tried over 3,4 different PC but not getting the trouble identified , also i have checked added program list in control panel , no SQL instance was found before, kindly help me in this regard.
|
|
|
|
|
These must be installed before the actual database engine can be installed (in some machines they may already exists in which case this step is skipped). Have you installed those?
The need to optimize rises from a bad design
|
|
|
|
|
|
You could use sysmail_configure_sp with LoggingLevel parameter to get more detailed info on mail queue. Also sysmail_help_queue_sp will give you good info. With these procedures I believe that you can identify where the problem is (in mail queue, in SSIS...)
Also check from history that Send Mail Task is actually run when package fails.
Hope this helps,
Mika
The need to optimize rises from a bad design
|
|
|
|
|
I am working on a project to make an existing existing WINFORM application support both Oralce and SQL SERVER.Now it supports SQL server.SO i want the GURUS on codeproject to give me the best suggestions and approaches.We have converted all the existing tables and Stored Procedures into Oracle .The main issues we are having is with the Data types like Money,Date that are incompatible between SQL and Oracle .Since the application is already running in most of our Customer sites, we cannot make changes in UI or Business Logic.We have to handle them efeciently in DAL.Also it has to be compatible with both ORACLE and SQL server .
SO please share me your experiences and Ideas.If you need any furthur Information on specifics please let me know
Thanks in advance
Pankaj
|
|
|
|
|
I would suggest looking at the Microsoft Enterprise Library 3.1.
That works in a very generic way and alows you to define the connection in the config file. You can define multiple connections so one for Oracle and another to SQL then when you create a connection specify which one you want by name.
The API is centered around the System.Data objects and interfaces and all the hard work tweaking the calls to the database engine are handled for you behind the scenes. There are plenty of examples in the documentation and you should be up and running fairly quickly.
Hope this helps
Ian Cox
|
|
|
|
|
maybe this is usefull:
http://www.dotnetjohn.com/articles.aspx?articleid=244
suc6
|
|
|
|