Showing posts with label showing. Show all posts
Showing posts with label showing. Show all posts

Tuesday, March 27, 2012

adhoc queries

Hello

We got third party software, we are using adhoc queries more for the Applications (i am checking the DB Dashboard, it is showing as 97% CPU for adhoc queries). Could any one suggest how to tune SQL Server (at server level) for adhoc queries, we can not change the code now.

Let me know how to improve the SQL Server, whenever 3rd party applications use adhoc queries more?

Thanks in advance.

You can use DTA for this.

http://msdn2.microsoft.com/en-us/library/ms186354.aspx

You will want to use sql profiler to capture a trace/workload for DTA.

Tuesday, March 6, 2012

Adding Logons

I have transfered databases from one server to another.
All my users are showing up in my databases but there is nothing in the
"Login Name" column. I tried adding in the user in EM in Logins under the
Security folder and that works also. But when I create the user and give it
access to the database, I get an error that says the user already exists.
Now the user is in the Logins and Users section but still no Login Name
showing and you can't logon to the database. But when I drop the user from
the database and add it to the Login User again, it works fine. Do I have
to do this for each user? This is a problem as we have about 15 databases
and about 40 users.
Is there a better way to deal with this?
Thanks,
Tom
On Apr 19, 6:59 pm, "tshad" <t...@.home.com> wrote:
> I have transfered databases from one server to another.
> All my users are showing up in my databases but there is nothing in the
> "Login Name" column. I tried adding in the user in EM in Logins under the
> Security folder and that works also. But when I create the user and give it
> access to the database, I get an error that says the user already exists.
> Now the user is in the Logins and Users section but still no Login Name
> showing and you can't logon to the database. But when I drop the user from
> the database and add it to the Login User again, it works fine. Do I have
> to do this for each user? This is a problem as we have about 15 databases
> and about 40 users.
> Is there a better way to deal with this?
> Thanks,
> Tom
You must have restored the database to new server. The reason you're
having this problem is the SID for login and SID for the user in the
database are different. You have Orphaned Users. Since you have the
login in the server and user in the database you can keep doing what
you're doing remove the user and add the user again. Or you can use
sp_change_users_login. Check the books online for detailed usage of
the system stored proc or you can read the article for how to fix your
problem. Look into Chadmat's last post that has the tsql for
sp_fixusers procedure.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615
Good day,
Bulent
|||"Bulent" <bulentgucuk@.gmail.com> wrote in message
news:1177032504.814702.279020@.n76g2000hsh.googlegr oups.com...
> On Apr 19, 6:59 pm, "tshad" <t...@.home.com> wrote:
> You must have restored the database to new server. The reason you're
> having this problem is the SID for login and SID for the user in the
> database are different. You have Orphaned Users. Since you have the
> login in the server and user in the database you can keep doing what
> you're doing remove the user and add the user again. Or you can use
> sp_change_users_login. Check the books online for detailed usage of
> the system stored proc or you can read the article for how to fix your
> problem. Look into Chadmat's last post that has the tsql for
> sp_fixusers procedure.
> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615
Yes, I did use a new server.
I just installed Sql Server on the new machine (Jupiter). I backed up the
couple of databases I have on my old Server (Venus) and then restored them
on Jupiter.
Can I just backup Master from Venus and restore it to Jupiter. I know that
Master keeps the Logins in its tables. Would this work or would it cause
other problems?
Thanks,
Tom
> Good day,
> Bulent
>
|||"tshad" <t@.home.com> wrote in message
news:%23WQxfu2gHHA.2368@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
> "Bulent" <bulentgucuk@.gmail.com> wrote in message
> news:1177032504.814702.279020@.n76g2000hsh.googlegr oups.com...
This SP did work great, BTW.
But I am still curious about the Master and whether I can or even need to
move it to the new server. As well as what problems I could run into such
as incompatabilities (assuming that the new Sql Server was installed exactly
the same as the old one).
Thanks,
Tom
> Yes, I did use a new server.
> I just installed Sql Server on the new machine (Jupiter). I backed up the
> couple of databases I have on my old Server (Venus) and then restored them
> on Jupiter.
> Can I just backup Master from Venus and restore it to Jupiter. I know
> that Master keeps the Logins in its tables. Would this work or would it
> cause other problems?
> Thanks,
> Tom
>

Adding Logons

I have transfered databases from one server to another.
All my users are showing up in my databases but there is nothing in the
"Login Name" column. I tried adding in the user in EM in Logins under the
Security folder and that works also. But when I create the user and give it
access to the database, I get an error that says the user already exists.
Now the user is in the Logins and Users section but still no Login Name
showing and you can't logon to the database. But when I drop the user from
the database and add it to the Login User again, it works fine. Do I have
to do this for each user? This is a problem as we have about 15 databases
and about 40 users.
Is there a better way to deal with this?
Thanks,
TomOn Apr 19, 6:59 pm, "tshad" <t...@.home.com> wrote:
> I have transfered databases from one server to another.
> All my users are showing up in my databases but there is nothing in the
> "Login Name" column. I tried adding in the user in EM in Logins under the
> Security folder and that works also. But when I create the user and give it
> access to the database, I get an error that says the user already exists.
> Now the user is in the Logins and Users section but still no Login Name
> showing and you can't logon to the database. But when I drop the user from
> the database and add it to the Login User again, it works fine. Do I have
> to do this for each user? This is a problem as we have about 15 databases
> and about 40 users.
> Is there a better way to deal with this?
> Thanks,
> Tom
You must have restored the database to new server. The reason you're
having this problem is the SID for login and SID for the user in the
database are different. You have Orphaned Users. Since you have the
login in the server and user in the database you can keep doing what
you're doing remove the user and add the user again. Or you can use
sp_change_users_login. Check the books online for detailed usage of
the system stored proc or you can read the article for how to fix your
problem. Look into Chadmat's last post that has the tsql for
sp_fixusers procedure.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615
Good day,
Bulent|||"Bulent" <bulentgucuk@.gmail.com> wrote in message
news:1177032504.814702.279020@.n76g2000hsh.googlegroups.com...
> On Apr 19, 6:59 pm, "tshad" <t...@.home.com> wrote:
>> I have transfered databases from one server to another.
>> All my users are showing up in my databases but there is nothing in the
>> "Login Name" column. I tried adding in the user in EM in Logins under
>> the
>> Security folder and that works also. But when I create the user and give
>> it
>> access to the database, I get an error that says the user already exists.
>> Now the user is in the Logins and Users section but still no Login Name
>> showing and you can't logon to the database. But when I drop the user
>> from
>> the database and add it to the Login User again, it works fine. Do I
>> have
>> to do this for each user? This is a problem as we have about 15
>> databases
>> and about 40 users.
>> Is there a better way to deal with this?
>> Thanks,
>> Tom
> You must have restored the database to new server. The reason you're
> having this problem is the SID for login and SID for the user in the
> database are different. You have Orphaned Users. Since you have the
> login in the server and user in the database you can keep doing what
> you're doing remove the user and add the user again. Or you can use
> sp_change_users_login. Check the books online for detailed usage of
> the system stored proc or you can read the article for how to fix your
> problem. Look into Chadmat's last post that has the tsql for
> sp_fixusers procedure.
> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615
Yes, I did use a new server.
I just installed Sql Server on the new machine (Jupiter). I backed up the
couple of databases I have on my old Server (Venus) and then restored them
on Jupiter.
Can I just backup Master from Venus and restore it to Jupiter. I know that
Master keeps the Logins in its tables. Would this work or would it cause
other problems?
Thanks,
Tom
> Good day,
> Bulent
>|||"tshad" <t@.home.com> wrote in message
news:%23WQxfu2gHHA.2368@.TK2MSFTNGP04.phx.gbl...
> "Bulent" <bulentgucuk@.gmail.com> wrote in message
> news:1177032504.814702.279020@.n76g2000hsh.googlegroups.com...
>> On Apr 19, 6:59 pm, "tshad" <t...@.home.com> wrote:
>> I have transfered databases from one server to another.
>> All my users are showing up in my databases but there is nothing in the
>> "Login Name" column. I tried adding in the user in EM in Logins under
>> the
>> Security folder and that works also. But when I create the user and
>> give it
>> access to the database, I get an error that says the user already
>> exists.
>> Now the user is in the Logins and Users section but still no Login Name
>> showing and you can't logon to the database. But when I drop the user
>> from
>> the database and add it to the Login User again, it works fine. Do I
>> have
>> to do this for each user? This is a problem as we have about 15
>> databases
>> and about 40 users.
>> Is there a better way to deal with this?
>> Thanks,
>> Tom
>> You must have restored the database to new server. The reason you're
>> having this problem is the SID for login and SID for the user in the
>> database are different. You have Orphaned Users. Since you have the
>> login in the server and user in the database you can keep doing what
>> you're doing remove the user and add the user again. Or you can use
>> sp_change_users_login. Check the books online for detailed usage of
>> the system stored proc or you can read the article for how to fix your
>> problem. Look into Chadmat's last post that has the tsql for
>> sp_fixusers procedure.
>> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615
This SP did work great, BTW.
But I am still curious about the Master and whether I can or even need to
move it to the new server. As well as what problems I could run into such
as incompatabilities (assuming that the new Sql Server was installed exactly
the same as the old one).
Thanks,
Tom
> Yes, I did use a new server.
> I just installed Sql Server on the new machine (Jupiter). I backed up the
> couple of databases I have on my old Server (Venus) and then restored them
> on Jupiter.
> Can I just backup Master from Venus and restore it to Jupiter. I know
> that Master keeps the Logins in its tables. Would this work or would it
> cause other problems?
> Thanks,
> Tom
>> Good day,
>> Bulent
>

Saturday, February 25, 2012

Adding Logons

I have transfered databases from one server to another.
All my users are showing up in my databases but there is nothing in the
"Login Name" column. I tried adding in the user in EM in Logins under the
Security folder and that works also. But when I create the user and give it
access to the database, I get an error that says the user already exists.
Now the user is in the Logins and Users section but still no Login Name
showing and you can't logon to the database. But when I drop the user from
the database and add it to the Login User again, it works fine. Do I have
to do this for each user? This is a problem as we have about 15 databases
and about 40 users.
Is there a better way to deal with this?
Thanks,
TomOn Apr 19, 6:59 pm, "tshad" <t...@.home.com> wrote:
> I have transfered databases from one server to another.
> All my users are showing up in my databases but there is nothing in the
> "Login Name" column. I tried adding in the user in EM in Logins under the
> Security folder and that works also. But when I create the user and give
it
> access to the database, I get an error that says the user already exists.
> Now the user is in the Logins and Users section but still no Login Name
> showing and you can't logon to the database. But when I drop the user fro
m
> the database and add it to the Login User again, it works fine. Do I have
> to do this for each user? This is a problem as we have about 15 databases
> and about 40 users.
> Is there a better way to deal with this?
> Thanks,
> Tom
You must have restored the database to new server. The reason you're
having this problem is the SID for login and SID for the user in the
database are different. You have Orphaned Users. Since you have the
login in the server and user in the database you can keep doing what
you're doing remove the user and add the user again. Or you can use
sp_change_users_login. Check the books online for detailed usage of
the system stored proc or you can read the article for how to fix your
problem. Look into Chadmat's last post that has the tsql for
sp_fixusers procedure.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615
Good day,
Bulent|||"Bulent" <bulentgucuk@.gmail.com> wrote in message
news:1177032504.814702.279020@.n76g2000hsh.googlegroups.com...
> On Apr 19, 6:59 pm, "tshad" <t...@.home.com> wrote:
> You must have restored the database to new server. The reason you're
> having this problem is the SID for login and SID for the user in the
> database are different. You have Orphaned Users. Since you have the
> login in the server and user in the database you can keep doing what
> you're doing remove the user and add the user again. Or you can use
> sp_change_users_login. Check the books online for detailed usage of
> the system stored proc or you can read the article for how to fix your
> problem. Look into Chadmat's last post that has the tsql for
> sp_fixusers procedure.
> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12615
Yes, I did use a new server.
I just installed Sql Server on the new machine (Jupiter). I backed up the
couple of databases I have on my old Server (Venus) and then restored them
on Jupiter.
Can I just backup Master from Venus and restore it to Jupiter. I know that
Master keeps the Logins in its tables. Would this work or would it cause
other problems?
Thanks,
Tom
> Good day,
> Bulent
>|||"tshad" <t@.home.com> wrote in message
news:%23WQxfu2gHHA.2368@.TK2MSFTNGP04.phx.gbl...
> "Bulent" <bulentgucuk@.gmail.com> wrote in message
> news:1177032504.814702.279020@.n76g2000hsh.googlegroups.com...
This SP did work great, BTW.
But I am still curious about the Master and whether I can or even need to
move it to the new server. As well as what problems I could run into such
as incompatabilities (assuming that the new Sql Server was installed exactly
the same as the old one).
Thanks,
Tom[vbcol=seagreen]
> Yes, I did use a new server.
> I just installed Sql Server on the new machine (Jupiter). I backed up the
> couple of databases I have on my old Server (Venus) and then restored them
> on Jupiter.
> Can I just backup Master from Venus and restore it to Jupiter. I know
> that Master keeps the Logins in its tables. Would this work or would it
> cause other problems?
> Thanks,
> Tom
>

Sunday, February 19, 2012

Adding dates to a matrix

Hi,
I have a matrix showing transactions between two dates. I want to show those
dates to the users in columns. Let's say the user chose all transactions
between 1/1/03 and 30/10/03. How can I add columns to represent all months in
that period (or days, years, etc.)?
ThanksHi G,
If you don't have any data rows for a certain month/day, then it will not
show up in the matrix grouping. To ensure that certain groups/data values
are always present, you will need an outer join in your dataset query e.g.
in case of months with a simple table that just has 12 rows with one column
and values from 1 to 12.
Using parameters makes it a little bit more complex. You could either
integrate modify the outer join query to select only subsets of the table
(and achieve better performance), or you apply filters on the matrix
groupings in RS.
Details on how to use outer joins are available here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_09_0zqr.asp
http://msdn.microsoft.com/library/en-us/acdata/ac_8_qd_09_1h6b.asp
HTH,
Robert
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"G" <G@.discussions.microsoft.com> wrote in message
news:A1D100A0-E235-4EEC-B4F5-22AA80C170B4@.microsoft.com...
> Hi,
> I have a matrix showing transactions between two dates. I want to show
those
> dates to the users in columns. Let's say the user chose all transactions
> between 1/1/03 and 30/10/03. How can I add columns to represent all months
in
> that period (or days, years, etc.)?
> Thanks