Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Friday, March 30, 2012

Multivalue Parameter SQL Server 2005 SP1

Hello, I've installed SP1 for SQl Server 2005 and I noticed that the option "Select all" on a multi value parameter drop down (using web browser) is missing. Even if I can see it on VS 2005.....
Anyone can help me?
Thank you very much.
I rely on the 'Select All' capability as well. How can I get it back now that I've upgraded to SP1?|||

I finally found the answer on this. SP1 removes the 'Select All' capability previously applied when choosing the 'multi-value' option on a parameter list. Could not easily find this in the Release Notes.

I finally found it by looking through the updated version of the 'Books Online'. I must admit I understand the logic behind changing things here and the revised approach will make for more efficient queries (at the expense of recoding) - but it would be nice to know things prior to installing the SP - not after.

FYI - if, like me you develop on one system, and deploy to another, you can continue to develop on 2005/SP1, deploy to a 2005/non-SP1 system and things will work as before. Once you update the deployment target system to 2005/SP1 - the option is gone and you'll have to go back and do the parameter dataset recoding as outlined in the updated Books Online.

Bob

|||

Where did you find this information in Books Online? Can you provide a link? I'd like to take a closer look, because we also use this feature (which is admittedly funky) extensively.

Joe

|||

There is updated BOL contents available on MSDN which explains how to change SQL-based queries to simulate the "ALL" element: http://msdn2.microsoft.com/en-us/library/ms155917.aspx (scroll to the section about "Adding an All Member to a Multivalue Parameter").

-- Robert

|||

i believe there is also a hotfix available for this problem

|||

Do you have a link to the hotfix?

michael

|||http://support.microsoft.com/kb/918222|||

Thank you very much.

Michael

|||

Hello,

I faced the problem that on my development server <select all> was displaying and on the production it was not due to SP2 on development compared to SP1 on production.

SP2 was then loaded on the production server and rebooted the machine even then the <select all> cannot be seen. Would i need to reload the report or any futher fixes.

I know I am close to reaching a solution

Thanks

Multivalue Parameter SQL Server 2005 SP1

Hello, I've installed SP1 for SQl Server 2005 and I noticed that the option "Select all" on a multi value parameter drop down (using web browser) is missing. Even if I can see it on VS 2005.....
Anyone can help me?
Thank you very much.I rely on the 'Select All' capability as well. How can I get it back now that I've upgraded to SP1?|||

I finally found the answer on this. SP1 removes the 'Select All' capability previously applied when choosing the 'multi-value' option on a parameter list. Could not easily find this in the Release Notes.

I finally found it by looking through the updated version of the 'Books Online'. I must admit I understand the logic behind changing things here and the revised approach will make for more efficient queries (at the expense of recoding) - but it would be nice to know things prior to installing the SP - not after.

FYI - if, like me you develop on one system, and deploy to another, you can continue to develop on 2005/SP1, deploy to a 2005/non-SP1 system and things will work as before. Once you update the deployment target system to 2005/SP1 - the option is gone and you'll have to go back and do the parameter dataset recoding as outlined in the updated Books Online.

Bob

|||

Where did you find this information in Books Online? Can you provide a link? I'd like to take a closer look, because we also use this feature (which is admittedly funky) extensively.

Joe

|||

There is updated BOL contents available on MSDN which explains how to change SQL-based queries to simulate the "ALL" element: http://msdn2.microsoft.com/en-us/library/ms155917.aspx (scroll to the section about "Adding an All Member to a Multivalue Parameter").

-- Robert

|||

i believe there is also a hotfix available for this problem

|||

Do you have a link to the hotfix?

michael

|||http://support.microsoft.com/kb/918222|||

Thank you very much.

Michael

|||

Hello,

I faced the problem that on my development server <select all> was displaying and on the production it was not due to SP2 on development compared to SP1 on production.

SP2 was then loaded on the production server and rebooted the machine even then the <select all> cannot be seen. Would i need to reload the report or any futher fixes.

I know I am close to reaching a solution

Thanks

sql

Multivalue Parameter SQL Server 2005 SP1

Hello, I've installed SP1 for SQl Server 2005 and I noticed that the option "Select all" on a multi value parameter drop down (using web browser) is missing. Even if I can see it on VS 2005.....
Anyone can help me?
Thank you very much.
I rely on the 'Select All' capability as well. How can I get it back now that I've upgraded to SP1?|||

I finally found the answer on this. SP1 removes the 'Select All' capability previously applied when choosing the 'multi-value' option on a parameter list. Could not easily find this in the Release Notes.

I finally found it by looking through the updated version of the 'Books Online'. I must admit I understand the logic behind changing things here and the revised approach will make for more efficient queries (at the expense of recoding) - but it would be nice to know things prior to installing the SP - not after.

FYI - if, like me you develop on one system, and deploy to another, you can continue to develop on 2005/SP1, deploy to a 2005/non-SP1 system and things will work as before. Once you update the deployment target system to 2005/SP1 - the option is gone and you'll have to go back and do the parameter dataset recoding as outlined in the updated Books Online.

Bob

|||

Where did you find this information in Books Online? Can you provide a link? I'd like to take a closer look, because we also use this feature (which is admittedly funky) extensively.

Joe

|||

There is updated BOL contents available on MSDN which explains how to change SQL-based queries to simulate the "ALL" element: http://msdn2.microsoft.com/en-us/library/ms155917.aspx (scroll to the section about "Adding an All Member to a Multivalue Parameter").

-- Robert

|||

i believe there is also a hotfix available for this problem

|||

Do you have a link to the hotfix?

michael

|||http://support.microsoft.com/kb/918222|||

Thank you very much.

Michael

|||

Hello,

I faced the problem that on my development server <select all> was displaying and on the production it was not due to SP2 on development compared to SP1 on production.

SP2 was then loaded on the production server and rebooted the machine even then the <select all> cannot be seen. Would i need to reload the report or any futher fixes.

I know I am close to reaching a solution

Thanks

Multivalue Parameter SQL Server 2005 SP1

Hello, I've installed SP1 for SQl Server 2005 and I noticed that the option "Select all" on a multi value parameter drop down (using web browser) is missing. Even if I can see it on VS 2005.....
Anyone can help me?
Thank you very much.
I rely on the 'Select All' capability as well. How can I get it back now that I've upgraded to SP1?|||

I finally found the answer on this. SP1 removes the 'Select All' capability previously applied when choosing the 'multi-value' option on a parameter list. Could not easily find this in the Release Notes.

I finally found it by looking through the updated version of the 'Books Online'. I must admit I understand the logic behind changing things here and the revised approach will make for more efficient queries (at the expense of recoding) - but it would be nice to know things prior to installing the SP - not after.

FYI - if, like me you develop on one system, and deploy to another, you can continue to develop on 2005/SP1, deploy to a 2005/non-SP1 system and things will work as before. Once you update the deployment target system to 2005/SP1 - the option is gone and you'll have to go back and do the parameter dataset recoding as outlined in the updated Books Online.

Bob

|||

Where did you find this information in Books Online? Can you provide a link? I'd like to take a closer look, because we also use this feature (which is admittedly funky) extensively.

Joe

|||

There is updated BOL contents available on MSDN which explains how to change SQL-based queries to simulate the "ALL" element: http://msdn2.microsoft.com/en-us/library/ms155917.aspx (scroll to the section about "Adding an All Member to a Multivalue Parameter").

-- Robert

|||

i believe there is also a hotfix available for this problem

|||

Do you have a link to the hotfix?

michael

|||http://support.microsoft.com/kb/918222|||

Thank you very much.

Michael

|||

Hello,

I faced the problem that on my development server <select all> was displaying and on the production it was not due to SP2 on development compared to SP1 on production.

SP2 was then loaded on the production server and rebooted the machine even then the <select all> cannot be seen. Would i need to reload the report or any futher fixes.

I know I am close to reaching a solution

Thanks

Multivalue Parameter SQL Server 2005 SP1

Hello, I've installed SP1 for SQl Server 2005 and I noticed that the option "Select all" on a multi value parameter drop down (using web browser) is missing. Even if I can see it on VS 2005.....
Anyone can help me?
Thank you very much.I rely on the 'Select All' capability as well. How can I get it back now that I've upgraded to SP1?|||

I finally found the answer on this. SP1 removes the 'Select All' capability previously applied when choosing the 'multi-value' option on a parameter list. Could not easily find this in the Release Notes.

I finally found it by looking through the updated version of the 'Books Online'. I must admit I understand the logic behind changing things here and the revised approach will make for more efficient queries (at the expense of recoding) - but it would be nice to know things prior to installing the SP - not after.

FYI - if, like me you develop on one system, and deploy to another, you can continue to develop on 2005/SP1, deploy to a 2005/non-SP1 system and things will work as before. Once you update the deployment target system to 2005/SP1 - the option is gone and you'll have to go back and do the parameter dataset recoding as outlined in the updated Books Online.

Bob

|||

Where did you find this information in Books Online? Can you provide a link? I'd like to take a closer look, because we also use this feature (which is admittedly funky) extensively.

Joe

|||

There is updated BOL contents available on MSDN which explains how to change SQL-based queries to simulate the "ALL" element: http://msdn2.microsoft.com/en-us/library/ms155917.aspx (scroll to the section about "Adding an All Member to a Multivalue Parameter").

-- Robert

|||

i believe there is also a hotfix available for this problem

|||

Do you have a link to the hotfix?

michael

|||http://support.microsoft.com/kb/918222|||

Thank you very much.

Michael

|||

Hello,

I faced the problem that on my development server <select all> was displaying and on the production it was not due to SP2 on development compared to SP1 on production.

SP2 was then loaded on the production server and rebooted the machine even then the <select all> cannot be seen. Would i need to reload the report or any futher fixes.

I know I am close to reaching a solution

Thanks

MultiUsers Question

We had a debate on designing a database .The use case is;

an application that we will rent to other companies from our own datacenter on the web.They will all use the same database schema.We found 3 alternatives for our solution.But we are not sure which one is the best.

We are expecting 20.000 insurance agencies to use the database composed of 33 tables.And they will all have their unique data but sometimes for reporting we might union their data.

ALTERNATIVES

1.Make 20.000 database instances.Every agency will have their own database instance.

2.Make one database instance , put a database ownerID(int) field to every table.And use appropiate indexes.*or table partioning

3.Make one database instance , and create 33 tables for every database owner.So total number of tables in the datase equals to numberofUsers X 33

Did anyone tested this situation?

*an article I read on the web said partining is allowed to 1000 per table and it is slow in SQL 2005.(I am confused)

http://www.sqljunkies.com/Article/F4920050-6C63-4109-93FF-C2B7EB0A5835.scuk

In common, I am a fan of putting all the data together in one database. based on the information that you provided it is hard to decide wheter you need separated database / instances or not.

There are several things which you should consider:

-Organisational structure (You could also split the database up in regions / geographical or country based)
-Maintainance (Due to different timezones / work loads on the databases you might have different maintainance windows to do something)
-Load balancing
-Scaling
-Availability
-Estimated workload

etc.

I think that we both agree that you wouldn′t put 20000 dbs on on server, or create thousends of instances (the limit is 25 for one computer)

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

sql

Monday, March 26, 2012

Multi-Server setup: RS, Sharepoint, new SP2 Webparts

I was reading the SP2 readme and I see this in section 4.1.1:
"To use the Reporting Services SharePoint Web parts, Report Server and
Report Manager must both be installed."
My company's RS server is on it's own box (A). The RS Configuration db
is on it's own box (B). Our intranet (Sharepoint) site is on it's own
box (C). 3 servers total. I want to try out the 2 new web parts. Can I
just copy the the RSWebParts.cab from server A to our Sharepoint server
C and install it or do I actually have to install a full blown
installation of RS plus RS SP2 on that Sharepoint server C? If so, why?
Because I was planning to point the web parts to the reports that exist
on the separate RS server A, or is that not permitted?
Am I going to have to redeploy my reports to C, manage a second
configuration database / report server? I hope not.
Thank you!No, you do not need to install RS on Box C. The parts can be pointed to any
existing RS. The point of the documentation was to let people know they
needed a working RS for the parts to work, not that they needed to all exist
on the same box.
I hope that helps.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dave" <macleary2000@.yahoo.com> wrote in message
news:1134065827.784617.228020@.g44g2000cwa.googlegroups.com...
>I was reading the SP2 readme and I see this in section 4.1.1:
> "To use the Reporting Services SharePoint Web parts, Report Server and
> Report Manager must both be installed."
> My company's RS server is on it's own box (A). The RS Configuration db
> is on it's own box (B). Our intranet (Sharepoint) site is on it's own
> box (C). 3 servers total. I want to try out the 2 new web parts. Can I
> just copy the the RSWebParts.cab from server A to our Sharepoint server
> C and install it or do I actually have to install a full blown
> installation of RS plus RS SP2 on that Sharepoint server C? If so, why?
> Because I was planning to point the web parts to the reports that exist
> on the separate RS server A, or is that not permitted?
> Am I going to have to redeploy my reports to C, manage a second
> configuration database / report server? I hope not.
> Thank you!
>

Friday, March 23, 2012

Multiple/Duplicate SQL Server Worker Processes

I don't even know where to begin looking... I have a page that loads multiple web user controls...
I know I use one connection object class that is used in all my objects when executing the query (calling Stored Procedures).
The problem is when the first page is rendered and each user control queries the database (SQL Server),
it eventually slows down. In my controls, I use a lot of repeaters and internal queries per each repeater item.
So I know it hits the database quite often.
Problem is when I look in SQL Server Enterprise Manager Process Info, I have multiple worker processes sleeping.
My first thought is ASP.net is creating a new session connection (process) to the SQL Server? Why? How?
What do I do to check either my code is creating the connection object properly. Thanks!
Larry
I have discovered, when I created my connection object for ExecuteNonQuery(), I forgot to Close() the connection.
Since I didn't close the connection object when I was finished... anda few new instances of the connection object was created, it created anew connection object.
In other functions, I was using the DataAdapter which opened and closedthe connection for you, so I took that feature for granted andcompletely forgot to close the connection object when doing aExecuteNonQuery().
I get a doht for the day...
Thanks for taking your time in reading...

Wednesday, March 21, 2012

multiple web site to access the same SQL Server database

Each SQL Server database should correspond to one IP address. I assume web
server and database server are in separate machines. Here's 2 cases:
case 1: A single web site have data access to the SQL Server database.
case 2: There are multiple web sites need to have data access to the same
SQL Server database.
Obviously, case 2 will create more network traffic than case 1. Then how
should do we about that? Use more than one SQL Server (i.e. different IP
address)? But what IP address should use in connection string in web pages'
Please advise!
Thanks!Hi,
If you want to distribute the work load amoung multiple SQL servers I
believe you would have to use some form of clustering technology such as
Microsoft Cluster Service. Then you can use the IP address of the virtual
SQL Server. There are limitations to this solution so be sure to investigate
and make sure that it fits your requirement.
Hope this helps
Chris Taylor
"Matt" <mattloude@.hotmail.com> wrote in message
news:e92o1DZoDHA.1632@.TK2MSFTNGP10.phx.gbl...
> Each SQL Server database should correspond to one IP address. I assume web
> server and database server are in separate machines. Here's 2 cases:
> case 1: A single web site have data access to the SQL Server database.
> case 2: There are multiple web sites need to have data access to the same
> SQL Server database.
> Obviously, case 2 will create more network traffic than case 1. Then how
> should do we about that? Use more than one SQL Server (i.e. different IP
> address)? But what IP address should use in connection string in web
pages'
> Please advise!
> Thanks!
>
>

Multiple Views & Web Form

I have ViewA that sums up 4 fields from one table. I then have ViewB that
uses ViewA to calculate the results. Now I do this with 5 different tables
and then link them all to get my final results. Each View has a date range
(begin / end) that I need to pass from a Web form.
How should I go about doing this? Should I create a temporary table to hold
the begin / end dates to use in the sub Views? Or something else? I am at a
lost on how to go about this and need some direction and syntax?
Thanks in advance for your help!!
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200606/1Chamark via webservertalk.com wrote:
> I have ViewA that sums up 4 fields from one table. I then have ViewB that
> uses ViewA to calculate the results. Now I do this with 5 different tables
> and then link them all to get my final results. Each View has a date range
> (begin / end) that I need to pass from a Web form.
> How should I go about doing this? Should I create a temporary table to hol
d
> the begin / end dates to use in the sub Views? Or something else? I am at
a
> lost on how to go about this and need some direction and syntax?
> Thanks in advance for your help!!
>
Post your DDL, and let's start by eliminating these unnecessary views.
Simplify this whole mess into a single query, making it easier to pass
date parameters to.|||>> I have ViewA that sums up 4 fields [sic] from one table. I then have ViewB tha
t uses ViewA to calculate the results. <<
Fileds and columns are totally different concepts.
VIEWs do not take parameters; stored procedures take parameters. Since
this is an SQL newsgroup, we really don't care about the Web form part.
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications. It is very hard to debug code when you do not let us
see it and all your terms are wrong.|||Hi Chamark,
Use a stored procedure and call that from your application, without seeing
your DDL (create table and create view stuff) its difficult but this might
give you an idea...
create proc get_yourstuff
@.range1_start datetime,
@.range1_end datetime,
@.range2_start datetime,
@.range2_end datetime
as
begin
select ...
from view1 as v1
inner join view2 as v2 on v2.yoursurrogatekey = v1.yoursurrogatekey
where v1.yourdate between @.range1_start and @.range1_end
and v2.yourdate between @.range2_start and @.range2_end
order by ...
end
PS... ignore celko's comment about not posting about the webform part - the
guy is an idiot, this is a SQL Server programming group and your post is
fine.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Chamark via webservertalk.com" <u21870@.uwe> wrote in message
news:6247bb4bcf5d5@.uwe...
>I have ViewA that sums up 4 fields from one table. I then have ViewB that
> uses ViewA to calculate the results. Now I do this with 5 different tables
> and then link them all to get my final results. Each View has a date range
> (begin / end) that I need to pass from a Web form.
> How should I go about doing this? Should I create a temporary table to
> hold
> the begin / end dates to use in the sub Views? Or something else? I am at
> a
> lost on how to go about this and need some direction and syntax?
> Thanks in advance for your help!!
> --
> Message posted via webservertalk.com
> http://www.webservertalk.com/Uwe/Forum...amming/200606/1|||> Since
> this is an SQL newsgroup, we really don't care about the Web form part.
You are the LAST person to give any advice on posting content here, you
don't seem to realise this is a forum for MICROSOFT SQL SERVER PROGRAMMING
and NOT a SQL only forum.
Next time you post, check what forum you are posting to, this is
MICROSOFT.PUBLIC.SQLSERVER.PROGRAMMING.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1151206577.847462.67840@.b68g2000cwa.googlegroups.com...
> Fileds and columns are totally different concepts.
>
> VIEWs do not take parameters; stored procedures take parameters. Since
> this is an SQL newsgroup, we really don't care about the Web form part.
>
> Please post DDL, so that people do not have to guess what the keys,
> constraints, Declarative Referential Integrity, data types, etc. in
> your schema are. Sample data is also a good idea, along with clear
> specifications. It is very hard to debug code when you do not let us
> see it and all your terms are wrong.
>|||Thanks Tracy,
I haven't posted the DDL before. I am hoping the following is what you are
referencing. If not please advise.
Associate is my common field.
CREATE DATABASE [CSSMetrics] ON (NAME = N'MetricsSQL_dat', FILENAME = N'C:\
Program Files\Microsoft SQL Server\MSSQL\data\MetricsSQL.mdf' , SIZE = 1405,
FILEGROWTH = 10%) LOG ON (NAME = N'MetricsSQL_log', FILENAME = N'C:\Program
Files\Microsoft SQL Server\MSSQL\data\MetricsSQL.ldf' , SIZE = 4112,
FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO
exec sp_dboption N'CSSMetrics', N'autoclose', N'false'
GO
exec sp_dboption N'CSSMetrics', N'bulkcopy', N'false'
GO
exec sp_dboption N'CSSMetrics', N'trunc. log', N'false'
GO
exec sp_dboption N'CSSMetrics', N'torn page detection', N'true'
GO
exec sp_dboption N'CSSMetrics', N'read only', N'false'
GO
exec sp_dboption N'CSSMetrics', N'dbo use', N'false'
GO
exec sp_dboption N'CSSMetrics', N'single', N'false'
GO
exec sp_dboption N'CSSMetrics', N'autoshrink', N'false'
GO
exec sp_dboption N'CSSMetrics', N'ANSI null default', N'false'
GO
exec sp_dboption N'CSSMetrics', N'recursive triggers', N'false'
GO
exec sp_dboption N'CSSMetrics', N'ANSI nulls', N'false'
GO
exec sp_dboption N'CSSMetrics', N'concat null yields null', N'false'
GO
exec sp_dboption N'CSSMetrics', N'cursor close on commit', N'false'
GO
exec sp_dboption N'CSSMetrics', N'default to local cursor', N'false'
GO
exec sp_dboption N'CSSMetrics', N'quoted identifier', N'false'
GO
exec sp_dboption N'CSSMetrics', N'ANSI warnings', N'false'
GO
exec sp_dboption N'CSSMetrics', N'auto create statistics', N'true'
GO
exec sp_dboption N'CSSMetrics', N'auto update statistics', N'true'
GO
use [CSSMetrics]
GO
CREATE TABLE [dbo].[Bonus] (
[BonusDate] [datetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CSI] (
[Part Surv Id] [float] NULL ,
[Seq C] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Prod Id C] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Site] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Segment] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Associate] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Team] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Date] [smalldatetime] NULL ,
[#] [float] NULL ,
[Resp Val Id] [float] NULL ,
[Adjusted Weight] [float] NULL ,
[ExtSatWt] [float] NULL ,
[VerSatWt] [float] NULL ,
[H1] [float] NULL ,
[Last Touch] [float] NULL ,
[Surv Strt Tm] [smalldatetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[CSI-Disconnect] (
[Date] [smalldatetime] NULL ,
[Associate] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[H1] [float] NULL ,
[Last Touch] [float] NULL ,
[Team] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Site] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Call Strt Tm] [smalldatetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Call Scores] (
[Date] [smalldatetime] NULL ,
[Site] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Associate] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Score] [float] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Goals] (
[Segment] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Adherence] [float] NULL ,
[Efficiency] [float] NULL ,
[AHT] [float] NULL ,
[Shift Account] [float] NULL ,
[Top 2 Box] [float] NULL ,
[Disconnect] [float] NULL ,
[Call Score] [float] NULL ,
[Retained] [float] NULL ,
[RWI] [float] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[National AR] (
[Date] [smalldatetime] NULL ,
[Site] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Director] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Team] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Segment] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Associate] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[SSN Count] [float] NULL ,
[RTF] [money] NULL ,
[RTC] [money] NULL ,
[CashedOut] [money] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[National Call Stats] (
[Date] [smalldatetime] NULL ,
[Site] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Segment] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Director] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Team] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Rep Ssn] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Associate] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[NchQty] [float] NULL ,
[SchdOpenSecsQty] [float] NULL ,
[LogOnSecsQty] [float] NULL ,
[InAdherenceSecsQty] [float] NULL ,
[OutOfAdherenceSecsQty] [float] NULL ,
[HoldSecsQty] [float] NULL ,
[TotalHandleTime] [float] NULL ,
[TalkHoldAvailable] [float] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[OPA] (
[Date] [smalldatetime] NULL ,
[Site] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Segment] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Director] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Team] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[OPA Code] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Opa Seconds Qty] [float] NULL ,
[Associate] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
Tracy McKibben wrote:
>[quoted text clipped - 6 lines]
>Post your DDL, and let's start by eliminating these unnecessary views.
>Simplify this whole mess into a single query, making it easier to pass
>date parameters to.
Message posted via http://www.webservertalk.com|||Chamark via webservertalk.com wrote:
> Thanks Tracy,
> I haven't posted the DDL before. I am hoping the following is what you are
> referencing. If not please advise.
>
Need to see your CREATE VIEW statements too, it's not clear what you
meant by "sums up 4 fields" and "calculate the results".

> Tracy McKibben wrote:
>|||I use all these views joined together to get my final results. Each sub view
has the date range. I need one common place to supply the data range coming
from a Web form to supply these views.
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_AR_STATS_VIEW
AS
SELECT TOP 10000 dbo.ASSOC_AR_SUMS_VIEW.Team, dbo.ASSOC_AR_SUMS_VIEW.
Segment, dbo.ASSOC_AR_SUMS_VIEW.Associate,
NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfRTF, 0) AS RTF,
NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfRTC, 0) AS RTC,
NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfCashedOut, 0) AS
[Cashed Out], NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfRTF, 0)
/ (NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfRTF, 0) + NULLIF
(dbo.ASSOC_AR_SUMS_VIEW.SumOfRTC, 0)) AS Retention,
NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfCashedOut, 0) /
NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfCashedOut, 0)
+ NULLIF (dbo.ASSOC_AR_SUMS_VIEW.SumOfRTF, 0) AS COR,
dbo.Goals.Retained
FROM dbo.ASSOC_AR_SUMS_VIEW INNER JOIN
dbo.Goals ON dbo.ASSOC_AR_SUMS_VIEW.Segment = dbo.Goals.
Segment AND dbo.ASSOC_AR_SUMS_VIEW.[Date] >= '5/1/2006' AND
dbo.ASSOC_AR_SUMS_VIEW.[Date] <= '5/20/2006' AND dbo.
ASSOC_AR_SUMS_VIEW.Team = 'Abbott'
ORDER BY dbo.ASSOC_AR_SUMS_VIEW.Team, dbo.ASSOC_AR_SUMS_VIEW.Segment
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_AR_SUMS_VIEW
AS
SELECT TOP 10000 Team, Segment, Associate, SUM([SSN Count]) AS
Opportunities, SUM(RTF) AS SumOfRTF, SUM(RTC) AS SumOfRTC, SUM(CashedOut)
AS SumOfCashedOut, [Date], Site
FROM dbo.[National AR]
GROUP BY Team, Segment, Associate, [Date], Site
ORDER BY Team, Segment, Associate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_CALL_STATS_VIEW
AS
SELECT dbo.ASSOC_CALL_SUMS_VIEW.Team, dbo.ASSOC_CALL_SUMS_VIEW.Associate
,
dbo.ASSOC_CALL_SUMS_VIEW.SumOfInAdherenceSecsQty / (dbo.
ASSOC_CALL_SUMS_VIEW.SumOfInAdherenceSecsQty + dbo.ASSOC_CALL_SUMS_VIEW.
SumOfOutOfAdherenceSecsQty)
AS Adherence, dbo.ASSOC_CALL_SUMS_VIEW.
SumOfTalkHoldAvailable / dbo.ASSOC_CALL_SUMS_VIEW.SumOfLogOnSecsQty AS
Efficiency,
[sumofTotalHandleTime ] / [sumofNchQty ] AS AHT,
dbo.ASSOC_CALL_SUMS_VIEW.SumOfHoldSecsQty / dbo.
ASSOC_CALL_SUMS_VIEW.SumOfNchQty AS HT,
dbo.ASSOC_CALL_SUMS_VIEW.SumOfLogOnSecsQty / dbo.
ASSOC_CALL_SUMS_VIEW.SumOfSchdOpenSecsQty AS [Shift Account],
dbo.ASSOC_CALL_SUMS_VIEW.SumOfNchQty AS [Calls Taken],
dbo.Goals.Adherence AS [Adherence Goal], dbo.Goals.Efficiency AS [Efficiency
Goal],
dbo.Goals.AHT AS [AHT Goal], dbo.Goals.[Shift Account]
AS [SA Goal]
FROM dbo.ASSOC_CALL_SUMS_VIEW INNER JOIN
dbo.Goals ON dbo.ASSOC_CALL_SUMS_VIEW.Segment = dbo.
Goals.Segment
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_CALL_SUMS_VIEW
AS
SELECT TOP 10000 Team, Segment, Associate, SUM(NchQty) AS SumOfNchQty,
SUM(SchdOpenSecsQty) AS SumOfSchdOpenSecsQty, SUM(LogOnSecsQty)
AS SumOfLogOnSecsQty, SUM(InAdherenceSecsQty) AS
SumOfInAdherenceSecsQty, SUM(OutOfAdherenceSecsQty) AS
SumOfOutOfAdherenceSecsQty,
SUM(HoldSecsQty) AS SumOfHoldSecsQty, SUM
(TotalHandleTime) AS SumOfTotalHandleTime, SUM(TalkHoldAvailable) AS
SumOfTalkHoldAvailable,
[Date]
FROM dbo.[National Call Stats]
GROUP BY Team, Associate, Segment, [Date]
ORDER BY Team, Associate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_CSI_DISC_STATS_VIEW
AS
SELECT TOP 1000 dbo.ASSOC_CSI_DISC_SUMS_VIEW.Team, dbo.
ASSOC_CSI_DISC_SUMS_VIEW.Associate,
NULLIF (dbo.ASSOC_CSI_DISC_SUMS_VIEW.SumOfH1, 0) /
NULLIF (dbo.ASSOC_CSI_DISC_SUMS_VIEW.[SumOfLast Touch], 0) AS Disconnect,
dbo.Goals.[Disconnect] AS [Disconnect Goal]
FROM dbo.ASSOC_CSI_DISC_SUMS_VIEW INNER JOIN
dbo.Goals ON dbo.ASSOC_CSI_DISC_SUMS_VIEW.Segment = dbo.
Goals.Segment
ORDER BY dbo.ASSOC_CSI_DISC_SUMS_VIEW.Team, dbo.ASSOC_CSI_DISC_SUMS_VIEW.
Associate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_CSI_DISC_SUMS_VIEW
AS
SELECT TOP 5000 dbo.[CSI-Disconnect].Team, dbo.[National Call Stats].
Segment, dbo.[CSI-Disconnect].Associate, SUM(dbo.[CSI-Disconnect].H1) AS
SumOfH1,
SUM(dbo.[CSI-Disconnect].[Last Touch]) AS [SumOfLast
Touch]
FROM dbo.[CSI-Disconnect] RIGHT OUTER JOIN
dbo.[National Call Stats] ON dbo.[CSI-Disconnect].[Date]
= dbo.[National Call Stats].[Date] AND
dbo.[CSI-Disconnect].Site = dbo.[National Call Stats].
Site AND dbo.[CSI-Disconnect].Associate = dbo.[National Call Stats].Associat
e
WHERE (dbo.[CSI-Disconnect].[Date] >= '5/1/2006') AND (dbo.[CSI-
Disconnect].[Date] <= '5/31/2006') AND (dbo.[CSI-Disconnect].Site = 'Dallas')
AND
(dbo.[CSI-Disconnect].Team = 'Abbott')
GROUP BY dbo.[CSI-Disconnect].Team, dbo.[CSI-Disconnect].Associate, dbo.
[National Call Stats].Segment
HAVING (dbo.[CSI-Disconnect].Team <> N' ')
ORDER BY dbo.[CSI-Disconnect].Team, dbo.[CSI-Disconnect].Associate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_CSI_STATS_VIEW
AS
SELECT TOP 10000 dbo.ASSOC_CSI_SUMS_VIEW.Team, dbo.ASSOC_CSI_SUMS_VIEW.
Associate,
([Sumofextsatwt ] + dbo.ASSOC_CSI_SUMS_VIEW.
SumOfVerSatWt) / dbo.ASSOC_CSI_SUMS_VIEW.[SumOfAdjusted Weight] AS [CSI
Overall],
dbo.ASSOC_CSI_SUMS_VIEW.[CountOfSurv Strt Tm] AS
Surveys, dbo.Goals.[Top 2 Box] AS [CSI Goal]
FROM dbo.ASSOC_CSI_SUMS_VIEW INNER JOIN
dbo.Goals ON dbo.ASSOC_CSI_SUMS_VIEW.Segment = dbo.
Goals.Segment
ORDER BY dbo.ASSOC_CSI_SUMS_VIEW.Team, dbo.ASSOC_CSI_SUMS_VIEW.Associate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.ASSOC_CSI_SUMS_VIEW
AS
SELECT TOP 10000 Team, Segment, Associate, SUM([Adjusted Weight]) AS
[SumOfAdjusted Weight], SUM(ExtSatWt) AS SumOfExtSatWt, SUM(VerSatWt)
AS SumOfVerSatWt, COUNT([Surv Strt Tm]) AS [CountOfSurv
Strt Tm], [Date]
FROM dbo.CSI
WHERE ([Date] >= ' 5/1/2006') AND ([Date] <= '5/31/2006') AND (Site =
'Dallas') AND (Team = 'Abbott')
GROUP BY Team, Associate, Segment, [Date]
ORDER BY Team, Associate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
Tracy McKibben wrote:
>Need to see your CREATE VIEW statements too, it's not clear what you
>meant by "sums up 4 fields" and "calculate the results".
>
>[quoted text clipped - 3 lines]
Message posted via http://www.webservertalk.com|||Yes, this is DDL. And **everything** in it is wrong. If I put this in
one of my books, people would think I made it up
1. Why is everything NULL-able? That means you cannot ever have a key.
Tables by definition must have keys.
2. What careful research lead to you to discover the amazing fact
almost everything in your universe is not only NULL-able but also
NVARCHAR (255)? In your world, I use the Diamond Sutra in Chinese for
a ZIP code. And someone will. These tables will accumulate crap the
minute they go into production.
3. Why do you have data element names with spaces or special characters
in them? My personal favorite is "# FLOAT NULL". Octothrope!?
That is the sort of thing you in an old beginning programming book
where they give you a list of illegal names. We allowed quoted
identifiers in SQL so that future reserved words could be used in
current code. It was never, never meant for doing display work in the
database. What you have found is a great way to prevent readability,
portability and maintainability of code!
4. So many of the names are vague and violate ISO-11179 rules. For
team given "team NVARCHAR (255) NULL" is this the insanely lonh
name of the team? An identifier of some kind, like a URL? Their
location? Their mascot? Their total body weight? What?
5. I see you like SMALLDATETIME and MONEY to prevent portability. Good
SQL do not use proprietary data types. Do you know about MONEY math
errors and deprecation in SQL Server? Are you following GAAP rules? EU
rules?
6. You use FLOAT for a lot of things. First of all, floating point
math is only used in scientific systems for a good reason - rounding
errors and lack of precision would destroy the integrity of a
commercial system. For example, why is ssn_count a FLOAT and not an
integer? Give me an example.
7. You have an identifier called "part_surv_id FLOAT NULL" which is
a real nightmare. Identifiers have to be unique and therefore they
have to be an exact data type.
8. You have a "surv_strt_tm DATETIME", which looks like "survey
start time" but no ending time. The nature of time is that it is a
continuum, so you must have a half-open interval with an explicit or
implicit ending time.
9. Tables repeat columns over and over, but there is no RI among any of
them.
I strongly recommend that you start over and get more help than you are
going to find in a newsgroup. You clearly have no idea what a data
mdoel is, much less how to program in SQL (asking what DDL is kinda
like walking into a Mosque and asking "Hey, you on your knees, which
way is Mecca?" ).
Someone here with a lot of time on their hands might be able to get you
a kludge to make you think that you have been helped, but it will
simply destroy you in the long run.|||Celko,
First I appreciate you taking your valuable time (no tone here) to respond i
n
the detail that you did. I obviously am not as advanced as you. I took this
over as an ACCESS upgrade. I can not start over. I can't answer why about th
e
NULLs & Float or your other comments. I'm learning on the fly. I will not
waste anymore of your time, and look elsewhere for an answer.
--CELKO-- wrote:
>Yes, this is DDL. And **everything** in it is wrong. If I put this in
>one of my books, people would think I made it up
>1. Why is everything NULL-able? That means you cannot ever have a key.
> Tables by definition must have keys.
>2. What careful research lead to you to discover the amazing fact
>almost everything in your universe is not only NULL-able but also
>NVARCHAR (255)? In your world, I use the Diamond Sutra in Chinese for
>a ZIP code. And someone will. These tables will accumulate crap the
>minute they go into production.
>3. Why do you have data element names with spaces or special characters
>in them? My personal favorite is "# FLOAT NULL". Octothrope!?
>That is the sort of thing you in an old beginning programming book
>where they give you a list of illegal names. We allowed quoted
>identifiers in SQL so that future reserved words could be used in
>current code. It was never, never meant for doing display work in the
>database. What you have found is a great way to prevent readability,
>portability and maintainability of code!
>4. So many of the names are vague and violate ISO-11179 rules. For
>team given "team NVARCHAR (255) NULL" is this the insanely lonh
>name of the team? An identifier of some kind, like a URL? Their
>location? Their mascot? Their total body weight? What?
>5. I see you like SMALLDATETIME and MONEY to prevent portability. Good
>SQL do not use proprietary data types. Do you know about MONEY math
>errors and deprecation in SQL Server? Are you following GAAP rules? EU
>rules?
>6. You use FLOAT for a lot of things. First of all, floating point
>math is only used in scientific systems for a good reason - rounding
>errors and lack of precision would destroy the integrity of a
>commercial system. For example, why is ssn_count a FLOAT and not an
>integer? Give me an example.
>7. You have an identifier called "part_surv_id FLOAT NULL" which is
>a real nightmare. Identifiers have to be unique and therefore they
>have to be an exact data type.
>8. You have a "surv_strt_tm DATETIME", which looks like "survey
>start time" but no ending time. The nature of time is that it is a
>continuum, so you must have a half-open interval with an explicit or
>implicit ending time.
>9. Tables repeat columns over and over, but there is no RI among any of
>them.
>I strongly recommend that you start over and get more help than you are
>going to find in a newsgroup. You clearly have no idea what a data
>mdoel is, much less how to program in SQL (asking what DDL is kinda
>like walking into a Mosque and asking "Hey, you on your knees, which
>way is Mecca?" ).
>Someone here with a lot of time on their hands might be able to get you
>a kludge to make you think that you have been helped, but it will
>simply destroy you in the long run.
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200606/1

Monday, March 19, 2012

Multiple users problem

Hi, I am building a web application now that will be used by multiple users. Users import data from a CSV into table 'temp' which is later converted to the right data type and then moved to another table, but I was wondering what would happen if more than 1 user was importing different files at the same time.

Will this create a problem, if so how can I fix this?

Thanks for the help.

From the perspective of the SQL database, it won't care if multiple people are uploading at the same time. You might however.

The simple solution (especially if this is a multi-step process) is to ensure that in your shared temp table you insert the UserID into each row. Then as you step through your processes you just make sure that the same UserID is in each row, that way users cannot trip over/ corrupt each others' data at import time.

This assumes that the CSV file names are different. If you require all people to name their file 'Import.csv' then of course you will either have a file lock issue (can't upload the second csv if the first is in use) or you will have an over-writing issue (your code doesn't check if the file is in use and just over-writes it).

I hope that helps.

|||

Or simply use session-scoped temporary tables like:

CREATE TABLE #Table ...

Of course it'll disappear as soon as you close the connection, and won't interfere with any other connections #Table. (The real name is something god aweful like #Table_________________________________AB9F3E2578A2C) where the last part is random-ish for each different connection, but you call it #Table, and it knows which one you mean.

|||Hey guys,
I realize its been quite sometime. But thanks to both of you for your answers. I have used the 2nd method because I don't have to change my table definition. But thank you for your ideas.

Monday, February 20, 2012

Multiple row updates

Hello,
I am working on a web app and am at a point where I have multiple rows in my GUI that need to be sent to and saved in SQL Server when the user presses Save. We want to pass the rows to a working table and the do a begin tran, move rows from working table to permanent tables with set processing, commit tran. The debate we are having is how to get the data to the work table. We can do individual inserts to the work table 1 round trip for each row (could be 100's of rows) or concatenate all rows into 1 long (up to 8K at a time) string and make one call sending the long string and then parse it into the work table in SQL Server. Trying to consider network usage and overhead by sending many short items vs 1 long item and cpu overhead for many inserts vs string manipulation and parsing. Suggestions?

Thanks you
JeffHow about dump to Text File then Use Stored procedure to import then move files out of the way when complete.

May even remove the need for a work table cos U will already have a log & using DTS or BCP to import is pretty fast

just a thought

GW|||Yeah I was thinking that's what I would do...

But what happens when, let's say you have 10 users trying to do this at the same time...

Your work table seems problematic

Just dump the file...and use a sproc to bcp it in...