Showing posts with label appreciated. Show all posts
Showing posts with label appreciated. Show all posts

Sunday, March 25, 2012

Create a new user

hi

im unable to create a new sql server authentication login

It is appreciated if anyone helps me

thanks in advance

It seems as though your login does not have permission to create a new login.

Log in as the administrator, and give your login the appropriate priviledges.

|||

What does "unable" eman in your case, you did not specify if you are getting an error or the login is just not working ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

hi jens,

thanks for your reply

I logged in with windows authentication and tried to create a new login for sql server authentication..it didnt work

then i logged in windows mode and tried to create tables...that also didnt work....then only i got the solution that i have to install SP 2 and while installing i can specify the authentication as windows (or) sql server (or) both....

so i installed and specified the authentication as mixed and it is working fine now

Thanks,

Poorani

Wednesday, March 7, 2012

CPU spike with SQL Server 2005 Express Edition

Hello,
Any help is greatly appreciated.
I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
on my Windows 2003 server SP1. I've noticted that running a single one
table query against the new sql engine causes the sqlservr.exe process
to consume 98% of CPU on the server. The spike usually lasts for a
20-30 seconds and I can't figure out why. The query is a simple select
query against one table with only 3000 records.
The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
Again, any suggestions are appreciated.
Thank you.support@.holylandmarket.com wrote:
> Hello,
> Any help is greatly appreciated.
> I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
> on my Windows 2003 server SP1. I've noticted that running a single one
> table query against the new sql engine causes the sqlservr.exe process
> to consume 98% of CPU on the server. The spike usually lasts for a
> 20-30 seconds and I can't figure out why. The query is a simple select
> query against one table with only 3000 records.
> The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
> Again, any suggestions are appreciated.
> Thank you.
>
What does the execution plan for the query look like? What is the
heaviest part of the plan?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||It looks like the index scan is the heaviest part of the plan. The
problem is I get high CPU spikes regardless of the query I run.
Again the db is very small with very little data in it. I have the
same db running on Windows XP and I don't see any CPU spikes.
Isam
Thanks.
Tracy McKibben wrote:
> support@.holylandmarket.com wrote:
> What does the execution plan for the query look like? What is the
> heaviest part of the plan?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Isam wrote:
> It looks like the index scan is the heaviest part of the plan. The
> problem is I get high CPU spikes regardless of the query I run.
> Again the db is very small with very little data in it. I have the
> same db running on Windows XP and I don't see any CPU spikes.
>
You say the spike lasts for 20-30 seconds - how long does the query run?
Do you have auto-close enabled on this database?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||The query comes back in sub second but the process is still pegged.
Auto Close is set to True on the db.
Isam
Tracy McKibben wrote:
> Isam wrote:
> You say the spike lasts for 20-30 seconds - how long does the query run?
> Do you have auto-close enabled on this database?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Isam wrote:
> The query comes back in sub second but the process is still pegged.
> Auto Close is set to True on the db.
>
Turn that off and see if the spike goes away...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I can still see it spike. Turning auto close off did not change much.
Isam
support@.holylandmarket.com wrote:
> Hello,
> Any help is greatly appreciated.
> I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
> on my Windows 2003 server SP1. I've noticted that running a single one
> table query against the new sql engine causes the sqlservr.exe process
> to consume 98% of CPU on the server. The spike usually lasts for a
> 20-30 seconds and I can't figure out why. The query is a simple select
> query against one table with only 3000 records.
> The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
> Again, any suggestions are appreciated.
> Thank you.

CPU spike with SQL Server 2005 Express Edition

Hello,

Any help is greatly appreciated.

I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
on my Windows 2003 server SP1. I've noticted that running a single one

table query against the new sql engine causes the sqlservr.exe process
to consume 98% of CPU on the server. The spike usually lasts for a
20-30 seconds and I can't figure out why. The query is a simple select

query against one table with only 3000 records.

The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.

Again, any suggestions are appreciated.

Thank you.Isam wrote:

Quote:

Originally Posted by

Hello,
>
Any help is greatly appreciated.
>
>
I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
on my Windows 2003 server SP1. I've noticted that running a single one
>
table query against the new sql engine causes the sqlservr.exe process
to consume 98% of CPU on the server. The spike usually lasts for a
20-30 seconds and I can't figure out why. The query is a simple select
>
query against one table with only 3000 records.
>
>
The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
>
>
Again, any suggestions are appreciated.
>
>
Thank you.


Oddly, the first rule of computer trouble shooting would seem to apply
here: When in doubt, turn off the Microsoft product. :P

Seriously, does this happen even after restarting SQL and/or the
server?

That's about it for me. I don't know enough to really trouble shoot
this, but I can point out the obvious with the best of them. ;)

--Richard|||Isam (support@.holylandmarket.com) writes:

Quote:

Originally Posted by

I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
on my Windows 2003 server SP1. I've noticted that running a single one
table query against the new sql engine causes the sqlservr.exe process
to consume 98% of CPU on the server. The spike usually lasts for a
20-30 seconds and I can't figure out why. The query is a simple select
query against one table with only 3000 records.


Does the query run for 20-30 seconds, or does it complete long before
the CPU spike is over?

Care to post the query and the definition for the underlying table?

By the way, did you run UPDATE STATISTICS on all tables after the upgrade?

--
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

CPU spike with SQL Server 2005 Express Edition

Hello,
Any help is greatly appreciated.
I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
on my Windows 2003 server SP1. I've noticted that running a single one
table query against the new sql engine causes the sqlservr.exe process
to consume 98% of CPU on the server. The spike usually lasts for a
20-30 seconds and I can't figure out why. The query is a simple select
query against one table with only 3000 records.
The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
Again, any suggestions are appreciated.
Thank you.support@.holylandmarket.com wrote:
> Hello,
> Any help is greatly appreciated.
> I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
> on my Windows 2003 server SP1. I've noticted that running a single one
> table query against the new sql engine causes the sqlservr.exe process
> to consume 98% of CPU on the server. The spike usually lasts for a
> 20-30 seconds and I can't figure out why. The query is a simple select
> query against one table with only 3000 records.
> The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
> Again, any suggestions are appreciated.
> Thank you.
>
What does the execution plan for the query look like? What is the
heaviest part of the plan?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||It looks like the index scan is the heaviest part of the plan. The
problem is I get high CPU spikes regardless of the query I run.
Again the db is very small with very little data in it. I have the
same db running on Windows XP and I don't see any CPU spikes.
Isam
Thanks.
Tracy McKibben wrote:
> support@.holylandmarket.com wrote:
> > Hello,
> >
> > Any help is greatly appreciated.
> >
> > I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
> > on my Windows 2003 server SP1. I've noticted that running a single one
> > table query against the new sql engine causes the sqlservr.exe process
> > to consume 98% of CPU on the server. The spike usually lasts for a
> > 20-30 seconds and I can't figure out why. The query is a simple select
> > query against one table with only 3000 records.
> >
> > The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
> >
> > Again, any suggestions are appreciated.
> >
> > Thank you.
> >
> What does the execution plan for the query look like? What is the
> heaviest part of the plan?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Isam wrote:
> It looks like the index scan is the heaviest part of the plan. The
> problem is I get high CPU spikes regardless of the query I run.
> Again the db is very small with very little data in it. I have the
> same db running on Windows XP and I don't see any CPU spikes.
>
You say the spike lasts for 20-30 seconds - how long does the query run?
Do you have auto-close enabled on this database?
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||The query comes back in sub second but the process is still pegged.
Auto Close is set to True on the db.
Isam
Tracy McKibben wrote:
> Isam wrote:
> > It looks like the index scan is the heaviest part of the plan. The
> > problem is I get high CPU spikes regardless of the query I run.
> >
> > Again the db is very small with very little data in it. I have the
> > same db running on Windows XP and I don't see any CPU spikes.
> >
> You say the spike lasts for 20-30 seconds - how long does the query run?
> Do you have auto-close enabled on this database?
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||Isam wrote:
> The query comes back in sub second but the process is still pegged.
> Auto Close is set to True on the db.
>
Turn that off and see if the spike goes away...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||I can still see it spike. Turning auto close off did not change much.
Isam
support@.holylandmarket.com wrote:
> Hello,
> Any help is greatly appreciated.
> I've recently upgraded my MSDE 2000 to SQL Server 2005 Express Edition
> on my Windows 2003 server SP1. I've noticted that running a single one
> table query against the new sql engine causes the sqlservr.exe process
> to consume 98% of CPU on the server. The spike usually lasts for a
> 20-30 seconds and I can't figure out why. The query is a simple select
> query against one table with only 3000 records.
> The server is a one proc machine 2.0 GHz celeron, with 1 GB of RAM.
> Again, any suggestions are appreciated.
> Thank you.

Sunday, February 19, 2012

Counting unique entries in a SQL Statement

I have a complicated problem, and I'm new to SQL so any help would be greatly appreciated.

I am creating an export file (fixed width) that contains a breakdown of items on an invoice, and each "export file" can contain many invoices. The problem is that I need to apply an incremental "invoice" count on each line. This isn't as simple as doing a running sum of "1" on each record, because the first 5 rows may all be on the same invoice, and all rows need to be identified as being associated with "invoice 1". The next invoice will be known as "invoice 2" and again may contain many rows, all requiring "invoice 2".

Does this make sense?

EG.: I am shipping products, and the breakdown is: Vessel, Voyage, Invoice No, Product, Mark.....

SAGMIR 025 001 HEM/FIR HLF550...

SAGMIR 025 001 HEM/FIR KILN-D HLF505...

SAGMIR 025 002 HEM/FIR HLF660....

The SQL statement that produces the above is a Select query with a grouping on VES/VOY/BL_ID/PRO/MARK where the "BL_ID" indicates they are on the same invoice, but is not the incremental number I require. Complicated, i know...

Thanks in advance for anyone who can help.....if this explanation isn't clear please tell me!

Michael

Yes, this is not clear to me yet. Could you explain this a bit in detail ? There is a function in SQL Server which can produce a rank based on several columns. The example for procuding such number would be to get new running number for Order Details per order number. Is is this what you are trying to do ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||Your best bet is probably a temporary table... and then join back to it.something like the following :

create table #tempinv
(
invid int identity(1,1),
bl_id int not null
)

insert into #tempinv
(
bl_id
)
select distinct BL_ID from invoices
order by BL_ID

select i.VES, i.VOY, t.invid, i.PRO, i.MARK
from invoices i
inner join #tempinv t on t.bl_id = i.BL_ID
order by i.BL_ID

drop table #tempinv

I think this is what you want....