Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Sunday, March 25, 2012

Case Sensitive Flag

I have a customer with MS-SQL7 they have to have the case sensitive flag on
for a database they purchased some time ago. Can I attach a database to the
same SQL server and some how remove the case sensitive flag for just this DB
?Not possible - this is set at the server level and affects all databases.
"Dan C" <anonymous@.discussions.microsoft.com> wrote in message
news:8D10190E-A01E-4950-B2AE-F62BCBD2C6A9@.microsoft.com...
quote:

> I have a customer with MS-SQL7 they have to have the case sensitive flag

on for a database they purchased some time ago. Can I attach a database to
the same SQL server and some how remove the case sensitive flag for just
this DB?|||Hi Dan,
You (or your customer) is out of luck there. The collation (which includes
among other things the setting for case sensitivity) is a server wide
setting on SQL Server 7. You either need a separate server for that
database, or you need to upgrade to SQL Server 2000, or you can install a
named instance of SQL Server 2000 (with the appropriate collation) on the
same machine as SQL Server 7 is running on.
Jacco Schalkwijk
SQL Server MVP
"Dan C" <anonymous@.discussions.microsoft.com> wrote in message
news:8D10190E-A01E-4950-B2AE-F62BCBD2C6A9@.microsoft.com...
quote:

> I have a customer with MS-SQL7 they have to have the case sensitive flag

on for a database they purchased some time ago. Can I attach a database to
the same SQL server and some how remove the case sensitive flag for just
this DB?

Case Sensitive Flag

I have a customer with MS-SQL7 they have to have the case sensitive flag on for a database they purchased some time ago. Can I attach a database to the same SQL server and some how remove the case sensitive flag for just this DB?Not possible - this is set at the server level and affects all databases.
"Dan C" <anonymous@.discussions.microsoft.com> wrote in message
news:8D10190E-A01E-4950-B2AE-F62BCBD2C6A9@.microsoft.com...
> I have a customer with MS-SQL7 they have to have the case sensitive flag
on for a database they purchased some time ago. Can I attach a database to
the same SQL server and some how remove the case sensitive flag for just
this DB?|||Hi Dan,
You (or your customer) is out of luck there. The collation (which includes
among other things the setting for case sensitivity) is a server wide
setting on SQL Server 7. You either need a separate server for that
database, or you need to upgrade to SQL Server 2000, or you can install a
named instance of SQL Server 2000 (with the appropriate collation) on the
same machine as SQL Server 7 is running on.
--
Jacco Schalkwijk
SQL Server MVP
"Dan C" <anonymous@.discussions.microsoft.com> wrote in message
news:8D10190E-A01E-4950-B2AE-F62BCBD2C6A9@.microsoft.com...
> I have a customer with MS-SQL7 they have to have the case sensitive flag
on for a database they purchased some time ago. Can I attach a database to
the same SQL server and some how remove the case sensitive flag for just
this DB?sql

Thursday, March 22, 2012

CASE returning different data types

Hi, folks...
I was trying to write a sql query which returns different data types, but it
returns every time, a smalldatetime format...
SELECT CASE WHEN Tipo = 'N' THEN Numerico
WHEN Tipo = 'L' THEN Logico
WHEN Tipo = 'P' THEN Percentual
WHEN Tipo = 'D' THEN Data
ELSE NULL
END as ValorParametro
FROM ParametrosEmissores
WHERE Codigo = 'TRUNCANOME'
'Numerico' is an integer field
'L' is a bit field
'P' is a float field
'D' is a smalldatetime field.
Whatever is the datatype returning, the result is a smalldatetime field...
Any help would be apreciated.
Daniela.CASE is an expression -- and by definition every path of an expression must
return the same datatype (think of a function in a procedural language --
any function you define can only have a single return datatype). You might
consider, in this case, casting all return values to a string datatype.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Daniela Binatti" <Daniela Binatti@.discussions.microsoft.com> wrote in
message news:39E5A440-51BB-4DAF-A73B-8BDFD9E136F7@.microsoft.com...
> Hi, folks...
> I was trying to write a sql query which returns different data types, but
it
> returns every time, a smalldatetime format...
> SELECT CASE WHEN Tipo = 'N' THEN Numerico
> WHEN Tipo = 'L' THEN Logico
> WHEN Tipo = 'P' THEN Percentual
> WHEN Tipo = 'D' THEN Data
> ELSE NULL
> END as ValorParametro
> FROM ParametrosEmissores
> WHERE Codigo = 'TRUNCANOME'
> 'Numerico' is an integer field
> 'L' is a bit field
> 'P' is a float field
> 'D' is a smalldatetime field.
> Whatever is the datatype returning, the result is a smalldatetime field...
> Any help would be apreciated.
> Daniela.
>|||No, can't do that.. ALL Possible data values that could come out of a case
must be the same datatype. That's because the datatype is not associated
with the data item itself, but with the COLUMN of the resulting Resultset.
SQL has t oassigna a datatypes to the Column...
But not all s lost... You simply have t oCAST The data in each primitive
Table colum,n to the same datatype in the case statement
SELECT CASE WHEN Tipo = 'N' THEN Cast(Numerico As VarChar(20))
WHEN Tipo = 'L' And Logico = 1 THEN 'True'
WHEN Tipo = 'L' And Logico = 0 THEN 'False'
WHEN Tipo = 'P' THEN Cast(Percentual As VarChar(20))
WHEN Tipo = 'D' THEN Convert(VarChar(20), Data, 112)
ELSE NULL
END as ValorParametro
FROM ParametrosEmissores
WHERE Codigo = 'TRUNCANOME'
"Daniela Binatti" wrote:

> Hi, folks...
> I was trying to write a sql query which returns different data types, but
it
> returns every time, a smalldatetime format...
> SELECT CASE WHEN Tipo = 'N' THEN Numerico
> WHEN Tipo = 'L' THEN Logico
> WHEN Tipo = 'P' THEN Percentual
> WHEN Tipo = 'D' THEN Data
> ELSE NULL
> END as ValorParametro
> FROM ParametrosEmissores
> WHERE Codigo = 'TRUNCANOME'
> 'Numerico' is an integer field
> 'L' is a bit field
> 'P' is a float field
> 'D' is a smalldatetime field.
> Whatever is the datatype returning, the result is a smalldatetime field...
> Any help would be apreciated.
> Daniela.
>|||If they are different types then how do you want to display them in a
single column? Maybe we could help you better if you explain more about
what you are trying to do.
David Portas
SQL Server MVP
--|||Thank you very much. I've sorted out the problem by converting every result
in a sql_variant field.
"Daniela Binatti" wrote:

> Hi, folks...
> I was trying to write a sql query which returns different data types, but
it
> returns every time, a smalldatetime format...
> SELECT CASE WHEN Tipo = 'N' THEN Numerico
> WHEN Tipo = 'L' THEN Logico
> WHEN Tipo = 'P' THEN Percentual
> WHEN Tipo = 'D' THEN Data
> ELSE NULL
> END as ValorParametro
> FROM ParametrosEmissores
> WHERE Codigo = 'TRUNCANOME'
> 'Numerico' is an integer field
> 'L' is a bit field
> 'P' is a float field
> 'D' is a smalldatetime field.
> Whatever is the datatype returning, the result is a smalldatetime field...
> Any help would be apreciated.
> Daniela.
>

Case Insensitivity is on server wide: tables render case sensative...

Hello:

I have created an SQL server table in the past on a server that was all case sensative. Over time I found out that switching to a server that is not case sensative still caused my data to become case sensative. I read an article that said you should rebuild your master database then re-create your tables. So after rebuilding the master database, a basic restore would not be sufficient? I would have to go and manually re-create every single table again?

Any suggestions?Have a look at "Using SQL Collations" in SQL Server Books Online|||Hello:

I went ahead and took a look inside books online and pretty much found things that I already know. My current collation is: SQL_Latin1_General_CP1_CI_AI.. So the server is actually CaSe insensative... But some of my tables still act like case sensitivity is turned on in most areas where I have not done anything on my part to cause this behavior. So I am guessing that since the tables were moved from a CS_AS to a CI_AI, the tables caused were rendered case sensative although it is not in a CS_AS enviornment... My question is that would I need to rebuild the database manually from scratch or is their an easier way to do this? Thank you.|||If the AS collations appear only on a few tables you can alter those tables only - something like:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_da_819v.asp|||Hello:

Yes I followed that link it was more helpful... looks like a daunting manual task.. thank you

Sunday, March 11, 2012

Cascading Parameter issues

Hi all,
SSRS 2005
I have a Time Range parameter that has values
1 - This Week
2 - This Month
3 - This Quarter
4 - This Year
5 - Previous Week
6 - Previous Month
7 - Previous Quarter
8 - Previoous Year
I have 2 other parameters (Start and End Date) that are dependant upon what
they select in the Time Range.
TimeRange "1" is the default and is selected and StartDate shows "3/18/2007"
and EndDate shows "3/24/2007".
The problem is that I want the user to be able to override the dates that
are displayed in the Start and End Date parameters.
To do this, I have Set Start end End Data parameters with "Available Values"
set to Non-Queried and the "Default Values" set to "From Query".
When I first go to run the query, everything looks fine.
If I change the TimeRange to "2" ("This Month"), the Default Start and End
Dates do not update and stay at the dates initially loaded.
Thanks in advance for all your help.
Chris E.On Mar 23, 10:39 am, "Chris" <cex...@.enableconsulting.com> wrote:
> Hi all,
> SSRS 2005
> I have a Time Range parameter that has values
> 1 - This Week
> 2 - This Month
> 3 - This Quarter
> 4 - This Year
> 5 - Previous Week
> 6 - Previous Month
> 7 - Previous Quarter
> 8 - Previoous Year
> I have 2 other parameters (Start and End Date) that are dependant upon what
> they select in the Time Range.
> TimeRange "1" is the default and is selected and StartDate shows "3/18/2007"
> and EndDate shows "3/24/2007".
> The problem is that I want the user to be able to override the dates that
> are displayed in the Start and End Date parameters.
> To do this, I have Set Start end End Data parameters with "Available Values"
> set to Non-Queried and the "Default Values" set to "From Query".
> When I first go to run the query, everything looks fine.
> If I change the TimeRange to "2" ("This Month"), the Default Start and End
> Dates do not update and stay at the dates initially loaded.
> Thanks in advance for all your help.
> Chris E.
It seems like once you change the Time Range parameter value, you are
now using the Available Values/Non-Queried option for the Start and
End Date parameters. I would suggest having 2 additional parameter
options for the user to be allowed to enter in their own values for
Start Date and End Date, defaulting to empty strings; and control the
overriding at the database level (in the stored procedure or query
that is sourcing the report). Hope this is helpful.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||Try instead of non queried, if possible, put the date range in a query so it
will refresh, whenever you select the time range.
Amarnath, MCTS
"Chris" wrote:
> Hi all,
> SSRS 2005
> I have a Time Range parameter that has values
> 1 - This Week
> 2 - This Month
> 3 - This Quarter
> 4 - This Year
> 5 - Previous Week
> 6 - Previous Month
> 7 - Previous Quarter
> 8 - Previoous Year
> I have 2 other parameters (Start and End Date) that are dependant upon what
> they select in the Time Range.
> TimeRange "1" is the default and is selected and StartDate shows "3/18/2007"
> and EndDate shows "3/24/2007".
> The problem is that I want the user to be able to override the dates that
> are displayed in the Start and End Date parameters.
> To do this, I have Set Start end End Data parameters with "Available Values"
> set to Non-Queried and the "Default Values" set to "From Query".
> When I first go to run the query, everything looks fine.
> If I change the TimeRange to "2" ("This Month"), the Default Start and End
> Dates do not update and stay at the dates initially loaded.
> Thanks in advance for all your help.
> Chris E.
>
>

Cascading Delete

I use cascading delete on my SQL Server Database. I am experiencing a
long query time on my highest level delete, 10 minutes. If I delete
from each table manually and then delete the parent, I will usually be
done in less than a minute. Any suggestions?Doug Serie (dserie@.charter.net) writes:
> I use cascading delete on my SQL Server Database. I am experiencing a
> long query time on my highest level delete, 10 minutes. If I delete
> from each table manually and then delete the parent, I will usually be
> done in less than a minute. Any suggestions?

Did you implement the cascading delete by triggers or by referential
integrity?

In either case, care to share the relevant code and table definitions,
including indexes?

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Thursday, March 8, 2012

CAS

I'm having a difficult time wrapping my head around Code Access Security.
We have just installed Sharepoint Portal Server 2003. I have a web part that
uses the obc.net dataprovider that is causing me a security error when I try
to upload the web part.
I'm just not understanding what I need to change on the server to allow this
code to run. Since very few people will be able to add web parts does it
make sense just to take the security down to a lower level? This is on our
corporate intranet. If so, can someone explain to me how to lower the
security for the whole site?
Thanks,
JasonSorry - wrong newsgroup
"Jason MacKenzie" <jmackenzie_nospamallowed@.formet.com> wrote in message
news:uunGCpJpEHA.896@.TK2MSFTNGP12.phx.gbl...
> I'm having a difficult time wrapping my head around Code Access Security.
> We have just installed Sharepoint Portal Server 2003. I have a web part
> that uses the obc.net dataprovider that is causing me a security error
> when I try to upload the web part.
> I'm just not understanding what I need to change on the server to allow
> this code to run. Since very few people will be able to add web parts
> does it make sense just to take the security down to a lower level? This
> is on our corporate intranet. If so, can someone explain to me how to
> lower the security for the whole site?
> Thanks,
> Jason
>

Saturday, February 25, 2012

Capturing Server Name?

Hi y'all...long time, I know...

I have what OUGHT to be a simple question...or so I think (which really hurts, mind you...)

I am writing a stored proc that will reside on several different databases and be used to write a row to a "wait table" that is used to control processing in the various databases...

Essentially, the stored proc already exists, and writes what is essentially a note (or process semaphore) that says "Hey, Process XYZ is waiting on the completion of process 123"

Problem is...process XYZ has the same name on a number of different servers, so I have to come up with a way to differentiate the process name that's waiting on a job on a single server (in other words, 5 or more XYZ's can be waiting on a single job on a single server in the network, and the wait table resides on that single server).

So...my thought (again, think pain) is that I will put a process name of "SERVER.XYZ" into the wait table.

The SP I will use to write the "waiting on" semaphore is a common one, so - long story short(er) I need a way to capture the name of the current server (like db_name(), only server_name() - or something like it).

Any suggestions? Thanks in advance...
Paulselect SERVERPROPERTY ('ServerName')

that'll do it...

Thanks for reading though!|||SELECT @.@.SERVERNAME may also work for you...|||Do you mean the name of the server that the database is on? If so, then you have your solution. If you wanted the client server's name, you could use:

select hostname
from master..sysprocesses
where spid = @.@.spid

If you go this route, you will have to make sure that all of your connection strings supply a hostname, though. Not all applications do. Also, the hostname can be spoofed, so be careful about hardcoding that. Good luck.|||...or simply HOST_NAME()|||I'll be darned. Microsoft actually came up with something that might be useful. I may have to try that with an application that spoofs a hostname, and see what happens. Thanks, rdjabarov.

Friday, February 24, 2012

Capture time alone in SQL Server database

Is there any data type in SQL Server 2005 which captures only the TIME in default DATETIME type?

For example, if the datatime field has a value2007-12-11 12:31:00.000, i need a datatype which can capture12:31:00.000 alone. The data type should be in a fashion so that i can find differences in time also...

Any ideas??

Hi,

SQL Server does not have any type which can store only time. One way is to store it as datetime, and when fetching these times, you can convert them to only show time.

|||

venkatesh_ur:

Is there any data type in SQL Server 2005 which captures only the TIME in default DATETIME type?

I'm afraid there is no Datatype to fetch the time only. But of course there are some functions that can be used to get the time part out of any datatime value. Below query will get you the time (converted as varchar):

select getdate() , convert ( varchar , getdate() , 8 )

venkatesh_ur:

he data type should be in a fashion so that i can find differences in time also...

To compare date and time values theDatepartandDateNamefunctions can be useful. They both are quite similar to each other. Read Books Online for more help on these functions.

capture showplan in profiler

I want to capture showplan for all the queries running on the server at a
given time. I wanted to know if i run profiler and say give me all those
queries that run for say greater than 5 secs and include the showplan
events, will it give me showplans for all queries or just for those queries
that ran greater than 5 secs which is what I want.
Afraid to turn it on as I know SQL 2000 was not smart enough and just
started spilling all query plans even with the filter.
Also what sql can i run that probably uses DMV to give me all the query
plans for whats currently running on the server i.e. queries that are
currently executing.. which means that every time i run, the results of the
output would be different depending on the query thats active and running at
the time.
ThanksHassan
Somethimg like that
elect
p.*,
q.*,
cp.plan_handle
from
sys.dm_exec_cached_plans cp
cross apply sys.dm_exec_query_plan(cp.plan_handle) p
cross apply sys.dm_exec_sql_text(cp.plan_handle) as q
where
cp.cacheobjtype = 'Compiled Plan'
"Hassan" <hassan@.test.com> wrote in message
news:OAXYOwIJIHA.5684@.TK2MSFTNGP06.phx.gbl...
>I want to capture showplan for all the queries running on the server at a
>given time. I wanted to know if i run profiler and say give me all those
>queries that run for say greater than 5 secs and include the showplan
>events, will it give me showplans for all queries or just for those queries
>that ran greater than 5 secs which is what I want.
> Afraid to turn it on as I know SQL 2000 was not smart enough and just
> started spilling all query plans even with the filter.
> Also what sql can i run that probably uses DMV to give me all the query
> plans for whats currently running on the server i.e. queries that are
> currently executing.. which means that every time i run, the results of
> the output would be different depending on the query thats active and
> running at the time.
> Thanks
>

capture showplan in profiler

I want to capture showplan for all the queries running on the server at a
given time. I wanted to know if i run profiler and say give me all those
queries that run for say greater than 5 secs and include the showplan
events, will it give me showplans for all queries or just for those queries
that ran greater than 5 secs which is what I want.
Afraid to turn it on as I know SQL 2000 was not smart enough and just
started spilling all query plans even with the filter.
Also what sql can i run that probably uses DMV to give me all the query
plans for whats currently running on the server i.e. queries that are
currently executing.. which means that every time i run, the results of the
output would be different depending on the query thats active and running at
the time.
ThanksHassan
Somethimg like that
elect
p.*,
q.*,
cp.plan_handle
from
sys.dm_exec_cached_plans cp
cross apply sys.dm_exec_query_plan(cp.plan_handle) p
cross apply sys.dm_exec_sql_text(cp.plan_handle) as q
where
cp.cacheobjtype = 'Compiled Plan'
"Hassan" <hassan@.test.com> wrote in message
news:OAXYOwIJIHA.5684@.TK2MSFTNGP06.phx.gbl...
>I want to capture showplan for all the queries running on the server at a
>given time. I wanted to know if i run profiler and say give me all those
>queries that run for say greater than 5 secs and include the showplan
>events, will it give me showplans for all queries or just for those queries
>that ran greater than 5 secs which is what I want.
> Afraid to turn it on as I know SQL 2000 was not smart enough and just
> started spilling all query plans even with the filter.
> Also what sql can i run that probably uses DMV to give me all the query
> plans for whats currently running on the server i.e. queries that are
> currently executing.. which means that every time i run, the results of
> the output would be different depending on the query thats active and
> running at the time.
> Thanks
>

capture showplan in profiler

I want to capture showplan for all the queries running on the server at a
given time. I wanted to know if i run profiler and say give me all those
queries that run for say greater than 5 secs and include the showplan
events, will it give me showplans for all queries or just for those queries
that ran greater than 5 secs which is what I want.
Afraid to turn it on as I know SQL 2000 was not smart enough and just
started spilling all query plans even with the filter.
Also what sql can i run that probably uses DMV to give me all the query
plans for whats currently running on the server i.e. queries that are
currently executing.. which means that every time i run, the results of the
output would be different depending on the query thats active and running at
the time.
Thanks
Hassan
Somethimg like that
elect
p.*,
q.*,
cp.plan_handle
from
sys.dm_exec_cached_plans cp
cross apply sys.dm_exec_query_plan(cp.plan_handle) p
cross apply sys.dm_exec_sql_text(cp.plan_handle) as q
where
cp.cacheobjtype = 'Compiled Plan'
"Hassan" <hassan@.test.com> wrote in message
news:OAXYOwIJIHA.5684@.TK2MSFTNGP06.phx.gbl...
>I want to capture showplan for all the queries running on the server at a
>given time. I wanted to know if i run profiler and say give me all those
>queries that run for say greater than 5 secs and include the showplan
>events, will it give me showplans for all queries or just for those queries
>that ran greater than 5 secs which is what I want.
> Afraid to turn it on as I know SQL 2000 was not smart enough and just
> started spilling all query plans even with the filter.
> Also what sql can i run that probably uses DMV to give me all the query
> plans for whats currently running on the server i.e. queries that are
> currently executing.. which means that every time i run, the results of
> the output would be different depending on the query thats active and
> running at the time.
> Thanks
>

Sunday, February 19, 2012

Capture Execution Time Then Rollback Transaction

I would like to execute a stored procedure listed below then capture or
print out the execution time. Lastly rollback the transaction so that data
does not change in the database.
dbo.usp_Manual_toTraint 65823,'2004-08-01','TA_BB','2004-09-01'
Please help me with this procedure.
Thanks,Joe
See if this helps you
declare @.dt datetime
set @.dt =getdate()
begin tran
--do something here
rollback
select datediff(ss,@.dt,getdate())
"Joe K." <Joe K.@.discussions.microsoft.com> wrote in message
news:F6B145E9-8520-4DF3-95ED-1E4BC20E5DFE@.microsoft.com...
> I would like to execute a stored procedure listed below then capture or
> print out the execution time. Lastly rollback the transaction so that
> data
> does not change in the database.
> dbo.usp_Manual_toTraint 65823,'2004-08-01','TA_BB','2004-09-01'
> Please help me with this procedure.
> Thanks,|||Uri Dimant (urid@.iscar.co.il) writes:
> Joe
> See if this helps you
> declare @.dt datetime
> set @.dt =getdate()
> begin tran
> --do something here
> rollback
> select datediff(ss,@.dt,getdate())
That's not good. You need to do:
declare @.dt datetime
set @.dt =getdate()
begin tran
--do something here
select datediff(ss,@.dt,getdate())
rollback
ROLLBACK can take considerable time and should not be measured.
Also, in many situations, ms (milliseconds) is better than ss (seconds).
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Sunday, February 12, 2012

Can't use DAC in SQL2K5.

SQL2K5
No SP.
Im trying to test out Dedicated Administrator Connection for my first time
and getting an error message:
____________________________
Cannot connect to admin:Server\InstanceName.
Additional information:
DAC's are not supported. (ObjectExplorer)
_________________________
The Browser service is running.
Any ideas?
TIA, ChrisRHi ChrisR
Is it a SQL Express instance?
From BOL: To conserve resources, SQL Server 2005 Express Edition does not
listen on the DAC port unless started with a trace flag 7806.
Is it a remote instance?
DAC must be enabled for remote connections from the Configuration
Manager.
--
HTH
Kalen Delaney, SQL Server MVP
"ChrisR" <ChrisR@.noEmail.com> wrote in message
news:OLSsHeBjGHA.4748@.TK2MSFTNGP04.phx.gbl...
> SQL2K5
> No SP.
> Im trying to test out Dedicated Administrator Connection for my first time
> and getting an error message:
>
> ____________________________
> Cannot connect to admin:Server\InstanceName.
> Additional information:
> DAC's are not supported. (ObjectExplorer)
> _________________________
> The Browser service is running.
> Any ideas?
> TIA, ChrisR
>|||No ma'am.
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Evaluation Edition on Windows NT 5.0 (Build 2195: Service Pack 4)
Also, it is on my local workstation.
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:e0gkxtCjGHA.4512@.TK2MSFTNGP04.phx.gbl...
> Hi ChrisR
> Is it a SQL Express instance?
> From BOL: To conserve resources, SQL Server 2005 Express Edition does
not
> listen on the DAC port unless started with a trace flag 7806.
> Is it a remote instance?
> DAC must be enabled for remote connections from the Configuration
> Manager.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "ChrisR" <ChrisR@.noEmail.com> wrote in message
> news:OLSsHeBjGHA.4748@.TK2MSFTNGP04.phx.gbl...
> > SQL2K5
> > No SP.
> >
> > Im trying to test out Dedicated Administrator Connection for my first
time
> > and getting an error message:
> >
> >
> > ____________________________
> > Cannot connect to admin:Server\InstanceName.
> >
> > Additional information:
> > DAC's are not supported. (ObjectExplorer)
> > _________________________
> >
> > The Browser service is running.
> >
> > Any ideas?
> >
> > TIA, ChrisR
> >
> >
>|||Ok, I duplicated this. You can't use DAC to connect to the Object Explorer,
only when opening a query window.
--
HTH
Kalen Delaney, SQL Server MVP
"ChrisR" <ChrisR@.noEmail.com> wrote in message
news:%231B2YEEjGHA.1264@.TK2MSFTNGP05.phx.gbl...
> No ma'am.
> Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
> Oct 14 2005 00:33:37
> Copyright (c) 1988-2005 Microsoft Corporation
> Enterprise Evaluation Edition on Windows NT 5.0 (Build 2195: Service Pack
> 4)
> Also, it is on my local workstation.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e0gkxtCjGHA.4512@.TK2MSFTNGP04.phx.gbl...
>> Hi ChrisR
>> Is it a SQL Express instance?
>> From BOL: To conserve resources, SQL Server 2005 Express Edition does
> not
>> listen on the DAC port unless started with a trace flag 7806.
>> Is it a remote instance?
>> DAC must be enabled for remote connections from the Configuration
>> Manager.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "ChrisR" <ChrisR@.noEmail.com> wrote in message
>> news:OLSsHeBjGHA.4748@.TK2MSFTNGP04.phx.gbl...
>> > SQL2K5
>> > No SP.
>> >
>> > Im trying to test out Dedicated Administrator Connection for my first
> time
>> > and getting an error message:
>> >
>> >
>> > ____________________________
>> > Cannot connect to admin:Server\InstanceName.
>> >
>> > Additional information:
>> > DAC's are not supported. (ObjectExplorer)
>> > _________________________
>> >
>> > The Browser service is running.
>> >
>> > Any ideas?
>> >
>> > TIA, ChrisR
>> >
>> >
>>
>|||To continue, your initial connection can't be DAC so first open the Mgmt
Studio without DAC, and then open a query window with a DAC.
--
HTH
Kalen Delaney, SQL Server MVP
"ChrisR" <ChrisR@.noEmail.com> wrote in message
news:%231B2YEEjGHA.1264@.TK2MSFTNGP05.phx.gbl...
> No ma'am.
> Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
> Oct 14 2005 00:33:37
> Copyright (c) 1988-2005 Microsoft Corporation
> Enterprise Evaluation Edition on Windows NT 5.0 (Build 2195: Service Pack
> 4)
> Also, it is on my local workstation.
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:e0gkxtCjGHA.4512@.TK2MSFTNGP04.phx.gbl...
>> Hi ChrisR
>> Is it a SQL Express instance?
>> From BOL: To conserve resources, SQL Server 2005 Express Edition does
> not
>> listen on the DAC port unless started with a trace flag 7806.
>> Is it a remote instance?
>> DAC must be enabled for remote connections from the Configuration
>> Manager.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "ChrisR" <ChrisR@.noEmail.com> wrote in message
>> news:OLSsHeBjGHA.4748@.TK2MSFTNGP04.phx.gbl...
>> > SQL2K5
>> > No SP.
>> >
>> > Im trying to test out Dedicated Administrator Connection for my first
> time
>> > and getting an error message:
>> >
>> >
>> > ____________________________
>> > Cannot connect to admin:Server\InstanceName.
>> >
>> > Additional information:
>> > DAC's are not supported. (ObjectExplorer)
>> > _________________________
>> >
>> > The Browser service is running.
>> >
>> > Any ideas?
>> >
>> > TIA, ChrisR
>> >
>> >
>>
>|||Perfect, thanks alot Kalen!
Have a great weekend!
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:uzgZg$EjGHA.4884@.TK2MSFTNGP03.phx.gbl...
> To continue, your initial connection can't be DAC so first open the Mgmt
> Studio without DAC, and then open a query window with a DAC.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "ChrisR" <ChrisR@.noEmail.com> wrote in message
> news:%231B2YEEjGHA.1264@.TK2MSFTNGP05.phx.gbl...
> > No ma'am.
> >
> > Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
> >
> > Oct 14 2005 00:33:37
> >
> > Copyright (c) 1988-2005 Microsoft Corporation
> >
> > Enterprise Evaluation Edition on Windows NT 5.0 (Build 2195: Service
Pack
> > 4)
> >
> > Also, it is on my local workstation.
> >
> >
> >
> > "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> > news:e0gkxtCjGHA.4512@.TK2MSFTNGP04.phx.gbl...
> >> Hi ChrisR
> >>
> >> Is it a SQL Express instance?
> >> From BOL: To conserve resources, SQL Server 2005 Express Edition
does
> > not
> >> listen on the DAC port unless started with a trace flag 7806.
> >>
> >> Is it a remote instance?
> >> DAC must be enabled for remote connections from the Configuration
> >> Manager.
> >>
> >> --
> >> HTH
> >> Kalen Delaney, SQL Server MVP
> >>
> >>
> >> "ChrisR" <ChrisR@.noEmail.com> wrote in message
> >> news:OLSsHeBjGHA.4748@.TK2MSFTNGP04.phx.gbl...
> >> > SQL2K5
> >> > No SP.
> >> >
> >> > Im trying to test out Dedicated Administrator Connection for my first
> > time
> >> > and getting an error message:
> >> >
> >> >
> >> > ____________________________
> >> > Cannot connect to admin:Server\InstanceName.
> >> >
> >> > Additional information:
> >> > DAC's are not supported. (ObjectExplorer)
> >> > _________________________
> >> >
> >> > The Browser service is running.
> >> >
> >> > Any ideas?
> >> >
> >> > TIA, ChrisR
> >> >
> >> >
> >>
> >>
> >
> >
>

Can't Use "Transacional publication" Option (It's Grayed Out!)

Used the Wizard to Creat Publication for the first time.
I saw three choices "Snapshot publication", "Transacional publication"
and "Merge publication".
I wanted to slect "Transacional publication" but it was grayed out. I
wonder why!!
Created a database with one table on server A.
Created same database with same table on server B.
I'm making A the publisher/distributor and B the subscriber.
The Recovery Model for both database on both servers is 'Full' model.
I backed up a transaction log.
How can I get to select Publication using the 'Transaction' type?
Thank you very much
Mike
*** Sent via Developersdex http://www.codecomments.com ***
I suspect your SQL Server version is MSDE - transactional replication is not
supported on MSDE - upgrade to SQL Server standard.
Hilary Cotter
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
"mike" <-nospam@.yahoo.com> wrote in message
news:OBwQbcz2FHA.3600@.TK2MSFTNGP12.phx.gbl...
> Used the Wizard to Creat Publication for the first time.
> I saw three choices "Snapshot publication", "Transacional publication"
> and "Merge publication".
> I wanted to slect "Transacional publication" but it was grayed out. I
> wonder why!!
> Created a database with one table on server A.
> Created same database with same table on server B.
> I'm making A the publisher/distributor and B the subscriber.
> The Recovery Model for both database on both servers is 'Full' model.
> I backed up a transaction log.
> How can I get to select Publication using the 'Transaction' type?
> Thank you very much
>
> Mike
> *** Sent via Developersdex http://www.codecomments.com ***
|||(...or Personal Edition).
Paul Ibison

can't update view

Hi all ,

I have a problem to insert new data to a view which created from 2 tables.

I am trying to so from run time

Any help will be appreciated

use an instead of INsert trigger for that.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

Itamarqza, did the Instead Of resolve your issue? If not could you please provide more information.

Thanks,

Derek

Friday, February 10, 2012

Can't truncate a 99 GB transaction log need badly help

Hi,
I am having hard time trying to truncate a 99 GB transaction log for a
database.
I already tried
CHECKPOINT
DBCC SHRINKFILE (emptydb_Log, 15000)
DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
And I get this results:
DbId|FieldId|CurrentSize|MinimumSize|UsedPages|Est imatedPages
8 | 2 | 11601696| 63| 11601696|
56
From allocated 99 GB to this log in taskpad I can see that used space is
13642.14 MB however none of the above work, even a full backup with truncate
log option selected.
Maintenance plan also can't do the job also.
Can someone explain to me how I can safely get rid of these free 76996 GB
from log file.
I really appreciate your support, it is imperative to find a solution ASAP
as I run out of space.
Thank you,
Zorba
Hi,
try this
Backup log database name with truncate_only
dbcc shrinfile(logical name,size);
This will take lot of time as it is very big.
hope this help
from
doller
|||Hi,
try this
Backup log database name with truncate_only
dbcc shrinkfile(logical name,size); size is give at the time of
database creation
This will take lot of time as it is very big.
hope this help
from
doller
|||Do you have an open transaction? Try running DBCC OPENTRAN on that DB.
http://www.nigelrivett.net/Transacti...leGrows_1.html Log File issues
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
Server 7.0 Tran Log
http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
Server 2000 with DBCC SHRINKFILE
http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
considerations
Andrew J. Kelly SQL MVP
"Zorba" <nospam@.nonexistent> wrote in message
news:OL0AXtctFHA.460@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I am having hard time trying to truncate a 99 GB transaction log for a
> database.
> I already tried
> CHECKPOINT
> DBCC SHRINKFILE (emptydb_Log, 15000)
> DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
> And I get this results:
> DbId|FieldId|CurrentSize|MinimumSize|UsedPages|Est imatedPages
> 8 | 2 | 11601696| 63| 11601696| 56
> From allocated 99 GB to this log in taskpad I can see that used space is
> 13642.14 MB however none of the above work, even a full backup with
> truncate log option selected.
> Maintenance plan also can't do the job also.
> Can someone explain to me how I can safely get rid of these free 76996 GB
> from log file.
>
> I really appreciate your support, it is imperative to find a solution ASAP
> as I run out of space.
> Thank you,
> Zorba
>
>
|||Thank you all, for helping me.
Finally after 5 hours the only method that gave result was to backup only
the transaction log to a file and
after that:
CHECKPOINT
DBCC SHRINKFILE (emptydb_Log, NOTRUNCATE )
DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
After first attempt this had reduced the log size to 10.6 GB and after
second backup of transaction log with same process it went down to 60 MB.
Now I learned that I should keep my eyes more often on these automatically
scheduled maintenance plans :-).
Note: a full DB backup with truncate log option selected was not effective.
Thank you,
Zorba
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:eo$HJlhtFHA.1028@.TK2MSFTNGP12.phx.gbl...
> Do you have an open transaction? Try running DBCC OPENTRAN on that DB.
>
> http://www.nigelrivett.net/Transacti...leGrows_1.html Log File issues
> http://www.support.microsoft.com/?id=317375 Log File Grows too big
> http://www.support.microsoft.com/?id=110139 Log file filling up
> http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
> http://www.support.microsoft.com/?id=315512 Considerations for
> Autogrow and AutoShrink
> http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
> Server 7.0 Tran Log
> http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
> Server 2000 with DBCC SHRINKFILE
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
> considerations
>
> --
> Andrew J. Kelly SQL MVP
>
> "Zorba" <nospam@.nonexistent> wrote in message
> news:OL0AXtctFHA.460@.TK2MSFTNGP15.phx.gbl...
>

Can't truncate a 99 GB transaction log need badly help

Hi,
I am having hard time trying to truncate a 99 GB transaction log for a
database.
I already tried
CHECKPOINT
DBCC SHRINKFILE (emptydb_Log, 15000)
DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
And I get this results:
DbId|FieldId|CurrentSize|MinimumSize|Use
dPages|EstimatedPages
8 | 2 | 11601696| 63| 11601696|
56
From allocated 99 GB to this log in taskpad I can see that used space is
13642.14 MB however none of the above work, even a full backup with truncate
log option selected.
Maintenance plan also can't do the job also.
Can someone explain to me how I can safely get rid of these free 76996 GB
from log file.
I really appreciate your support, it is imperative to find a solution ASAP
as I run out of space.
Thank you,
ZorbaHi,
try this
Backup log database name with truncate_only
dbcc shrinfile(logical name,size);
This will take lot of time as it is very big.
hope this help
from
doller|||Hi,
try this
Backup log database name with truncate_only
dbcc shrinkfile(logical name,size); size is give at the time of
database creation
This will take lot of time as it is very big.
hope this help
from
doller|||Do you have an open transaction? Try running DBCC OPENTRAN on that DB.
http://www.nigelrivett.net/Transact...ileGrows_1.html Log File issues
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
Server 7.0 Tran Log
http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
Server 2000 with DBCC SHRINKFILE
http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
considerations
Andrew J. Kelly SQL MVP
"Zorba" <nospam@.nonexistent> wrote in message
news:OL0AXtctFHA.460@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I am having hard time trying to truncate a 99 GB transaction log for a
> database.
> I already tried
> CHECKPOINT
> DBCC SHRINKFILE (emptydb_Log, 15000)
> DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
> And I get this results:
> DbId|FieldId|CurrentSize|MinimumSize|Use
dPages|EstimatedPages
> 8 | 2 | 11601696| 63| 11601696| 56
> From allocated 99 GB to this log in taskpad I can see that used space is
> 13642.14 MB however none of the above work, even a full backup with
> truncate log option selected.
> Maintenance plan also can't do the job also.
> Can someone explain to me how I can safely get rid of these free 76996 GB
> from log file.
>
> I really appreciate your support, it is imperative to find a solution ASAP
> as I run out of space.
> Thank you,
> Zorba
>
>|||Thank you all, for helping me.
Finally after 5 hours the only method that gave result was to backup only
the transaction log to a file and
after that:
CHECKPOINT
DBCC SHRINKFILE (emptydb_Log, NOTRUNCATE )
DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
After first attempt this had reduced the log size to 10.6 GB and after
second backup of transaction log with same process it went down to 60 MB.
Now I learned that I should keep my eyes more often on these automatically
scheduled maintenance plans :-).
Note: a full DB backup with truncate log option selected was not effective.
Thank you,
Zorba
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:eo$HJlhtFHA.1028@.TK2MSFTNGP12.phx.gbl...
> Do you have an open transaction? Try running DBCC OPENTRAN on that DB.
>
> http://www.nigelrivett.net/Transact...ileGrows_1.html Log File issues
> http://www.support.microsoft.com/?id=317375 Log File Grows too big
> http://www.support.microsoft.com/?id=110139 Log file filling up
> http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
> http://www.support.microsoft.com/?id=315512 Considerations for
> Autogrow and AutoShrink
> http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
> Server 7.0 Tran Log
> http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
> Server 2000 with DBCC SHRINKFILE
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
> considerations
>
> --
> Andrew J. Kelly SQL MVP
>
> "Zorba" <nospam@.nonexistent> wrote in message
> news:OL0AXtctFHA.460@.TK2MSFTNGP15.phx.gbl...
>

Can't truncate a 99 GB transaction log need badly help

Hi,
I am having hard time trying to truncate a 99 GB transaction log for a
database.
I already tried
CHECKPOINT
DBCC SHRINKFILE (emptydb_Log, 15000)
DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
And I get this results:
DbId|FieldId|CurrentSize|MinimumSize|UsedPages|EstimatedPages
8 | 2 | 11601696| 63| 11601696|
56
From allocated 99 GB to this log in taskpad I can see that used space is
13642.14 MB however none of the above work, even a full backup with truncate
log option selected.
Maintenance plan also can't do the job also.
Can someone explain to me how I can safely get rid of these free 76996 GB
from log file.
I really appreciate your support, it is imperative to find a solution ASAP
as I run out of space.
Thank you,
ZorbaHi,
try this
Backup log database name with truncate_only
dbcc shrinfile(logical name,size);
This will take lot of time as it is very big.
hope this help
from
doller|||Hi,
try this
Backup log database name with truncate_only
dbcc shrinkfile(logical name,size); size is give at the time of
database creation
This will take lot of time as it is very big.
hope this help
from
doller|||Do you have an open transaction? Try running DBCC OPENTRAN on that DB.
http://www.nigelrivett.net/TransactionLogFileGrows_1.html Log File issues
http://www.support.microsoft.com/?id=317375 Log File Grows too big
http://www.support.microsoft.com/?id=110139 Log file filling up
http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
http://www.support.microsoft.com/?id=315512 Considerations for Autogrow
and AutoShrink
http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
Server 7.0 Tran Log
http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
Server 2000 with DBCC SHRINKFILE
http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
considerations
Andrew J. Kelly SQL MVP
"Zorba" <nospam@.nonexistent> wrote in message
news:OL0AXtctFHA.460@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I am having hard time trying to truncate a 99 GB transaction log for a
> database.
> I already tried
> CHECKPOINT
> DBCC SHRINKFILE (emptydb_Log, 15000)
> DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
> And I get this results:
> DbId|FieldId|CurrentSize|MinimumSize|UsedPages|EstimatedPages
> 8 | 2 | 11601696| 63| 11601696| 56
> From allocated 99 GB to this log in taskpad I can see that used space is
> 13642.14 MB however none of the above work, even a full backup with
> truncate log option selected.
> Maintenance plan also can't do the job also.
> Can someone explain to me how I can safely get rid of these free 76996 GB
> from log file.
>
> I really appreciate your support, it is imperative to find a solution ASAP
> as I run out of space.
> Thank you,
> Zorba
>
>|||Thank you all, for helping me.
Finally after 5 hours the only method that gave result was to backup only
the transaction log to a file and
after that:
CHECKPOINT
DBCC SHRINKFILE (emptydb_Log, NOTRUNCATE )
DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
After first attempt this had reduced the log size to 10.6 GB and after
second backup of transaction log with same process it went down to 60 MB.
Now I learned that I should keep my eyes more often on these automatically
scheduled maintenance plans :-).
Note: a full DB backup with truncate log option selected was not effective.
Thank you,
Zorba
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:eo$HJlhtFHA.1028@.TK2MSFTNGP12.phx.gbl...
> Do you have an open transaction? Try running DBCC OPENTRAN on that DB.
>
> http://www.nigelrivett.net/TransactionLogFileGrows_1.html Log File issues
> http://www.support.microsoft.com/?id=317375 Log File Grows too big
> http://www.support.microsoft.com/?id=110139 Log file filling up
> http://www.mssqlserver.com/faq/logs-shrinklog.asp Shrink File
> http://www.support.microsoft.com/?id=315512 Considerations for
> Autogrow and AutoShrink
> http://www.support.microsoft.com/?id=256650 INF: How to Shrink the SQL
> Server 7.0 Tran Log
> http://www.support.microsoft.com/?id=272318 INF: Shrinking Log in SQL
> Server 2000 with DBCC SHRINKFILE
> http://www.karaszi.com/SQLServer/info_dont_shrink.asp Shrinking
> considerations
>
> --
> Andrew J. Kelly SQL MVP
>
> "Zorba" <nospam@.nonexistent> wrote in message
> news:OL0AXtctFHA.460@.TK2MSFTNGP15.phx.gbl...
>> Hi,
>> I am having hard time trying to truncate a 99 GB transaction log for a
>> database.
>> I already tried
>> CHECKPOINT
>> DBCC SHRINKFILE (emptydb_Log, 15000)
>> DBCC SHRINKFILE (emptydb_Log, TRUNCATEONLY )
>> And I get this results:
>> DbId|FieldId|CurrentSize|MinimumSize|UsedPages|EstimatedPages
>> 8 | 2 | 11601696| 63| 11601696| 56
>> From allocated 99 GB to this log in taskpad I can see that used space is
>> 13642.14 MB however none of the above work, even a full backup with
>> truncate log option selected.
>> Maintenance plan also can't do the job also.
>> Can someone explain to me how I can safely get rid of these free 76996 GB
>> from log file.
>>
>> I really appreciate your support, it is imperative to find a solution
>> ASAP as I run out of space.
>> Thank you,
>> Zorba
>>
>

Cant think how to do....

Hi guys..if anyone has the time, could some1 help me with a querie i am trying to do on my DB..i attached the tables..and well,

i am trying to do...given the start and end dates, produce report showing the performance of each sales rep. over that period. should begin with the rep who has most orders by value and include total units sold and total order value

geez, just writing what i wanna do sounds complicated.
if anyone can gimme a hand it would be much appreciated!
thanksoh, this sounds so much like a school assignment

the only way i help people with homework is if they've already written the sql and shown their thinking process, so that i can offer corrections or suggestions for improvement|||Hi, yes it is a question sheet i have to do...and i understand why you said what you said...so ill try to explain what i understand from the question and hopefully you can help me :)

well from what i can see, i am going to have to join the salesRep table with ShopOrder. and use the SalesRepID as the link. but, its what comes next that is just too mixed up for me...i am guessing i have to do a sum of the salesrep...that then mean i have to link to the orderline table to see the quantity right??
hmmmm, ok...i am gonna have another think..i am talking rubbish!
ill edit this in a bit....tbc|||you're on the right track

join SalesRep to ShopOrder

can't stop there, must also join to OrderLine, to get the value of Quantity*UnitSellingPrice

now sum those up, so we need a GROUP BY

how about by SalesRep.Name

don't forget to sum the number of units sold, too|||ok, this is where i am at...thanks for the help :)

SELECT salesRep.salesRepId, salesRep.Name, SUM(Quantity*UnitSellingPrice) AS "units sold"
WHERE salesRep.salesRepID = ShopOrder.salesRepID, orderLine.ShopOrderID = ShopOrder.ShopOrderID
FROM salesRep, ShopOrder, OrderLine
GROUP BY salesRep.Name;

something is wrong there right??
thanks for the guidance :)|||WHERE comes after FROM

clauses in the WHERE must be separated by ANDs, not commas

alternative: use JOIN syntax, and replace your FROM and WHERE with this:
select ...
from salesRep
inner
join ShopOrder
on salesRep.salesRepID = ShopOrder.salesRepID
inner
join OrderLine
on ShopOrder.ShopOrderID = orderLine.ShopOrderID
group
by ...

the GROUP BY must have all the non-aggregate columns in the SELECT list|||i think i understand that way of joining.....this way is better?
i am getting a error msg:

mysql> select salesRep.salesRepId, salesRep.Name
-> from salesRep inner join ShopOrder on salesRep.salesRepID = ShopOrder.sal
esRepID
-> inner join OrderLine on ShopOrder.ShopOrderID = orderLine.ShopOrderID
-> group by salesRep.salesRepId, salesRep.Name;
ERROR 1109: Unknown table 'orderLine' in on clause

i didnt put the quantity yet because i want to check that it works...am i way off?|||case sensitive table name

sorry, that was my bad

:(|||thats ok, i cant believe i didnt spot it!!!! must cos my brain has turned into jello!!!....

select salesRep.salesRepId, salesRep.Name, SUM(Quantity*UnitSellingPrice) AS "Total"
from salesRep inner join ShopOrder on salesRep.salesRepID = ShopOrder.salesRepID
inner join OrderLine on ShopOrder.ShopOrderID = OrderLine.ShopOrderID
group by salesRep.salesRepId, salesRep.Name;

i gota that working...but i am having trouble understanding, or breaking down the question..ie what it wants, its confusing me!! :( this bit..

" the rep who has most orders by value and include total units sold and total order value "

thanks for all the help...ur a star|||"begin with the rep who has most orders by value"

i.e sort the results by Total descending

don't forget your other sum for number of units|||select salesRep.salesRepId, salesRep.Name, SUM(Quantity*UnitSellingPrice) AS "Total", SUM(Quantity) AS "Units", SUM(OrderLine.ShopOrderID) AS "Total Orders"
from salesRep inner join ShopOrder on salesRep.salesRepID = ShopOrder.salesRepID
inner join OrderLine on ShopOrder.ShopOrderID = OrderLine.ShopOrderID
group by salesRep.salesRepId, salesRep.Name
ORDER by "Total" DESC;

i think i got it ? right...seems to work...

now to do the bit about given start and end dates?
i tried putting a WHEN and giving dates but it didnt work :(
honestly i do try before bugging you, i feel useless having to ask so much.....but thanks, if you have time to show me, brilliant, thanks...|||not WHEN, WHERE

and if fred dobbs sold an order with ShopOrderID = 21, if there were 5 items in that order, his "Total Orders" would be 105, and would be wrong