Showing posts with label customer. Show all posts
Showing posts with label customer. Show all posts

Thursday, March 22, 2012

Calculated field in Footer...running total

Hello,

How do I add unique values on the report? For example say I have this in my report:

Customer: Food Purchased: Amount:

Judy Cat Food $12

Sarah Dog Food $13.50

Diane Rabbit Food $17

Jason Dog Food $16

Tammy Dog Food $15

In the footer of the report I want to print a summary box that looks like this:

Product: Number Purchased: Total:

Cat Food 1 $12

Dog Food 3 $44.50

Rabbit Food 1 $17

How do I do this?

Thanks!

group on the food purchased fields and do a count on the group.|||

I'm not an expert at this. It is easy to say what do to. Can you tell me how to do it?

|||

Hello,

I don't think there is a way to have a summary like that in the footer of your report. But this will add your group totals, then you can just hide the details if you need.

Right click on the row handle for your detail row and select 'Insert Group'. In the box that pops up, give the group a name (or leave the default), select the Food Purchased field as your expression and select the box for 'Include group footer'. This will create two new rows in your table, a header and footer. In one of your footers textbox's, enter this to get the count of the group:

=CountRows()

If you don't want to see the details and just want the summary, click the row handle and change the Visibility -> Hidden propery to True. This will hid your details and only show the group footers.

Hope this helps.

Jarret

|||I have one question if the data of your main report is not fit in one page then the footer will repeat on next page. Does it ok with your requirement ?|||

I am converting this report from a crystal report. So yea, in the report now it is in a Report Footer and it only appears on the last page. This is how I need it because I was told to make the SQL Report look exactly like the CR. Unfortunately it seems like SRS doesn't give you a really nice option of doing Running Total fields like in Crystal. In Crystal they created a running total field and said "count all that are Dog Food" and then another running total that said "Count all that are Cat Food." I am not sure if putting it on the group footer will work because I need the report to display as it is. And to just say =CountRows() seems like it will count all rows and return 5. But I haven't tried it.

I created another report and put all the footer stuff in a table footer. And the table footer only appeared on the last page. I would like to put all this information in the table footer not the report footer. Sorry if I didn't explain that too well.

I am very surprised that SRS doesn't have an easy way to do this.

|||

Hello,

Using =CountRows() will give you the number of rows in that scope, so if you put this in your group header/footer, it will show the number of rows in that group. If you place it in the table header/footer, you will get the total number of rows in the table.

Jarret

|||

How do I put the conditional on? Currently it is counting all rows in the database for each type of food. What if I want to say "only count the rows that are on the report" (or only records that happened in the past week)?

|||

This worked in the table footer!

=Count(iif(Trim(Fields!FoodPurch.Value)="Dog Food",Fields!FoodPurch.Value, Nothing))

Tuesday, March 20, 2012

Calculate the values from a underlying table

I am building a customerlist within the customer sales of a period. I have a dataset with two tables: "customer" and "customer_ledger_entry".

In the report I will present the customer number, the customer name and the sales. The problem is the sales value is not available as a field, but I have to calculate this value from the "customer_ledger_entry" table. In this table are several entries (invoices, credit notes, etc.)

How to calculate the values from a underlying table?

Here is a post that may work. You would populate the sales value into a dictionary object and then reference it based on the key you decide to use.

(from my blog at http://sqlrs.blogspot.com)

One common problem in reporting and BI solutions is how to incorporate data from both an OLAP cube and relational tables. The UDM in SQL 2005 attempts to solve this, however it really means you still need to build the information into your cubes and dimension attributes.

What if you don't want to or can't?

Reporting Services provides a Custom Code tab within the Report Properties page. You can access various VB.NET objects and system assemblies, and reference external assemblies. One of the internal assemblies is the Dictionary object.

Steps to lookup values from a reference table in SQL:

Drag a list onto the report.
Drag a textbox into the list, or a field from the relational dataset. Modify the textbox to contain =Code.setValue(Fields!KeyField.Value, Fields!ValueField.Value)

Create another list below. Drag another textbox into the list. Modify the textbox expression to hard-code the key for now. =Code.getValue("MyKey")

In the Code Properties window, try the following:

public dict as new System.Collections.Generics.Dictionary(Of System, System)

function setValue(value as object, value2 as object) as object
dict.Add(value,value2)
return value
end function

function getValue(value as object) as object
return dict(value)
end function

Afterwards, you can hide the list box (or table or whatever) that loads the variable with the setValue function. The dictionary still gets populated.

If you have properly bound a table to the first list control, you should be able to lookup results in the second table.

This can be applied in many scenarios, including adding relational reference data to MDX results, and creating a relationship between two separate datasets.

I'd be interested to know if anyone uses this. It seems to have many different applications. One could possibly involve showing two sets of information, for things like variances or budget vs. actual data. If a value doesn't exist in the dictionary, the original field could be returned. If it does exist, the adjustment could be returned.

Note that Generics is .NET 2.0 - for 2000 you may need to use a different syntax but the concept is the same. Basically you're using a dictionary object (could be a hash table or whatever) to store a value by a key. Then you're looking up that value in a table (or list or whatever) to do further calculations.

cheers,

Andrew

|||

Selectis,

I believe you may want to create 2 dataset for your report, the first dataset for the "customer" and the second dataset for "customer_ledger_entry". You can then calculate your values like SUM(Fields!Sales.value,"customer_ledger_entry", customer name like =(Fields!FirstName,"customer")

I hope this was what you were looking for.

Ham

|||

I've made a the two datasets like you said. My expression is:

=Sum(Fields!Sales__LCY_.Value, "customer_ledger_entry"), (Fields!Customer_No_.Value, "customer_ledger_entry") like = (Fields!No_.Value, "customer")

When I run the report I get the message "The Value expression for the textbox refers to a the field "Customer_No_". Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.

|||

Selectis,

I must have misunderstood what you were trying to accomplish, I thought you when trying to display values from 2 different tables but I didn’t realize you want to reference the 2 datasets together.

If you can do the following:

You can nest data regions within other data regions. For example, if you want to create a sales record for each sales person in a database, you can create a list with text boxes and an image to display information about the employee, and then add table and chart data regions to show the employee's sales record.

I hope this helps

Ham

|||

I′ve found a way to calculate the value: I use one dataset with two tables: "customer" and "customer_ledger_entry".

The report contains a table and I've used the SUM function for the customer sales: =SUM(Fields!Sales.Value). Now my report calculates all the sales lines from the "customer_ledger_entry". That is not what I want. But the solution is to choose "Edit Group" for the detail line in your report. In the Group settings I added a sorting on the customer and I added a "Group on" expression. Now the SUM function only calculates the records for the customer listed on the line.

Calculate sum of SQL Top 10

I have an SQL statement which returns the Top 10 states with the number of visitors

SELECT TOP 10 Customer.State States, COUNT(Customer.state) Visitors
FROM [Customer] WHERE Customer.year = '2006'
GROUP BY Customer.state
ORDER BY COUNT(Customer.state) DESC

So far this is what I have

state| visitors

MD341527.2PA215417.2NJ127510.2NY10258.2VA8136.5MA2922.3FL2562DE2431.9OH2411.9CA2381.9

But what i need is to calculate the total for the Visitors column in my SQL so that is like so

MD341527.2PA215417.2NJ127510.2NY10258.2VA8136.5MA2922.3FL2562DE2431.9OH2411.9CA2381.9Total Top 10995279.3Total for All Years12555100

I tried using the sum but I was only getting one value and not the rest...So how can i accomplish this?

Thank you

You can play with rollup and cube to get your result. Here is a sample for you to get start:

SELECT

ISNULL(state,'top10'),SUM(mycount)as top10Sum,SUM(myavg)as top10avg

FROM

tab1

GROUP

BY state

WITH

rollup

UNION

ALL

SELECT

'all states',SUM(mycount)as top10Sum,SUM(myavg)as top10avg

FROM

tab1|||

where would i place this query

SELECT TOP 10 Customer.State States, COUNT(Customer.state) Visitors
FROM [Customer] WHERE Customer.year = '2006'
GROUP BY Customer.state
ORDER BY COUNT(Customer.state) DESC

|||

Somehting like this:

SELECT

t3.state, t3.mycount1FROM(

SELECT

TOP 10 State,COUNT(*)as mycount1FROM Customer

GROUPBY state

ORDERBYCOUNT(*)DESC) t3

UNION

SELECT

'top10'as state,SUM(t1.mycount1)as mycount1FROM(

SELECT

TOP 10 State,COUNT(*)as mycount1FROM CustomerGROUPBY stateORDERBYCOUNT(*)DESC)as t1

UNION

ALL

SELECT

'ALL',COUNT(customer)as mycount1

FROM

Customer|||

this example you gave me is not working...

basically I need a way to combine the following two SQL statements to have one final result

SELECT TOP 10 Customer.State States, COUNT(Customer.state) Visitors
FROM [Customer] WHERE Customer.year = '2006'
GROUP BY Customer.state
ORDER BY COUNT(Customer.state) DESC

SELECT 'Total Top 10', SUM(t1.Visitors)
FROM
(SELECT TOP 10 Customer.State States, COUNT(Customer.state) Visitors
FROM [Customer] WHERE Customer.year = '2006'
GROUP BY Customer.state
ORDER BY COUNT(Customer.state) DESC )t1|||

declare @.result table

(

States varchar(100),

Visitors int

)

insert into @.result (States, Visitors)

SELECT TOP 10 Customer.State States, COUNT(Customer.state) Visitors
FROM [Customer] WHERE Customer.year = '2006'
GROUP BY Customer.state
ORDER BY COUNT(Customer.state) DESC

select *

from @.result

union all

select 'Total Top 10', sum(Visitors) from @.result

|||thanx you're a life saver|||

Hello,

I don't know why it is not working for you since I don't have any data from you to test.

Here is something I used to test the script.

CREATE TABLE [dbo].[tab1$]([state] [nvarchar](50), [customer] [nvarchar](50) )Sample Data:INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c1')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c2')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c3')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c4')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c5')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c6')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c7')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c8')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c9')INSERT INTO [tab1$] ([state],[customer])VALUES('a1','c10')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b1')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b2')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b3')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b4')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b5')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b6')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b7')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b8')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b9')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b10')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b11')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b12')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b13')INSERT INTO [tab1$] ([state],[customer])VALUES('a2','b14')INSERT INTO [tab1$] ([state],[customer])VALUES('a3','c1')INSERT INTO [tab1$] ([state],[customer])VALUES('a3','c2')INSERT INTO [tab1$] ([state],[customer])VALUES('a3','c3')INSERT INTO [tab1$] ([state],[customer])VALUES('a3','c4')INSERT INTO [tab1$] ([state],[customer])VALUES('a3','c5')INSERT INTO [tab1$] ([state],[customer])VALUES('a4','d1')INSERT INTO [tab1$] ([state],[customer])VALUES('a4','d2')INSERT INTO [tab1$] ([state],[customer])VALUES('a4','d3')INSERT INTO [tab1$] ([state],[customer])VALUES('a4','d4')INSERT INTO [tab1$] ([state],[customer])VALUES('a4','d5')INSERT INTO [tab1$] ([state],[customer])VALUES('a4','d6')INSERT INTO [tab1$] ([state],[customer])VALUES('a4','d7')

Here is the SQL script (I chose top 2 instead):

SELECT t3.state, t3.mycount1FROM(SELECT TOP 2 State,COUNT(*)as mycount1FROM tab1$GROUP BY stateORDER BYCOUNT(*)DESC) t3UNION SELECT'top 10'as state,SUM(t1.mycount1)as mycount1FROM (SELECT TOP 2 State,COUNT(*)as mycount1FROM tab1$GROUP BY stateORDER BYCOUNT(*)DESC)as t1UNIONALLSELECT'ALL',COUNT(customer)as mycount1FROM tab1$

|||

When i try to use this @.result table on this query I get the following error

SELECT TOP (10) t1.City City,t1.State State,SUM(t1.Population) Population , SUM(t1.Visitors) Visitors
FROM (
SELECT Customer.zip Zipcode, COUNT(Zipcode) Visitors,Census.city,Census.State,Census.Population
FROM [Customer] JOIN [Census Test Data] Census ON Customer.zip = Census.zipcode
WHERE Customer.month = '8' AND Customer.year = '2006'
GROUP BY Customer.zip, Census.city,Census.State,Census.Population
) t1
GROUP BY t1.city,t1.State
ORDER BY Visitors DESC

ERROR: The select list for the INSERT statement contains more items than the insert list. The number of SELECT values must match the number of INSERT columns.

How do i make the values match

Sunday, March 11, 2012

CAL Licensing and user limitations?

Hi to everyone, probably it's a faq but I did not find a sure answer.

A customer has a Sql Server 2000 standard installed in 1server/5CAL
licensing mode, in a windows 2000 server.
Does this type of installation limit the further connections (occourred in
same or distinct sql accounts) that exceed the 5 client/user?
And if this connections aren't limited, are these further connections
penalized by the query governor like MSDE does?

In short, is the CAL licensing mode only a legal issue without affecting or
limiting the performance of the exceeding connections?

Thanks in advance,
Pas!Pashkuale (sorry@.nomail.com) writes:
> Hi to everyone, probably it's a faq but I did not find a sure answer.
> A customer has a Sql Server 2000 standard installed in 1server/5CAL
> licensing mode, in a windows 2000 server.
> Does this type of installation limit the further connections (occourred in
> same or distinct sql accounts) that exceed the 5 client/user?
> And if this connections aren't limited, are these further connections
> penalized by the query governor like MSDE does?
> In short, is the CAL licensing mode only a legal issue without affecting
> or limiting the performance of the exceeding connections?

It's only a legal issue.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Wednesday, March 7, 2012

Cache Hit Ratio Problem

Sorry, this is a repost of a few weeks ago. The thread died without any
responses.
=====
I have a customer using SQL Server 2000 Enterprise Edition on two clustered
servers (Windows 2003 SP1) with the following spec (times two):
4 x Intel Xeon Processors @. 2.7GHz
3.5GB RAM
36GB Local Hard Drives
175GB of SAN space for Data and log files
The database is around 2.5 GB.
I have a Cache Hit Ratio that is static at 70. I've never seen a Cache Hit
Ratio this low on any other customers let alone one that doesn't change.
It doesn't fluctuate at all. It has a minimum of 70, an average of 70, and
a maximum of 70 over a 24 hour period with more than 240 user connections.
This seems strange to me. Is there a setting that caps the cache hit ratio?
I would expect it to be > 90.
Any comments or suggestions would be great.
Results of DBCC MEMORYSTATUS
Buffer Distribution Buffers
-- --
Stolen 5444
Free 936
Procedures 37946
Inram 0
Dirty 6306
Kept 0
I/O 0
Latched 700
Other 155172
Buffer Counts Buffers
-- --
Commited 206504
Target 206504
Hashed 162178
InternalReservation 1214
ExternalReservation 47
Min Free 536
Visible 206504
Procedure Cache Value
-- --
TotalProcs 10694
TotalPages 37946
InUsePages 14862
Dynamic Memory Manager Buffers
-- --
Stolen 43379
OS Reserved 976
OS Committed 954
OS In Use 948
General 4588
QueryPlan 37474
Optimizer 993
Utilities 17
Connection 995
Global Memory Objects Buffers
-- --
Resource 2398
Locks 135
XDES 73
SQLCache 1536
Replication 2
LockBytes 2
ServerGlobal 32
Query Memory Objects Value
-- --
Grants 1
Waiting 0
Available (Buffers) 139633
Maximum (Buffers) 139691
Optimization Queue Value
-- --
Optimizing 1
Waiting 0
Available 31
Maximum 32
DBCC execution completed. If DBCC printed error messages, contact your
system administrator."Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:OP2AJGYtGHA.4968@.TK2MSFTNGP03.phx.gbl...
> Sorry, this is a repost of a few weeks ago. The thread died without any
> responses.
> =====
> I have a customer using SQL Server 2000 Enterprise Edition on two
> clustered
> servers (Windows 2003 SP1) with the following spec (times two):
> 4 x Intel Xeon Processors @. 2.7GHz
> 3.5GB RAM
> 36GB Local Hard Drives
> 175GB of SAN space for Data and log files
> The database is around 2.5 GB.
> I have a Cache Hit Ratio that is static at 70. I've never seen a Cache
> Hit
> Ratio this low on any other customers let alone one that doesn't change.
> It doesn't fluctuate at all. It has a minimum of 70, an average of 70,
> and
> a maximum of 70 over a 24 hour period with more than 240 user connections.
> This seems strange to me. Is there a setting that caps the cache hit
> ratio?
> I would expect it to be > 90.
> Any comments or suggestions would be great.
> Results of DBCC MEMORYSTATUS
> Buffer Distribution Buffers
> -- --
> Stolen 5444
> Free 936
> Procedures 37946
> Inram 0
> Dirty 6306
> Kept 0
> I/O 0
> Latched 700
> Other 155172
> Buffer Counts Buffers
> -- --
> Commited 206504
> Target 206504
> Hashed 162178
> InternalReservation 1214
> ExternalReservation 47
> Min Free 536
> Visible 206504
Your total buffer pool is 206504 pages (1613MB). Of that you have 162178
pages (1267MB) of data and indexes cached, this is about half the total size
of your database. And 37946 pages (296MB) of pocedure plans cached.
So off the bat a few observations:
Apparently you're not running with the 3GB switch. This would allow the
buffer pool to grow by an extra gigabyte, approaching the total size of your
database. This should help.
Your procedure cache is large, suggesting a high volume of non-shared SQL.
This wastes memory and burns CPU compiling plans. Address this in the
application by using static. parameterized SQL instead of Ad-Hoc SQL. Run
the profiler to see all the query traffic and identify common
non-parameterized queries.
Even then, your poor cache-hit ratio suggests that you are accessing all
parts of your database all the time. Perhaps you are causing a high number
of table scans of a very large table. Run profiler to find your most
expensive queries (most Reads) and see if you can add some indexes or
otherwise tweak the physical database design to make these queries cheaper.
David|||70 seems indeed low. The non-variation *could* be explained if you are prior
to sp3. Prior to sp3,
cache hit ratio was since SQL Server was restarted. With sp3, it is average
from about 2000-3000
samples.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:OP2AJGYtGHA.4968@.TK2MSFTNGP03.phx.gbl...
> Sorry, this is a repost of a few weeks ago. The thread died without any r
esponses.
> =====
> I have a customer using SQL Server 2000 Enterprise Edition on two clustere
d
> servers (Windows 2003 SP1) with the following spec (times two):
> 4 x Intel Xeon Processors @. 2.7GHz
> 3.5GB RAM
> 36GB Local Hard Drives
> 175GB of SAN space for Data and log files
> The database is around 2.5 GB.
> I have a Cache Hit Ratio that is static at 70. I've never seen a Cache Hi
t
> Ratio this low on any other customers let alone one that doesn't change.
> It doesn't fluctuate at all. It has a minimum of 70, an average of 70, an
d
> a maximum of 70 over a 24 hour period with more than 240 user connections.
> This seems strange to me. Is there a setting that caps the cache hit rati
o?
> I would expect it to be > 90.
> Any comments or suggestions would be great.
> Results of DBCC MEMORYSTATUS
> Buffer Distribution Buffers
> -- --
> Stolen 5444
> Free 936
> Procedures 37946
> Inram 0
> Dirty 6306
> Kept 0
> I/O 0
> Latched 700
> Other 155172
> Buffer Counts Buffers
> -- --
> Commited 206504
> Target 206504
> Hashed 162178
> InternalReservation 1214
> ExternalReservation 47
> Min Free 536
> Visible 206504
> Procedure Cache Value
> -- --
> TotalProcs 10694
> TotalPages 37946
> InUsePages 14862
> Dynamic Memory Manager Buffers
> -- --
> Stolen 43379
> OS Reserved 976
> OS Committed 954
> OS In Use 948
> General 4588
> QueryPlan 37474
> Optimizer 993
> Utilities 17
> Connection 995
> Global Memory Objects Buffers
> -- --
> Resource 2398
> Locks 135
> XDES 73
> SQLCache 1536
> Replication 2
> LockBytes 2
> ServerGlobal 32
> Query Memory Objects Value
> -- --
> Grants 1
> Waiting 0
> Available (Buffers) 139633
> Maximum (Buffers) 139691
>
> Optimization Queue Value
> -- --
> Optimizing 1
> Waiting 0
> Available 31
> Maximum 32
> DBCC execution completed. If DBCC printed error messages, contact your
> system administrator.
>
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23ZvbPRZtGHA.2260@.TK2MSFTNGP03.phx.gbl...
> 70 seems indeed low. The non-variation *could* be explained if you are
> prior to sp3. Prior to sp3, cache hit ratio was since SQL Server was
> restarted. With sp3, it is average from about 2000-3000 samples.
>
I just checked the @.@.version and it seems to be correct. Here are the
results...
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1)|||>
> Your total buffer pool is 206504 pages (1613MB). Of that you have 162178
> pages (1267MB) of data and indexes cached, this is about half the total
> size of your database. And 37946 pages (296MB) of pocedure plans cached.
> So off the bat a few observations:
> Apparently you're not running with the 3GB switch. This would allow the
> buffer pool to grow by an extra gigabyte, approaching the total size of
> your database. This should help.
Thank you, that is very helpful. I will have them change it.

> Your procedure cache is large, suggesting a high volume of non-shared SQL.
> This wastes memory and burns CPU compiling plans. Address this in the
> application by using static. parameterized SQL instead of Ad-Hoc SQL. Run
> the profiler to see all the query traffic and identify common
> non-parameterized queries.
>
I assume that stored procedures would solve this problem, right? Also, how
long is a parameterized query kept before it's discarded?

> Even then, your poor cache-hit ratio suggests that you are accessing all
> parts of your database all the time. Perhaps you are causing a high
> number of table scans of a very large table. Run profiler to find your
> most expensive queries (most Reads) and see if you can add some indexes
> or otherwise tweak the physical database design to make these queries
> cheaper.
>
Again, thank you, that is very helpful.

> David
>|||"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:OPP5hBatGHA.3264@.TK2MSFTNGP03.phx.gbl...
> Thank you, that is very helpful. I will have them change it.
>
> I assume that stored procedures would solve this problem, right?
Usually, yes, unless the procedure used dynamic SQL.

>Also, how long is a parameterized query kept before it's discarded?
Until it's forced out by other plans, so you can keep a lot of plans cached
that never get reused.
David|||"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:%23QiTVXatGHA.3552@.TK2MSFTNGP03.phx.gbl...
> Usually, yes, unless the procedure used dynamic SQL.
>
Thanks.

> Until it's forced out by other plans, so you can keep a lot of plans
> cached that never get reused.
> David
>
Thanks.|||> I just checked the @.@.version and it seems to be correct. Here are the resu
lts...
Nope. That service pack number returned by @.@.version is the OS service pack.
Your build number say
that you are on SQL Server service pack 4.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:%23zXOU8ZtGHA.3240@.TK2MSFTNGP03.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:%23ZvbPRZtGHA.2260@.TK2MSFTNGP03.phx.gbl...
> I just checked the @.@.version and it seems to be correct. Here are the resu
lts...
> Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
> May 3 2005 23:18:38
> Copyright (c) 1988-2003 Microsoft Corporation
> Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O2cQGeltGHA.3964@.TK2MSFTNGP04.phx.gbl...
> Nope. That service pack number returned by @.@.version is the OS service
> pack. Your build number say that you are on SQL Server service pack 4.
>
So can I assume that the Cache Hit Ratio fix is included in SP4 if it was
fixed in SP3?|||Yep. Note that the fix is only how the value is calculated...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:eEtTokxtGHA.5076@.TK2MSFTNGP04.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:O2cQGeltGHA.3964@.TK2MSFTNGP04.phx.gbl...
> So can I assume that the Cache Hit Ratio fix is included in SP4 if it was
fixed in SP3?
>

Cache Hit Ratio Problem

Sorry, this is a repost of a few weeks ago. The thread died without any
responses.
=====
I have a customer using SQL Server 2000 Enterprise Edition on two clustered
servers (Windows 2003 SP1) with the following spec (times two):
4 x Intel Xeon Processors @. 2.7GHz
3.5GB RAM
36GB Local Hard Drives
175GB of SAN space for Data and log files
The database is around 2.5 GB.
I have a Cache Hit Ratio that is static at 70. I've never seen a Cache Hit
Ratio this low on any other customers let alone one that doesn't change.
It doesn't fluctuate at all. It has a minimum of 70, an average of 70, and
a maximum of 70 over a 24 hour period with more than 240 user connections.
This seems strange to me. Is there a setting that caps the cache hit ratio?
I would expect it to be > 90.
Any comments or suggestions would be great.
Results of DBCC MEMORYSTATUS
Buffer Distribution Buffers
-- --
Stolen 5444
Free 936
Procedures 37946
Inram 0
Dirty 6306
Kept 0
I/O 0
Latched 700
Other 155172
Buffer Counts Buffers
-- --
Commited 206504
Target 206504
Hashed 162178
InternalReservation 1214
ExternalReservation 47
Min Free 536
Visible 206504
Procedure Cache Value
-- --
TotalProcs 10694
TotalPages 37946
InUsePages 14862
Dynamic Memory Manager Buffers
-- --
Stolen 43379
OS Reserved 976
OS Committed 954
OS In Use 948
General 4588
QueryPlan 37474
Optimizer 993
Utilities 17
Connection 995
Global Memory Objects Buffers
-- --
Resource 2398
Locks 135
XDES 73
SQLCache 1536
Replication 2
LockBytes 2
ServerGlobal 32
Query Memory Objects Value
-- --
Grants 1
Waiting 0
Available (Buffers) 139633
Maximum (Buffers) 139691
Optimization Queue Value
-- --
Optimizing 1
Waiting 0
Available 31
Maximum 32
DBCC execution completed. If DBCC printed error messages, contact your
system administrator."Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:OP2AJGYtGHA.4968@.TK2MSFTNGP03.phx.gbl...
> Sorry, this is a repost of a few weeks ago. The thread died without any
> responses.
> =====> I have a customer using SQL Server 2000 Enterprise Edition on two
> clustered
> servers (Windows 2003 SP1) with the following spec (times two):
> 4 x Intel Xeon Processors @. 2.7GHz
> 3.5GB RAM
> 36GB Local Hard Drives
> 175GB of SAN space for Data and log files
> The database is around 2.5 GB.
> I have a Cache Hit Ratio that is static at 70. I've never seen a Cache
> Hit
> Ratio this low on any other customers let alone one that doesn't change.
> It doesn't fluctuate at all. It has a minimum of 70, an average of 70,
> and
> a maximum of 70 over a 24 hour period with more than 240 user connections.
> This seems strange to me. Is there a setting that caps the cache hit
> ratio?
> I would expect it to be > 90.
> Any comments or suggestions would be great.
> Results of DBCC MEMORYSTATUS
> Buffer Distribution Buffers
> -- --
> Stolen 5444
> Free 936
> Procedures 37946
> Inram 0
> Dirty 6306
> Kept 0
> I/O 0
> Latched 700
> Other 155172
> Buffer Counts Buffers
> -- --
> Commited 206504
> Target 206504
> Hashed 162178
> InternalReservation 1214
> ExternalReservation 47
> Min Free 536
> Visible 206504
Your total buffer pool is 206504 pages (1613MB). Of that you have 162178
pages (1267MB) of data and indexes cached, this is about half the total size
of your database. And 37946 pages (296MB) of pocedure plans cached.
So off the bat a few observations:
Apparently you're not running with the 3GB switch. This would allow the
buffer pool to grow by an extra gigabyte, approaching the total size of your
database. This should help.
Your procedure cache is large, suggesting a high volume of non-shared SQL.
This wastes memory and burns CPU compiling plans. Address this in the
application by using static. parameterized SQL instead of Ad-Hoc SQL. Run
the profiler to see all the query traffic and identify common
non-parameterized queries.
Even then, your poor cache-hit ratio suggests that you are accessing all
parts of your database all the time. Perhaps you are causing a high number
of table scans of a very large table. Run profiler to find your most
expensive queries (most Reads) and see if you can add some indexes or
otherwise tweak the physical database design to make these queries cheaper.
David|||70 seems indeed low. The non-variation *could* be explained if you are prior to sp3. Prior to sp3,
cache hit ratio was since SQL Server was restarted. With sp3, it is average from about 2000-3000
samples.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:OP2AJGYtGHA.4968@.TK2MSFTNGP03.phx.gbl...
> Sorry, this is a repost of a few weeks ago. The thread died without any responses.
> =====> I have a customer using SQL Server 2000 Enterprise Edition on two clustered
> servers (Windows 2003 SP1) with the following spec (times two):
> 4 x Intel Xeon Processors @. 2.7GHz
> 3.5GB RAM
> 36GB Local Hard Drives
> 175GB of SAN space for Data and log files
> The database is around 2.5 GB.
> I have a Cache Hit Ratio that is static at 70. I've never seen a Cache Hit
> Ratio this low on any other customers let alone one that doesn't change.
> It doesn't fluctuate at all. It has a minimum of 70, an average of 70, and
> a maximum of 70 over a 24 hour period with more than 240 user connections.
> This seems strange to me. Is there a setting that caps the cache hit ratio?
> I would expect it to be > 90.
> Any comments or suggestions would be great.
> Results of DBCC MEMORYSTATUS
> Buffer Distribution Buffers
> -- --
> Stolen 5444
> Free 936
> Procedures 37946
> Inram 0
> Dirty 6306
> Kept 0
> I/O 0
> Latched 700
> Other 155172
> Buffer Counts Buffers
> -- --
> Commited 206504
> Target 206504
> Hashed 162178
> InternalReservation 1214
> ExternalReservation 47
> Min Free 536
> Visible 206504
> Procedure Cache Value
> -- --
> TotalProcs 10694
> TotalPages 37946
> InUsePages 14862
> Dynamic Memory Manager Buffers
> -- --
> Stolen 43379
> OS Reserved 976
> OS Committed 954
> OS In Use 948
> General 4588
> QueryPlan 37474
> Optimizer 993
> Utilities 17
> Connection 995
> Global Memory Objects Buffers
> -- --
> Resource 2398
> Locks 135
> XDES 73
> SQLCache 1536
> Replication 2
> LockBytes 2
> ServerGlobal 32
> Query Memory Objects Value
> -- --
> Grants 1
> Waiting 0
> Available (Buffers) 139633
> Maximum (Buffers) 139691
>
> Optimization Queue Value
> -- --
> Optimizing 1
> Waiting 0
> Available 31
> Maximum 32
> DBCC execution completed. If DBCC printed error messages, contact your
> system administrator.
>
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23ZvbPRZtGHA.2260@.TK2MSFTNGP03.phx.gbl...
> 70 seems indeed low. The non-variation *could* be explained if you are
> prior to sp3. Prior to sp3, cache hit ratio was since SQL Server was
> restarted. With sp3, it is average from about 2000-3000 samples.
>
I just checked the @.@.version and it seems to be correct. Here are the
results...
Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
May 3 2005 23:18:38
Copyright (c) 1988-2003 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1)|||>
> Your total buffer pool is 206504 pages (1613MB). Of that you have 162178
> pages (1267MB) of data and indexes cached, this is about half the total
> size of your database. And 37946 pages (296MB) of pocedure plans cached.
> So off the bat a few observations:
> Apparently you're not running with the 3GB switch. This would allow the
> buffer pool to grow by an extra gigabyte, approaching the total size of
> your database. This should help.
Thank you, that is very helpful. I will have them change it.
> Your procedure cache is large, suggesting a high volume of non-shared SQL.
> This wastes memory and burns CPU compiling plans. Address this in the
> application by using static. parameterized SQL instead of Ad-Hoc SQL. Run
> the profiler to see all the query traffic and identify common
> non-parameterized queries.
>
I assume that stored procedures would solve this problem, right? Also, how
long is a parameterized query kept before it's discarded?
> Even then, your poor cache-hit ratio suggests that you are accessing all
> parts of your database all the time. Perhaps you are causing a high
> number of table scans of a very large table. Run profiler to find your
> most expensive queries (most Reads) and see if you can add some indexes
> or otherwise tweak the physical database design to make these queries
> cheaper.
>
Again, thank you, that is very helpful.
> David
>|||"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:OPP5hBatGHA.3264@.TK2MSFTNGP03.phx.gbl...
> >
>> Your total buffer pool is 206504 pages (1613MB). Of that you have 162178
>> pages (1267MB) of data and indexes cached, this is about half the total
>> size of your database. And 37946 pages (296MB) of pocedure plans cached.
>> So off the bat a few observations:
>> Apparently you're not running with the 3GB switch. This would allow the
>> buffer pool to grow by an extra gigabyte, approaching the total size of
>> your database. This should help.
> Thank you, that is very helpful. I will have them change it.
>> Your procedure cache is large, suggesting a high volume of non-shared
>> SQL. This wastes memory and burns CPU compiling plans. Address this in
>> the application by using static. parameterized SQL instead of Ad-Hoc SQL.
>> Run the profiler to see all the query traffic and identify common
>> non-parameterized queries.
> I assume that stored procedures would solve this problem, right?
Usually, yes, unless the procedure used dynamic SQL.
>Also, how long is a parameterized query kept before it's discarded?
Until it's forced out by other plans, so you can keep a lot of plans cached
that never get reused.
David|||"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:%23QiTVXatGHA.3552@.TK2MSFTNGP03.phx.gbl...
>> I assume that stored procedures would solve this problem, right?
> Usually, yes, unless the procedure used dynamic SQL.
>
Thanks.
>>Also, how long is a parameterized query kept before it's discarded?
> Until it's forced out by other plans, so you can keep a lot of plans
> cached that never get reused.
> David
>
Thanks.|||> I just checked the @.@.version and it seems to be correct. Here are the results...
Nope. That service pack number returned by @.@.version is the OS service pack. Your build number say
that you are on SQL Server service pack 4.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:%23zXOU8ZtGHA.3240@.TK2MSFTNGP03.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%23ZvbPRZtGHA.2260@.TK2MSFTNGP03.phx.gbl...
>> 70 seems indeed low. The non-variation *could* be explained if you are prior to sp3. Prior to
>> sp3, cache hit ratio was since SQL Server was restarted. With sp3, it is average from about
>> 2000-3000 samples.
> I just checked the @.@.version and it seems to be correct. Here are the results...
> Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
> May 3 2005 23:18:38
> Copyright (c) 1988-2003 Microsoft Corporation
> Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O2cQGeltGHA.3964@.TK2MSFTNGP04.phx.gbl...
>> I just checked the @.@.version and it seems to be correct. Here are the
>> results...
> Nope. That service pack number returned by @.@.version is the OS service
> pack. Your build number say that you are on SQL Server service pack 4.
>
So can I assume that the Cache Hit Ratio fix is included in SP4 if it was
fixed in SP3?|||Yep. Note that the fix is only how the value is calculated...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:eEtTokxtGHA.5076@.TK2MSFTNGP04.phx.gbl...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:O2cQGeltGHA.3964@.TK2MSFTNGP04.phx.gbl...
>> I just checked the @.@.version and it seems to be correct. Here are the results...
>> Nope. That service pack number returned by @.@.version is the OS service pack. Your build number
>> say that you are on SQL Server service pack 4.
> So can I assume that the Cache Hit Ratio fix is included in SP4 if it was fixed in SP3?
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:um12pK0tGHA.3552@.TK2MSFTNGP03.phx.gbl...
> Yep. Note that the fix is only how the value is calculated...
>
Thanks

Cache Hit Ratio Issue

I have a customer using SQL Server 2000 Enterprise Edition on two clustered
servers (Windows 2003 SP1) with the following spec (times two):
4 x Intel Xeon Processors @. 2.7GHz
3.5GB RAM
36GB Local Hard Drives
175GB of SAN space for Data and log files
The database is around 2.5 GB.
I have a Cache Hit Ratio that is static at 70. I've never seen a Cache Hit
Ratio this low on any other customers let alone one that doesn't change.
It doesn't fluctuate at all. It has a minimum of 70, an average of 70, and
a maximum of 70 over a 24 hour period with more than 240 user connections.
This seems strange to me. Is there a setting that caps the cache hit ratio?
I would expect it to be > 90.
Any comments or suggestions would be great.Can you run this command and post it back here
DBCC MEMORYSTATUS
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:u9F8XcqqGHA.2068@.TK2MSFTNGP03.phx.gbl...
>I have a customer using SQL Server 2000 Enterprise Edition on two clustered
> servers (Windows 2003 SP1) with the following spec (times two):
> 4 x Intel Xeon Processors @. 2.7GHz
> 3.5GB RAM
> 36GB Local Hard Drives
> 175GB of SAN space for Data and log files
> The database is around 2.5 GB.
> I have a Cache Hit Ratio that is static at 70. I've never seen a Cache
> Hit
> Ratio this low on any other customers let alone one that doesn't change.
> It doesn't fluctuate at all. It has a minimum of 70, an average of 70,
> and
> a maximum of 70 over a 24 hour period with more than 240 user connections.
> This seems strange to me. Is there a setting that caps the cache hit
> ratio?
> I would expect it to be > 90.
> Any comments or suggestions would be great.
>|||"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uv0XKFsqGHA.928@.TK2MSFTNGP04.phx.gbl...
> Can you run this command and post it back here
> DBCC MEMORYSTATUS
> --
As requested...
Buffer Distribution Buffers
-- --
Stolen 5444
Free 936
Procedures 37946
Inram 0
Dirty 6306
Kept 0
I/O 0
Latched 700
Other 155172
Buffer Counts Buffers
-- --
Commited 206504
Target 206504
Hashed 162178
InternalReservation 1214
ExternalReservation 47
Min Free 536
Visible 206504
Procedure Cache Value
-- --
TotalProcs 10694
TotalPages 37946
InUsePages 14862
Dynamic Memory Manager Buffers
-- --
Stolen 43379
OS Reserved 976
OS Committed 954
OS In Use 948
General 4588
QueryPlan 37474
Optimizer 993
Utilities 17
Connection 995
Global Memory Objects Buffers
-- --
Resource 2398
Locks 135
XDES 73
SQLCache 1536
Replication 2
LockBytes 2
ServerGlobal 32
Query Memory Objects Value
-- --
Grants 1
Waiting 0
Available (Buffers) 139633
Maximum (Buffers) 139691
Optimization Queue Value
-- --
Optimizing 1
Waiting 0
Available 31
Maximum 32
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
Thank you for your help so far.

Cache Hit Ratio Issue

I have a customer using SQL Server 2000 Enterprise Edition on two clustered
servers (Windows 2003 SP1) with the following spec (times two):
4 x Intel Xeon Processors @. 2.7GHz
3.5GB RAM
36GB Local Hard Drives
175GB of SAN space for Data and log files
The database is around 2.5 GB.
I have a Cache Hit Ratio that is static at 70. I've never seen a Cache Hit
Ratio this low on any other customers let alone one that doesn't change.
It doesn't fluctuate at all. It has a minimum of 70, an average of 70, and
a maximum of 70 over a 24 hour period with more than 240 user connections.
This seems strange to me. Is there a setting that caps the cache hit ratio?
I would expect it to be > 90.
Any comments or suggestions would be great.Can you run this command and post it back here
DBCC MEMORYSTATUS
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"Isaac Alexander" <isaacNOSPAM@.goNOSPAMprocura.com> wrote in message
news:u9F8XcqqGHA.2068@.TK2MSFTNGP03.phx.gbl...
>I have a customer using SQL Server 2000 Enterprise Edition on two clustered
> servers (Windows 2003 SP1) with the following spec (times two):
> 4 x Intel Xeon Processors @. 2.7GHz
> 3.5GB RAM
> 36GB Local Hard Drives
> 175GB of SAN space for Data and log files
> The database is around 2.5 GB.
> I have a Cache Hit Ratio that is static at 70. I've never seen a Cache
> Hit
> Ratio this low on any other customers let alone one that doesn't change.
> It doesn't fluctuate at all. It has a minimum of 70, an average of 70,
> and
> a maximum of 70 over a 24 hour period with more than 240 user connections.
> This seems strange to me. Is there a setting that caps the cache hit
> ratio?
> I would expect it to be > 90.
> Any comments or suggestions would be great.
>|||"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uv0XKFsqGHA.928@.TK2MSFTNGP04.phx.gbl...
> Can you run this command and post it back here
> DBCC MEMORYSTATUS
> --
As requested...
Buffer Distribution Buffers
-- --
Stolen 5444
Free 936
Procedures 37946
Inram 0
Dirty 6306
Kept 0
I/O 0
Latched 700
Other 155172
Buffer Counts Buffers
-- --
Commited 206504
Target 206504
Hashed 162178
InternalReservation 1214
ExternalReservation 47
Min Free 536
Visible 206504
Procedure Cache Value
-- --
TotalProcs 10694
TotalPages 37946
InUsePages 14862
Dynamic Memory Manager Buffers
-- --
Stolen 43379
OS Reserved 976
OS Committed 954
OS In Use 948
General 4588
QueryPlan 37474
Optimizer 993
Utilities 17
Connection 995
Global Memory Objects Buffers
-- --
Resource 2398
Locks 135
XDES 73
SQLCache 1536
Replication 2
LockBytes 2
ServerGlobal 32
Query Memory Objects Value
-- --
Grants 1
Waiting 0
Available (Buffers) 139633
Maximum (Buffers) 139691
Optimization Queue Value
-- --
Optimizing 1
Waiting 0
Available 31
Maximum 32
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
Thank you for your help so far.

Saturday, February 25, 2012

C/S and T/S using same DB simultaneously

I have a VB6 application that runs in both a client server or a terminal
services environment. Normally a customer uses one or the other. Is it
possible for a customer to install and run both of these at the same time
meaning they have the C/S connected to some users and the T/S connecting
other users but they both access one SQL server database? I had not
considered this situation before.
BruceL
Bruce,
I don't know why not. Whether the client code runs C/S or T/S is moot to
the SQL Server, since it knows very little about the client. It talks via
the communication protocols and grants rights to 'you', whoever you are.
The main issue is probably: Who are you in each of these environments? Are
you in the same security context, or not? But, however you are managing
access to the SQL Server will control who can log in and what rights are
granted.
RLF
"BruceL" <BruceL@.discussions.microsoft.com> wrote in message
news:268FAFAE-6729-4227-A95E-D60A02AEB119@.microsoft.com...
>I have a VB6 application that runs in both a client server or a terminal
> services environment. Normally a customer uses one or the other. Is it
> possible for a customer to install and run both of these at the same time
> meaning they have the C/S connected to some users and the T/S connecting
> other users but they both access one SQL server database? I had not
> considered this situation before.
> --
> BruceL
|||Thanks for the answer Russell
BruceL
"Russell Fields" wrote:

> Bruce,
> I don't know why not. Whether the client code runs C/S or T/S is moot to
> the SQL Server, since it knows very little about the client. It talks via
> the communication protocols and grants rights to 'you', whoever you are.
> The main issue is probably: Who are you in each of these environments? Are
> you in the same security context, or not? But, however you are managing
> access to the SQL Server will control who can log in and what rights are
> granted.
> RLF
> "BruceL" <BruceL@.discussions.microsoft.com> wrote in message
> news:268FAFAE-6729-4227-A95E-D60A02AEB119@.microsoft.com...
>
>

C/S and T/S using same DB simultaneously

I have a VB6 application that runs in both a client server or a terminal
services environment. Normally a customer uses one or the other. Is it
possible for a customer to install and run both of these at the same time
meaning they have the C/S connected to some users and the T/S connecting
other users but they both access one SQL server database? I had not
considered this situation before.
--
BruceLBruce,
I don't know why not. Whether the client code runs C/S or T/S is moot to
the SQL Server, since it knows very little about the client. It talks via
the communication protocols and grants rights to 'you', whoever you are.
The main issue is probably: Who are you in each of these environments? Are
you in the same security context, or not? But, however you are managing
access to the SQL Server will control who can log in and what rights are
granted.
RLF
"BruceL" <BruceL@.discussions.microsoft.com> wrote in message
news:268FAFAE-6729-4227-A95E-D60A02AEB119@.microsoft.com...
>I have a VB6 application that runs in both a client server or a terminal
> services environment. Normally a customer uses one or the other. Is it
> possible for a customer to install and run both of these at the same time
> meaning they have the C/S connected to some users and the T/S connecting
> other users but they both access one SQL server database? I had not
> considered this situation before.
> --
> BruceL|||Thanks for the answer Russell
--
BruceL
"Russell Fields" wrote:
> Bruce,
> I don't know why not. Whether the client code runs C/S or T/S is moot to
> the SQL Server, since it knows very little about the client. It talks via
> the communication protocols and grants rights to 'you', whoever you are.
> The main issue is probably: Who are you in each of these environments? Are
> you in the same security context, or not? But, however you are managing
> access to the SQL Server will control who can log in and what rights are
> granted.
> RLF
> "BruceL" <BruceL@.discussions.microsoft.com> wrote in message
> news:268FAFAE-6729-4227-A95E-D60A02AEB119@.microsoft.com...
> >I have a VB6 application that runs in both a client server or a terminal
> > services environment. Normally a customer uses one or the other. Is it
> > possible for a customer to install and run both of these at the same time
> > meaning they have the C/S connected to some users and the T/S connecting
> > other users but they both access one SQL server database? I had not
> > considered this situation before.
> > --
> > BruceL
>
>

Friday, February 24, 2012

C# Command Timestamp Input Parameter

I have a stored proc that inserts a customer and it expects a timestamp input parameter. I dont know what a timestamp datatype is for sql 2005 and Ive tried to parse all sorts of data types but the proc errors out saying it needs "Byte[]" which Ive tried. Can anyone help me with this? Thanks

Ryan

Have you tried the plain DateTime data type?|||

Hi Ryan,

The timestamp in SQL Server maps to a Byte[] type in .NET framework. It is not used as DateTime. It is a data type that exposes automatically generated, unique binary numbers within a database. timestamp is generally used as a mechanism for version-stamping table rows.

If you just need to store date/time information, try to use datetime data type, it maps to a DateTime object in .NET framework.

Please check the following link for more information:

http://msdn2.microsoft.com/en-us/library/ms182776.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconmappingnetdataproviderdatatypestonetframeworkdatatypes.asp

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Thursday, February 16, 2012

Bypassing recovery for database

MS SQL-Server 7.0
Bypassing recovery for database 'EfW_765' because it is marked IN LOAD.
What does this mean?
Our customer is backing up is maindatabase and is recovering it to this
database for testing.
Our custumer tries it serveral times and then the recovery works and the
data are corrupt.
I have written a little programm which does some selects to this database.
The program is stopped during recovery but our customer beleves that this
has something to do with our program.
http://support.microsoft.com/defaul...kb;en-us;272683
This article doesnt halp me much. So hwat is the meaning of IN LOAD and what
does the server do if it bypasses the recovery.

THX

Jens"Jens Kalkbrenner" <jens.kalkbrenner@.wsk.de> wrote in message
news:c5gccs$73a$01$1@.news.t-online.com...
> MS SQL-Server 7.0
> Bypassing recovery for database 'EfW_765' because it is marked IN LOAD.
> What does this mean?
> Our customer is backing up is maindatabase and is recovering it to this
> database for testing.
> Our custumer tries it serveral times and then the recovery works and the
> data are corrupt.
> I have written a little programm which does some selects to this database.
> The program is stopped during recovery but our customer beleves that this
> has something to do with our program.
> http://support.microsoft.com/defaul...kb;en-us;272683
> This article doesnt halp me much. So hwat is the meaning of IN LOAD and
what
> does the server do if it bypasses the recovery.
> THX
> Jens

I'm not entirely sure, but it sounds as if the database has been partially
recovered, and then the MSSQLServer service has been restarted. This might
be normal, if someone is recovering the database by applying mutiple log
files, for example. Have you tried this, to restore the database and make it
available?

RESTORE DATABASE EfW_765 FROM ... WITH RECOVERY

If this doesn't help, can you give some more details about exactly what is
happening? Is the recovery from a full backup only or from a full backup
plus logfiles? What do you mean when you say the data is "corrupt"? Are you
sure you're recovering the correct backup set? Is the customer trying to
copy database A to database B using backup/restore? If so, have you followed
the steps in Books Online under "Copying Databases"?

Simon|||"Jens Kalkbrenner" <jens.kalkbrenner@.wsk.de> wrote in message
news:c5gccs$73a$01$1@.news.t-online.com...
> MS SQL-Server 7.0
> Bypassing recovery for database 'EfW_765' because it is marked IN LOAD.
> What does this mean?
> Our customer is backing up is maindatabase and is recovering it to this
> database for testing.
> Our custumer tries it serveral times and then the recovery works and the
> data are corrupt.
> I have written a little programm which does some selects to this database.
> The program is stopped during recovery but our customer beleves that this
> has something to do with our program.
> http://support.microsoft.com/defaul...kb;en-us;272683
> This article doesnt halp me much. So hwat is the meaning of IN LOAD and
what
> does the server do if it bypasses the recovery.
> THX
> Jens

I'm not entirely sure, but it sounds as if the database has been partially
recovered, and then the MSSQLServer service has been restarted. This might
be normal, if someone is recovering the database by applying mutiple log
files, for example. Have you tried this, to restore the database and make it
available?

RESTORE DATABASE EfW_765 FROM ... WITH RECOVERY

If this doesn't help, can you give some more details about exactly what is
happening? Is the recovery from a full backup only or from a full backup
plus logfiles? What do you mean when you say the data is "corrupt"? Are you
sure you're recovering the correct backup set? Is the customer trying to
copy database A to database B using backup/restore? If so, have you followed
the steps in Books Online under "Copying Databases"?

Simon

Friday, February 10, 2012

BulkCopy failes for Dist Agent

Hello,
I'm getting an error message when running Dist
agen "Cannot bulkcopy into Customer". I have checked the
database settings on both Publisher and Subsrciber for
selectInto/BulkCopy option. Cannot seem to find the
problem. Any help would be appreciated.
-R
Rogers,
in current activity, please can you check to see if the subscriber table is locked.
Regards,
Paul Ibison
|||Paul,
Thanks for your reply. I checked the locks and it doesn't
appear that the table is locked. I looked on both
publisher and subscriber. If you think of anything else,
let me know.
Thanks!

>--Original Message--
>Rogers,
>in current activity, please can you check to see if the
subscriber table is locked.
>Regards,
>Paul Ibison
>.
>
|||You could enable logging to try to get some more info
(http://support.microsoft.com/?id=312292).
Also, you might try doing a bulk insert manually from QA on the subscriber,
just to see if the (same?) error message is reproduced there.
Regards,
Paul Ibison