Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Monday, March 26, 2012

Multiple Inserts in the Same Stored Procedure

Hey,
I have a project that I have been working on and I need to insert a
record into multiple tables and I if any one of the inserts fails I
need to rollback all of the previous inserts that were done. To
illustrate, I have ten tables that need to have a record inserted into
them and if it errors out on table six, then I want to rollback the
previous five inserts. I'd appreciate any advice I can get. Thanks.bradley.d.walker@.gmail.com wrote:
> Hey,
> I have a project that I have been working on and I need to insert a
> record into multiple tables and I if any one of the inserts fails I
> need to rollback all of the previous inserts that were done. To
> illustrate, I have ten tables that need to have a record inserted into
> them and if it errors out on table six, then I want to rollback the
> previous five inserts. I'd appreciate any advice I can get. Thanks.
>
BEGIN TRANSACTION
INSERT Table1 .....
IF @.@.ERROR <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN
END
INSERT Table2 .....
IF @.@.ERROR <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN
END
INSERT Table3 .....
IF @.@.ERROR <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN
END
INSERT Table4 .....
IF @.@.ERROR <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN
END
...
...
...
...
...
...
COMMIT TRANSACTION|||With SQL 2000 -SQL 2005 is a bit 'simplier' in manifestation - but the idea
is the same.
BEGIN TRANSACTION
INSERT INTO into table1 (ColList) VALUES (ValList)
IF @.ERROR <> 0
BEGIN
ROLLBACK
RETURN
END
INSERT INTO into table2 (ColList) VALUES (ValList)
IF @.ERROR <> 0
BEGIN
ROLLBACK
RETURN
END
{etc.}
COMMIT TRANSACTION
RETURN
There are variations to the idea, using GOTO to the end of the sproc and ROL
LBACK from there.
--
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
<bradley.d.walker@.gmail.com> wrote in message news:1151077294.100001.43410@.g10g2000cwb.goog
legroups.com...
> Hey,
>
> I have a project that I have been working on and I need to insert a
> record into multiple tables and I if any one of the inserts fails I
> need to rollback all of the previous inserts that were done. To
> illustrate, I have ten tables that need to have a record inserted into
> them and if it errors out on table six, then I want to rollback the
> previous five inserts. I'd appreciate any advice I can get. Thanks.
>|||To add to the other responses, consider adding SET XACT_ABORT ON to the
beginning of your proc. This will ensure a transaction rollback occurs in
the case of a client-initiated attention event (e.g. query timeout or
cancel).
Hope this helps.
Dan Guzman
SQL Server MVP
<bradley.d.walker@.gmail.com> wrote in message
news:1151077294.100001.43410@.g10g2000cwb.googlegroups.com...
> Hey,
> I have a project that I have been working on and I need to insert a
> record into multiple tables and I if any one of the inserts fails I
> need to rollback all of the previous inserts that were done. To
> illustrate, I have ten tables that need to have a record inserted into
> them and if it errors out on table six, then I want to rollback the
> previous five inserts. I'd appreciate any advice I can get. Thanks.
>|||>> I have a project that I have been working on and I need to insert a record [si
c] into multiple tables and I if any one of the inserts fails Ineed to rollb
ack all of the previous inserts that were done. <<
Easy enough; set up a series of INSERT INTO's in a single transaction,
trap each insertion's error and do a ROLLBACK and return if you have a
failure. Do not commit until the end of the whole thing.
The scope of transactions in T-SQL is independent of the block
structure of the language. Think of a "transaction guy" with a bucket
of data looking at a house. The house pumps data into his bucket. He
does not care what is happening inside; he is waiting to see a COMMIT
or ROLLBACK flag come out of the window of the house. At that point,
he either throws the data out or throws it in the database.
But a better question why do you want to store the same data in
multiple tables? The major reason we moved from files to RDBMS was to
get rid of redundancy -- the mantra is "one fact, one time, one way,
one place!" and not "Let's make ten copies and try to keep them all the
same!" Instead of making ten copies of a mag tape with the same data,
we use VIEWs, CTE, and derived tables in SQL.
You did know that a row is not a record in your posting or understand
transactions, makes me wonder if your schema is messed up because you
are mimicing files.|||Dan Guzman (guzmanda@.nospam-online.sbcglobal.net) writes:
> To add to the other responses, consider adding SET XACT_ABORT ON to the
> beginning of your proc. This will ensure a transaction rollback occurs in
> the case of a client-initiated attention event (e.g. query timeout or
> cancel).
Very interesting! I did not know about this. This can be a quick fix
for applications that suffers from unhandled query timeouts.
Why did you not tell me this before? :-)
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|||> Very interesting! I did not know about this. This can be a quick fix
> for applications that suffers from unhandled query timeouts.
We did exactly that recently for one of our ADO middle-tier database
application with persistent db connections. All transactions were done in
stored procedure code (no nested procs) and the application performed no
explicit transaction handling and no special database exception handling.
Database errors were logged but the app moved on, oblivious to the
ramifications.
Everything was fine until a nightly job was accidentally run during the day
and that caused blocking and subsequent command timeouts. Because the app
performed no connection cleanup after the exception, a transaction that was
in progress remained open after the timeout. All subsequent work done on a
problem connection was done in the context the open transaction and was
never committed!
In addition to adding XACT_ABORT ON quick fix, I asked the developers to
close and re-open persistent connections following any type of database
exception.

> Why did you not tell me this before? :-)
I got the idea to try XACT_ABORT ON after perusing your error handling
articles. Somehow, I got it in my mind that this technique was covered
there ;-)
Hope this helps.
Dan Guzman
SQL Server MVP
"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns97ED135AF6FCYazorman@.127.0.0.1...
> Dan Guzman (guzmanda@.nospam-online.sbcglobal.net) writes:
> Very interesting! I did not know about this. This can be a quick fix
> for applications that suffers from unhandled query timeouts.
> Why did you not tell me this before? :-)
>
> --
> 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|||Dan Guzman (guzmanda@.nospam-online.sbcglobal.net) writes:
> Everything was fine until a nightly job was accidentally run during the
> day and that caused blocking and subsequent command timeouts. Because
> the app performed no connection cleanup after the exception, a
> transaction that was in progress remained open after the timeout. All
> subsequent work done on a problem connection was done in the context the
> open transaction and was never committed!
A really fine mess! Yes, we have experienced this in our application as
well, although that's many years behind us now. I wonder how much the
default timeout of 30 seconds have cost enterprises over the worldin
money and misery.

> In addition to adding XACT_ABORT ON quick fix, I asked the developers to
> close and re-open persistent connections following any type of database
> exception.
While better than nothing, it's not optimal, unless you already have
turned off connection pooling. Of course, if you close and reconnect
directly, and get back the same physical connection directly, everything
will be cleaned up on the spot. But if the pool gives you a different
connection, it could take 60 seconds before the rollback occurs, when
the API actually closes the connection.

> I got the idea to try XACT_ABORT ON after perusing your error handling
> articles. Somehow, I got it in my mind that this technique was covered
> there ;-)
In that case, I don't know that I write in my articles myself. But I
will have to add it!
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

Monday, March 12, 2012

Multiple Databases on SQL

I'm a SQL newbie, so please be kind. I have just recently installed SQL as a
part of a new accounting/project management/CRM app that is Very Important to
the company. It's performance is vital. I want to install an email archiving
solution which uses SQL as the backend, but I'm wondering what sort of
performance hit SQL takes when you start loading databases on it.
It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1 Xeon
3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
processors wouldn't improve performance. Is that true? How much load can SQL
stand before showing performance degradation? What should I look for on the
server? Processor cycles, disk reads? IS this an adequate machine for running
the two apps I describe? We are a 125 person company with our own Exchange
server.
Thanks for any info that's forthcoming.
> even a single query can be paralized over several processors.
Paralized (paralyzed) means the opposite of what you're trying to say, I
think.
;-)
How about parallelized?
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:5E7AC07B-52B5-4354-9066-1AF25AB6023E@.microsoft.com...
> No, that is not true. SQL Server has many threads, and even a single query
> can be paralized over several processors.
> It is impossible to say how much machine you need for "two applications",
> since each application is different. You can look at resource usage for
> your current app (memory, disk, network, processor) and try to determine
> whether you have resources left for the other app. You would of course
> need to know about resource usage for that other app in order to know
> whether it will fit.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
> news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
>
|||> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
> Xeon
> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
> processors wouldn't improve performance. Is
To add on the other responses, SQL Server can also use multiple processors
to process multiple queries concurrently. This is especially important in
an environment with many concurrent users and/or long- running queries.
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
"maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
> I'm a SQL newbie, so please be kind. I have just recently installed SQL as
> a
> part of a new accounting/project management/CRM app that is Very Important
> to
> the company. It's performance is vital. I want to install an email
> archiving
> solution which uses SQL as the backend, but I'm wondering what sort of
> performance hit SQL takes when you start loading databases on it.
> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
> Xeon
> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
> processors wouldn't improve performance. Is that true? How much load can
> SQL
> stand before showing performance degradation? What should I look for on
> the
> server? Processor cycles, disk reads? IS this an adequate machine for
> running
> the two apps I describe? We are a 125 person company with our own Exchange
> server.
> Thanks for any info that's forthcoming.
|||I even wrote a blog post about getting this word wrong, whether is
misspelling or misspeaking...
http://sqlblog.com/blogs/kalen_delaney/archive/2007/07/29/geek-city-total-paralysis.aspx
:-)
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:6702E3AB-59D3-46A0-9A31-A0C509659B66@.microsoft.com...
> Yep, that was the one I was thinking of. Thanks.
> This is one of those I never seem to get the right spelling for. My spell
> check found this type, but my finger pressed "Ignore" and it got sent
> before it reached my brain-cells. :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:u0hQEVHcIHA.5712@.TK2MSFTNGP04.phx.gbl...
>
|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in news:5E7AC07B-52B5-4354-9066-1AF25AB6023E@.microsoft.com:

> No, that is not true. SQL Server has many threads, and even a single
> query can be paralized over several processors.
I agree with Tibor. My servers are often paralized.
Thanks for all your input over the years Tibor, but I couldn't resist.
|||Thanks to all of you who responded. Obviously, I got some bad info. Thanks
for clearing that up.
"Dan Guzman" wrote:

> To add on the other responses, SQL Server can also use multiple processors
> to process multiple queries concurrently. This is especially important in
> an environment with many concurrent users and/or long- running queries.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
> "maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
> news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
>

Multiple Databases on SQL

I'm a SQL newbie, so please be kind. I have just recently installed SQL as a
part of a new accounting/project management/CRM app that is Very Important to
the company. It's performance is vital. I want to install an email archiving
solution which uses SQL as the backend, but I'm wondering what sort of
performance hit SQL takes when you start loading databases on it.
It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1 Xeon
3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
processors wouldn't improve performance. Is that true? How much load can SQL
stand before showing performance degradation? What should I look for on the
server? Processor cycles, disk reads? IS this an adequate machine for running
the two apps I describe? We are a 125 person company with our own Exchange
server.
Thanks for any info that's forthcoming.> I was told that SQL is not multi threaded, so adding
> processors wouldn't improve performance. Is that true?
No, that is not true. SQL Server has many threads, and even a single query can be paralized over
several processors.
It is impossible to say how much machine you need for "two applications", since each application is
different. You can look at resource usage for your current app (memory, disk, network, processor)
and try to determine whether you have resources left for the other app. You would of course need to
know about resource usage for that other app in order to know whether it will fit.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
> I'm a SQL newbie, so please be kind. I have just recently installed SQL as a
> part of a new accounting/project management/CRM app that is Very Important to
> the company. It's performance is vital. I want to install an email archiving
> solution which uses SQL as the backend, but I'm wondering what sort of
> performance hit SQL takes when you start loading databases on it.
> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1 Xeon
> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
> processors wouldn't improve performance. Is that true? How much load can SQL
> stand before showing performance degradation? What should I look for on the
> server? Processor cycles, disk reads? IS this an adequate machine for running
> the two apps I describe? We are a 125 person company with our own Exchange
> server.
> Thanks for any info that's forthcoming.|||> even a single query can be paralized over several processors.
Paralized (paralyzed) means the opposite of what you're trying to say, I
think.
;-)
How about parallelized?
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:5E7AC07B-52B5-4354-9066-1AF25AB6023E@.microsoft.com...
>> I was told that SQL is not multi threaded, so adding
>> processors wouldn't improve performance. Is that true?
> No, that is not true. SQL Server has many threads, and even a single query
> can be paralized over several processors.
> It is impossible to say how much machine you need for "two applications",
> since each application is different. You can look at resource usage for
> your current app (memory, disk, network, processor) and try to determine
> whether you have resources left for the other app. You would of course
> need to know about resource usage for that other app in order to know
> whether it will fit.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
> news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
>> I'm a SQL newbie, so please be kind. I have just recently installed SQL
>> as a
>> part of a new accounting/project management/CRM app that is Very
>> Important to
>> the company. It's performance is vital. I want to install an email
>> archiving
>> solution which uses SQL as the backend, but I'm wondering what sort of
>> performance hit SQL takes when you start loading databases on it.
>> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
>> Xeon
>> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
>> processors wouldn't improve performance. Is that true? How much load can
>> SQL
>> stand before showing performance degradation? What should I look for on
>> the
>> server? Processor cycles, disk reads? IS this an adequate machine for
>> running
>> the two apps I describe? We are a 125 person company with our own
>> Exchange
>> server.
>> Thanks for any info that's forthcoming.
>|||> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
> Xeon
> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
> processors wouldn't improve performance. Is
To add on the other responses, SQL Server can also use multiple processors
to process multiple queries concurrently. This is especially important in
an environment with many concurrent users and/or long- running queries.
--
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
"maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
> I'm a SQL newbie, so please be kind. I have just recently installed SQL as
> a
> part of a new accounting/project management/CRM app that is Very Important
> to
> the company. It's performance is vital. I want to install an email
> archiving
> solution which uses SQL as the backend, but I'm wondering what sort of
> performance hit SQL takes when you start loading databases on it.
> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
> Xeon
> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
> processors wouldn't improve performance. Is that true? How much load can
> SQL
> stand before showing performance degradation? What should I look for on
> the
> server? Processor cycles, disk reads? IS this an adequate machine for
> running
> the two apps I describe? We are a 125 person company with our own Exchange
> server.
> Thanks for any info that's forthcoming.|||> How about parallelized?
Yep, that was the one I was thinking of. Thanks.
This is one of those I never seem to get the right spelling for. My spell check found this type, but
my finger pressed "Ignore" and it got sent before it reached my brain-cells. :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:u0hQEVHcIHA.5712@.TK2MSFTNGP04.phx.gbl...
>> even a single query can be paralized over several processors.
> Paralized (paralyzed) means the opposite of what you're trying to say, I think.
> ;-)
> How about parallelized?
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.InsideSQLServer.com
> http://blog.kalendelaney.com
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:5E7AC07B-52B5-4354-9066-1AF25AB6023E@.microsoft.com...
>> I was told that SQL is not multi threaded, so adding
>> processors wouldn't improve performance. Is that true?
>> No, that is not true. SQL Server has many threads, and even a single query can be paralized over
>> several processors.
>> It is impossible to say how much machine you need for "two applications", since each application
>> is different. You can look at resource usage for your current app (memory, disk, network,
>> processor) and try to determine whether you have resources left for the other app. You would of
>> course need to know about resource usage for that other app in order to know whether it will fit.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
>> news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
>> I'm a SQL newbie, so please be kind. I have just recently installed SQL as a
>> part of a new accounting/project management/CRM app that is Very Important to
>> the company. It's performance is vital. I want to install an email archiving
>> solution which uses SQL as the backend, but I'm wondering what sort of
>> performance hit SQL takes when you start loading databases on it.
>> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1 Xeon
>> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
>> processors wouldn't improve performance. Is that true? How much load can SQL
>> stand before showing performance degradation? What should I look for on the
>> server? Processor cycles, disk reads? IS this an adequate machine for running
>> the two apps I describe? We are a 125 person company with our own Exchange
>> server.
>> Thanks for any info that's forthcoming.
>|||I even wrote a blog post about getting this word wrong, whether is
misspelling or misspeaking...
http://sqlblog.com/blogs/kalen_delaney/archive/2007/07/29/geek-city-total-paralysis.aspx
:-)
--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://blog.kalendelaney.com
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:6702E3AB-59D3-46A0-9A31-A0C509659B66@.microsoft.com...
>> How about parallelized?
> Yep, that was the one I was thinking of. Thanks.
> This is one of those I never seem to get the right spelling for. My spell
> check found this type, but my finger pressed "Ignore" and it got sent
> before it reached my brain-cells. :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:u0hQEVHcIHA.5712@.TK2MSFTNGP04.phx.gbl...
>> even a single query can be paralized over several processors.
>> Paralized (paralyzed) means the opposite of what you're trying to say, I
>> think.
>> ;-)
>> How about parallelized?
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>> www.InsideSQLServer.com
>> http://blog.kalendelaney.com
>>
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
>> in message news:5E7AC07B-52B5-4354-9066-1AF25AB6023E@.microsoft.com...
>> I was told that SQL is not multi threaded, so adding
>> processors wouldn't improve performance. Is that true?
>> No, that is not true. SQL Server has many threads, and even a single
>> query can be paralized over several processors.
>> It is impossible to say how much machine you need for "two
>> applications", since each application is different. You can look at
>> resource usage for your current app (memory, disk, network, processor)
>> and try to determine whether you have resources left for the other app.
>> You would of course need to know about resource usage for that other app
>> in order to know whether it will fit.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
>> news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
>> I'm a SQL newbie, so please be kind. I have just recently installed SQL
>> as a
>> part of a new accounting/project management/CRM app that is Very
>> Important to
>> the company. It's performance is vital. I want to install an email
>> archiving
>> solution which uses SQL as the backend, but I'm wondering what sort of
>> performance hit SQL takes when you start loading databases on it.
>> It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
>> Xeon
>> 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so
>> adding
>> processors wouldn't improve performance. Is that true? How much load
>> can SQL
>> stand before showing performance degradation? What should I look for on
>> the
>> server? Processor cycles, disk reads? IS this an adequate machine for
>> running
>> the two apps I describe? We are a 125 person company with our own
>> Exchange
>> server.
>> Thanks for any info that's forthcoming.
>>
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in news:5E7AC07B-52B5-4354-9066-1AF25AB6023E@.microsoft.com:
> No, that is not true. SQL Server has many threads, and even a single
> query can be paralized over several processors.
I agree with Tibor. My servers are often paralized.
Thanks for all your input over the years Tibor, but I couldn't resist.|||> Thanks for all your input over the years Tibor, but I couldn't resist.
I don't mind. Glad I've been of some help.
:-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"David Henson" <dhenson@.certifiednetworks.com> wrote in message
news:Xns9A465E020FBBCdhensoncertifiednetw@.64.74.227.2...
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in news:5E7AC07B-52B5-4354-9066-1AF25AB6023E@.microsoft.com:
>> No, that is not true. SQL Server has many threads, and even a single
>> query can be paralized over several processors.
> I agree with Tibor. My servers are often paralized.
>
> Thanks for all your input over the years Tibor, but I couldn't resist.|||Thanks to all of you who responded. Obviously, I got some bad info. Thanks
for clearing that up.
"Dan Guzman" wrote:
> > It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
> > Xeon
> > 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
> > processors wouldn't improve performance. Is
> To add on the other responses, SQL Server can also use multiple processors
> to process multiple queries concurrently. This is especially important in
> an environment with many concurrent users and/or long- running queries.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
> "maitakeboy" <maitakeboy@.discussions.microsoft.com> wrote in message
> news:229F4810-47CD-4155-8C84-E45A3579C7BC@.microsoft.com...
> > I'm a SQL newbie, so please be kind. I have just recently installed SQL as
> > a
> > part of a new accounting/project management/CRM app that is Very Important
> > to
> > the company. It's performance is vital. I want to install an email
> > archiving
> > solution which uses SQL as the backend, but I'm wondering what sort of
> > performance hit SQL takes when you start loading databases on it.
> > It is SQL 2005 on a Server 2003 (32-bit) machine (Proliant DL380 G4, 1
> > Xeon
> > 3Ghz proc, 4 GB RAM. I was told that SQL is not multi threaded, so adding
> > processors wouldn't improve performance. Is that true? How much load can
> > SQL
> > stand before showing performance degradation? What should I look for on
> > the
> > server? Processor cycles, disk reads? IS this an adequate machine for
> > running
> > the two apps I describe? We are a 125 person company with our own Exchange
> > server.
> > Thanks for any info that's forthcoming.
>

Wednesday, March 7, 2012

Multiple configuration question

Hi,

I have an analysis project with 4 configurations

- Development

- Test

- Acceptance

- Production

In each configuration I have set correctly the deployement server.

But the datasources are also dependend of the configuration.

So how can I specify different datasources for each configuration ?

With regards,

Constantijn Enders

The ConnectionString of a DataSource is per configuration. To set it, use the DataSource dialog in each configuration.

These are all the properties that can be customized per configuration:

ReportServer of ReportAction objects Path of ReportAction objects StorageLocation of Cube objects ConnectionString of DataSource objects ManagedProvider of DataSource objects KeyErrorLogFile of ErrorConfiguration objects (used in Dimensions, Cubes, MeasureGroups, Partitions and MiningStructures) StorageLocation of MeasureGroup objects StorageLocation of Partition objects|||

Great, it works.

Thanks

CE

Multiple Columns Map to Different Rows in Join Table

Can a SQL statement be written that returns all of the information in
the Project table and the corresponding FullName for both the
CreatedBy and LastModifiedBy fields? Table structures are below.
A typical JOIN clause seems insufficient because every row in the
Project table maps to 2 rows in the User table. When doing reporting,
I've always avoided this problem by using subreports to do individual
lookups. However, I'm curious to see if there is a more direct
approach using SQL only.
Project
- ProjectNo
- ProjectName
- CreatedByUserNo
- LastModifiedByUserNo
User
- UserNo
- FullName
Your input is greatly appreciated.
Best Regards,
DavidSELECT P.projectno, P.projectname,
C.fullname AS createdbyuser,
M.fullname AS lastmodifiedbyuser
FROM Project AS P
JOIN User AS C
ON P.createdbyuserno = C.userno
LEFT JOIN User AS M
ON P.lastmodifiedbyuserno = M.userno
(untested)
--
David Portas
--
Please reply only to the newsgroup
--