Showing posts with label names. Show all posts
Showing posts with label names. Show all posts

Friday, March 30, 2012

Multivalue parameter textbox size

Hi,

In my report,I have multivalue parameter for this parameter the Available values are from the Dataset.Suppose the dataset contains Names like this:

'AL - Alabama Center (Tuscaloosa)',

'AL - Regional Control Center (Birmingham)',

'AR - Arkansas & Rock)',

'Arizona Department of Health'

But my problem is the Multivalue parameter TextBox is of fixed size.Now i want the size of the text box to the size of the name which is of length long in the Name.

Whether it is possible or not.

How to achieve this.

The size of the parameter area is not configurable. You can modify some of the style properties of the report viewer by following the instructions here: http://msdn2.microsoft.com/en-us/library/ms345247.aspx, there is just no way to set the size of the input boxes.|||

Sorry for high jacking this post but I can’t find any other reference to this issue.

I heard a rumour that this would be fixer in SQL Server 2005 SP2, is this the case?This issue is a real thorn in my side with constant user moaning.

Multivalue parameter textbox size

Hi,

In my report,I have multivalue parameter for this parameter the Available values are from the Dataset.Suppose the dataset contains Names like this:

'AL - Alabama Center (Tuscaloosa)',

'AL - Regional Control Center (Birmingham)',

'AR - Arkansas & Rock)',

'Arizona Department of Health'

But my problem is the Multivalue parameter TextBox is of fixed size.Now i want the size of the text box to the size of the name which is of length long in the Name.

Whether it is possible or not.

How to achieve this.

The size of the parameter area is not configurable. You can modify some of the style properties of the report viewer by following the instructions here: http://msdn2.microsoft.com/en-us/library/ms345247.aspx, there is just no way to set the size of the input boxes.|||

Sorry for high jacking this post but I can’t find any other reference to this issue.

I heard a rumour that this would be fixer in SQL Server 2005 SP2, is this the case?This issue is a real thorn in my side with constant user moaning.

Friday, March 9, 2012

Multiple Table names in result data set.

I have the below query. Basically it takes from a table the names of other tables. This seems to work but the result data set has tables named as Table, Table1, etc. How can I change the names of the tables in the result set?

Thank you.

Kevin

BEGIN

SET NOCOUNT ON;

DECLARE @.TableName VARCHAR(50)

DECLARE ReasonCategory_Cursor CURSOR FOR

SELECT CATEGORY

FROM CaseNoteReasonCategories

SELECT CATEGORY

FROM CaseNoteReasonCategories

OPEN ReasonCategory_Cursor;

FETCH NEXT FROM ReasonCategory_Cursor INTO @.TableName;

WHILE @.@.FETCH_STATUS = 0

BEGIN

EXEC ('SELECT * FROM ' + @.TableName + ' AS ' + @.TableName);

FETCH NEXT FROM ReasonCategory_Cursor INTO @.TableName;

END;

CLOSE ReasonCategory_Cursor;

DEALLOCATE ReasonCategory_Cursor;

END

Your query returns the names of the tables as stored in the CATEGORY column of the CaseNoteReasonCategories table.

If you want different table names, you might try changing the values in the Category column.

|||

The problem is that the name(s) of the tables do not correspond to the names in the category column. It seems that the names of the tables is fixed at Table, Table1, Table2, etc. This seems to be the case no matter what the names of the tables are in the CATEGORY column.

I have started to look some more into this and this may be an aritfact of ADO.NET. But I am not sure how to override what it is doing so I get the names of the tables corresponding to the names in the CATEGORY column.

|||

I don't believe this is an issue with ADO.NET. Your query is pulling the actual values out of the Category column of the CaseNoteReasonCategories. I suspect that there is some 'test' data in the table and that is what you are seeing.

Your query does not have a WHERE clause, so it will be gathering all rows from CaseNoteReasonCategories, and I suspect Table1, Table2, etc., are the first rows in the table.

Also, in the line below, the + ' AS ' + @.TableName has no value.

EXEC ('SELECT * FROM ' + @.TableName + ' AS ' + @.TableName);

|||

Arnie Rowland wrote:

I don't believe this is an issue with ADO.NET. Your query is pulling the actual values out of the Category column of the CaseNoteReasonCategories. I suspect that there is some 'test' data in the table and that is what you are seeing.

Your query does not have a WHERE clause, so it will be gathering all rows from CaseNoteReasonCategories, and I suspect Table1, Table2, etc., are the first rows in the table.

Also, in the line below, the + ' AS ' + @.TableName has no value.

EXEC ('SELECT * FROM ' + @.TableName + ' AS ' + @.TableName);

The values in the Category column are the names of the tables. These values are NOT Table1, Table2, etc.

I don't have a WHERE clause because I want all of the rows from CaseNoteReasonCategories. Table1, Table2 are not the first rows in this table.

Adding the 'AS' to the end of the query seems to have not effect. I have also tried

EXEC ('SELECT * FROM ' + @.TableName + ' ' + @.TableName);

|||

It is quite a mystery where those table names are being 'automagically' created...

My point was that assigning an alias for the table (with or without using 'AS') has no value since you are not using the alias in your code. It is wasted effort -albeit of little consequence.

Multiple Stored Procedure Execute Together - How?

Hi,
I have multiple stored procedures (SP) running in multiple databases. The
output of all the databases has same column names, same number of columns an
d
column types.
I want to run all these different SP's as one SP and combine the output as
one result.
I tried creating one new SP as SPAll and calling all the SP's in SPAll.
eg.
Create SPAll @.Parameter int
AS
Exec SP1 @.Parameter
Exec SP2 @.Parameter
GO
But when I execute SPAll from 'sql server reporting services' (vs.net), it
executes and displays results from SP1 also. I want to display results from
both SP1 and SP2.
Thanks in advance.Hello GJ.
execute the stored procedures saving the result sets to a temporary table
and then select the results from the temporary table to give you a single
result set
IE:
use Northwind
GO
set nocount on
if object_id('tempdb..#results') is not null drop table #results
create table #results(
index_name sysname,/* Index name. */
index_description varchar(210),/* Index description. */
index_keys nvarchar(2078)/* Table or view column(s) upon which the index is
built. */
)
insert #results(index_name,index_description,in
dex_keys)
exec sp_helpindex @.objname = 'dbo.Categories'
insert #results(index_name,index_description,in
dex_keys)
exec sp_helpindex @.objname = 'dbo.Customers'
select * from #results
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"GJ" wrote:

> Hi,
> I have multiple stored procedures (SP) running in multiple databases. The
> output of all the databases has same column names, same number of columns
and
> column types.
> I want to run all these different SP's as one SP and combine the output as
> one result.
> I tried creating one new SP as SPAll and calling all the SP's in SPAll.
> eg.
> Create SPAll @.Parameter int
> AS
> Exec SP1 @.Parameter
> Exec SP2 @.Parameter
> GO
> But when I execute SPAll from 'sql server reporting services' (vs.net), it
> executes and displays results from SP1 also. I want to display results fro
m
> both SP1 and SP2.
> Thanks in advance.|||Best way, based on what you are telling us:
Create SPAll @.Parameter int
AS
create table #spAllReturn
(
<columns that match procs>
)
insert into #spAllReturn
Exec SP1 @.Parameter
insert into #spAllReturn
Exec SP2 @.Parameter
select * from #spAllReturn
GO
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"GJ" <GJ@.discussions.microsoft.com> wrote in message
news:AA68D163-4681-4794-B4F0-748E72C18760@.microsoft.com...
> Hi,
> I have multiple stored procedures (SP) running in multiple databases. The
> output of all the databases has same column names, same number of columns
> and
> column types.
> I want to run all these different SP's as one SP and combine the output as
> one result.
> I tried creating one new SP as SPAll and calling all the SP's in SPAll.
> eg.
> Create SPAll @.Parameter int
> AS
> Exec SP1 @.Parameter
> Exec SP2 @.Parameter
> GO
> But when I execute SPAll from 'sql server reporting services' (vs.net), it
> executes and displays results from SP1 also. I want to display results
> from
> both SP1 and SP2.
> Thanks in advance.|||GJ
create table #test
(
col ...
....
....
)
insert into #test exec sp1
insert into #test exec sp2
select * from #test
"GJ" <GJ@.discussions.microsoft.com> wrote in message
news:AA68D163-4681-4794-B4F0-748E72C18760@.microsoft.com...
> Hi,
> I have multiple stored procedures (SP) running in multiple databases. The
> output of all the databases has same column names, same number of columns
and
> column types.
> I want to run all these different SP's as one SP and combine the output as
> one result.
> I tried creating one new SP as SPAll and calling all the SP's in SPAll.
> eg.
> Create SPAll @.Parameter int
> AS
> Exec SP1 @.Parameter
> Exec SP2 @.Parameter
> GO
> But when I execute SPAll from 'sql server reporting services' (vs.net), it
> executes and displays results from SP1 also. I want to display results
from
> both SP1 and SP2.
> Thanks in advance.

Monday, February 20, 2012

Multiple Same indexes same table

I was looking at Northwind and noticed that some of the tables have the same
index, but different names on the same table.
For example, on the Orders table you have the following script:
****************************************
************************************
************
CREATE TABLE [dbo].[Orders] (
[OrderID] [int] IDENTITY (1, 1) NOT NULL ,
[CustomerID] [nchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[EmployeeID] [int] NULL ,
[OrderDate] [datetime] NULL ,
[RequiredDate] [datetime] NULL ,
[ShippedDate] [datetime] NULL ,
[ShipVia] [int] NULL ,
[Freight] [money] NULL ,
[ShipName] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ShipAddress] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ShipCity] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ShipRegion] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ShipPostalCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[ShipCountry] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
CREATE INDEX [CustomerID] ON [dbo].[Orders]([CustomerID]) ON [PRIMARY]
GO
CREATE INDEX [CustomersOrders] ON [dbo].[Orders]([CustomerID]) ON
[PRIMARY]
GO
CREATE INDEX [EmployeeID] ON [dbo].[Orders]([EmployeeID]) ON [PRIMARY]
GO
CREATE INDEX [EmployeesOrders] ON [dbo].[Orders]([EmployeeID]) ON
[PRIMARY]
GO
CREATE INDEX [OrderDate] ON [dbo].[Orders]([OrderDate]) ON [PRIMARY]
GO
CREATE INDEX [ShippedDate] ON [dbo].[Orders]([ShippedDate]) ON [PRIMARY]
GO
CREATE INDEX [ShippersOrders] ON [dbo].[Orders]([ShipVia]) ON [PRIMARY]
GO
CREATE INDEX [ShipPostalCode] ON [dbo].[Orders]([ShipPostalCode]) ON
[PRIMARY]
GO
****************************************
************************************
**
CustomerID and CustomerOrders are the same as are EmployeeID and
EmployeesOrders.
Why would you have this?
This would seem to create more overhead for the system.
Just curious.
Thanks,
Tom>I was looking at Northwind and noticed that some of the tables have the same index, but di
fferent
>names on the same table.
<snip>
> Why would you have this?
Because you don't know what you are doing. ;-)
Honestly, there was some type of confusion in the build scripts for the Nort
hwind database. You
don't create two same type of indexes on the same column.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"tshad" <tscheiderich@.ftsolutions.com> wrote in message
news:eSmBW3BpFHA.3304@.tk2msftngp13.phx.gbl...
>I was looking at Northwind and noticed that some of the tables have the sam
e index, but different
>names on the same table.
> For example, on the Orders table you have the following script:
> ****************************************
**********************************
**************
> CREATE TABLE [dbo].[Orders] (
> [OrderID] [int] IDENTITY (1, 1) NOT NULL ,
> [CustomerID] [nchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [EmployeeID] [int] NULL ,
> [OrderDate] [datetime] NULL ,
> [RequiredDate] [datetime] NULL ,
> [ShippedDate] [datetime] NULL ,
> [ShipVia] [int] NULL ,
> [Freight] [money] NULL ,
> [ShipName] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [ShipAddress] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [ShipCity] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [ShipRegion] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [ShipPostalCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
> [ShipCountry] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
> CREATE INDEX [CustomerID] ON [dbo].[Orders]([CustomerID]) ON [PRIMARY]
> GO
> CREATE INDEX [CustomersOrders] ON [dbo].[Orders]([CustomerID]) ON [PRIMARY]
> GO
> CREATE INDEX [EmployeeID] ON [dbo].[Orders]([EmployeeID]) ON [PRIMARY]
> GO
> CREATE INDEX [EmployeesOrders] ON [dbo].[Orders]([EmployeeID]) ON [PRIMARY]
> GO
> CREATE INDEX [OrderDate] ON [dbo].[Orders]([OrderDate]) ON [PRIMARY]
> GO
> CREATE INDEX [ShippedDate] ON [dbo].[Orders]([ShippedDate]) ON [PRIMARY]
> GO
> CREATE INDEX [ShippersOrders] ON [dbo].[Orders]([ShipVia]) ON [PRIMARY]
> GO
> CREATE INDEX [ShipPostalCode] ON [dbo].[Orders]([ShipPostalCode]) ON [PRIMARY]
> GO
> ****************************************
**********************************
****
> CustomerID and CustomerOrders are the same as are EmployeeID and Employees
Orders.
> Why would you have this?
> This would seem to create more overhead for the system.
> Just curious.
> Thanks,
> Tom
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23q$RciCpFHA.496@.TK2MSFTNGP10.phx.gbl...
same index, but different
> <snip>
> Because you don't know what you are doing. ;-)
> Honestly, there was some type of confusion in the build scripts for the
Northwind database. You
> don't create two same type of indexes on the same column.
I guess I do know what I am doing, since I asked the question :).
I figured there was something wrong, but I wanted to make sure I wasn't
missing something.
Thanks,
Tom
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "tshad" <tscheiderich@.ftsolutions.com> wrote in message
> news:eSmBW3BpFHA.3304@.tk2msftngp13.phx.gbl...
same index, but different
****************************************
************************************
************
,
NULL ,
[PRIMARY]
[PRIMARY]
[PRIMARY]
[PRIMARY]
****************************************
************************************
**
EmployeesOrders.
>