Tuesday, March 27, 2012
Do Linked Servers REQUIRE SA rights
user. This user only has permission to select data from several tables.
When I attempt to query the remote server I receive following message:
Access to the remote server is denied because no log in-mapping exists.
However when I grant the user SA rights on the local server that user
is able to query the data.
Any thoughts ?Accessing a linked server doesn't necessarily require
someone to be a member of the sysadmins role. You need to
check the login mapping as the error suggests - look at the
security tab for the linked server.
-Sue
On 8 Jun 2005 12:41:48 -0700, "Rafet Ducic"
<rducic@.gmail.com> wrote:
>I am trying to set up a linked server, and one of the user is a SQL
>user. This user only has permission to select data from several tables.
>
>When I attempt to query the remote server I receive following message:
>Access to the remote server is denied because no log in-mapping exists.
>
>However when I grant the user SA rights on the local server that user
>is able to query the data.
>Any thoughts ?
Do I need to start the service..
I am providing a UI in my application (which uses MSDE) for the user to back
up/restore the application database. Today I tried to test it and it didn't
work complaining that sql server does not exist. I checked and saw that I
had not started the MSSQL$M
yApp service.. when I started it, the backup and restore started working fin
e. So does that mean that I have to programatically start the service in my
app before backup/restore. Generally my application does not need to start
the service while talking
to the database.
ThanksIf you set the service to automatic, it will start when the computer
starts. There is always a possibility that it will get stopped manually. So
you could check to see if it is started in your app and if not start it.
Rand
This posting is provided "as is" with no warranties and confers no rights.
Do I need to start the service..
I am providing a UI in my application (which uses MSDE) for the user to backup/restore the application database. Today I tried to test it and it didn't work complaining that sql server does not exist. I checked and saw that I had not started the MSSQL$M
yApp service.. when I started it, the backup and restore started working fine. So does that mean that I have to programatically start the service in my app before backup/restore. Generally my application does not need to start the service while talking
to the database.
Thanks
If you set the service to automatic, it will start when the computer
starts. There is always a possibility that it will get stopped manually. So
you could check to see if it is started in your app and if not start it.
Rand
This posting is provided "as is" with no warranties and confers no rights.
Sunday, March 25, 2012
Do I need to add users for window Authentication?
authentication, do I add user through enterprise manager under Security tab
and logins. I want my user on my asp.net to login and connect to sql server,
but I windows Authentication. I don't want to add every single user. I'm I
on the right track?
thanks
Nick
Nick wrote:
> I am trying to wrap the Windows Authentication in my brain. If I use
> window authentication, do I add user through enterprise manager under
> Security tab and logins. I want my user on my asp.net to login and
> connect to sql server, but I windows Authentication. I don't want
> to add every single user. I'm I on the right track?
> thanks
> Nick
You can add a Windows Group that contains all the users.
David Gugick
Quest Software
www.imceda.com
www.quest.com
Do I need to add users for window Authentication?
authentication, do I add user through enterprise manager under Security tab
and logins. I want my user on my asp.net to login and connect to sql server
,
but I windows Authentication. I don't want to add every single user. I'm
I
on the right track?
thanks
NickNick wrote:
> I am trying to wrap the Windows Authentication in my brain. If I use
> window authentication, do I add user through enterprise manager under
> Security tab and logins. I want my user on my asp.net to login and
> connect to sql server, but I windows Authentication. I don't want
> to add every single user. I'm I on the right track?
> thanks
> Nick
You can add a Windows Group that contains all the users.
David Gugick
Quest Software
www.imceda.com
www.quest.comsql
Do I need to add users for window Authentication?
authentication, do I add user through enterprise manager under Security tab
and logins. I want my user on my asp.net to login and connect to sql server,
but I windows Authentication. I don't want to add every single user. I'm I
on the right track?
thanks
NickNick wrote:
> I am trying to wrap the Windows Authentication in my brain. If I use
> window authentication, do I add user through enterprise manager under
> Security tab and logins. I want my user on my asp.net to login and
> connect to sql server, but I windows Authentication. I don't want
> to add every single user. I'm I on the right track?
> thanks
> Nick
You can add a Windows Group that contains all the users.
--
David Gugick
Quest Software
www.imceda.com
www.quest.com
Do i need primary key?
I have a table (let's call it tblTest) with 3 fields, UserID, Note,
NoteEnterDate (simple one to many relationship. user can have many notes)
Query would be to join it with user table and get the first and last name of
the user (based on UserID) and show the Note and NoteEnterDate (at this
point, I cannot think of any other query that uses this tblTest other than
this).
As far as index is concerned, I think I just need to create clustered index
on UserID.
I know it is good to declare a primary key for every table. Is there a need
for primary key for tblTest perhaps by adding another field called NoteID?
Thanks"Justin" <jus820@.hotmail.com> wrote in message
news:e4OGN5TbGHA.3812@.TK2MSFTNGP04.phx.gbl...
> Here is the scenario
> I have a table (let's call it tblTest) with 3 fields, UserID, Note,
> NoteEnterDate (simple one to many relationship. user can have many notes)
> Query would be to join it with user table and get the first and last name
> of the user (based on UserID) and show the Note and NoteEnterDate (at this
> point, I cannot think of any other query that uses this tblTest other than
> this).
> As far as index is concerned, I think I just need to create clustered
> index on UserID.
> I know it is good to declare a primary key for every table. Is there a
> need for primary key for tblTest perhaps by adding another field called
> NoteID?
>
Would you allow the same (UserID,Note,NoteEnterDate) to be entered twice?
If so, add a synthetic NoteID to tell them apart. If not, create the PK on
(UserID, NoteEnterDate,Note).
David|||you don 't need to waste the space on another column, if the noteid is not
having significance. and if you are going to use an identity for it then its
of no use at all.
u can use user ID and NoteEnterDate as the primary key.
Hope this helps.
--
"Justin" wrote:
> Here is the scenario
> I have a table (let's call it tblTest) with 3 fields, UserID, Note,
> NoteEnterDate (simple one to many relationship. user can have many notes)
> Query would be to join it with user table and get the first and last name
of
> the user (based on UserID) and show the Note and NoteEnterDate (at this
> point, I cannot think of any other query that uses this tblTest other than
> this).
> As far as index is concerned, I think I just need to create clustered inde
x
> on UserID.
> I know it is good to declare a primary key for every table. Is there a ne
ed
> for primary key for tblTest perhaps by adding another field called NoteID?
> Thanks
>
>|||NoteEnterDate is smalldatetime datatype (since we don't basically care about
the seconds). User can type more than one note in a minute. If I create
primary key on UserID and NoteEnterDate, this is not allowed.
Even even if this was not allowed (creating more than one notes in a
minute), what would be the point of creating primary key on UserID,
NoteEnterDate?
Thanks
"Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
news:0F05A821-5FFD-4A20-97E2-301565FFA187@.microsoft.com...
> you don 't need to waste the space on another column, if the noteid is not
> having significance. and if you are going to use an identity for it then
> its
> of no use at all.
> u can use user ID and NoteEnterDate as the primary key.
> Hope this helps.
> --
>
>
> "Justin" wrote:
>|||> Even even if this was not allowed (creating more than one notes in a
> minute), what would be the point of creating primary key on UserID,
> NoteEnterDate?
Maybe to prevent someone hitting refresh on your web page, 80 times in a
minute, and populating your table with redundant data.
A|||> you don 't need to waste the space on another column, if the noteid is not
> having significance. and if you are going to use an identity for it then
> its
> of no use at all.
I don't think I particularly agree. What harm does an IDENTITY column do?
I don't think it's as horrible as you make it out to be. The OP doesn't
know all future requirements now, so we can't really gauge its significance,
but let's say you wanted to track notes for some reason (e.g. show who has
viewed them and when). You might create another table called:
CREATE TABLE dbo.NoteTracking
(
? FOREIGN KEY REFERENCES dbo.tblTest(?),
ViewDate SMALLDATETIME
)
Surely you don't suggest it would be better to make up this primary key
UserID,NoteEnterDate and use that as your reference in the secondary table?
Like the OP, I'm not clear on what business sense a primary key on
UserID,NoteEnterDate would make, other than to fulfill the mantra "every
table must have a primary key." If it really is possible (and even
desirable) for a single user to enter two notes in one minute, then we're
back at square one.
A|||All tables must have at least one set of columns that can invariably
identify every row in the table. And there are obvious practical reasons to
explicitly declare one of those sets of columns as the primary key.
Anithsql
Thursday, March 22, 2012
Do i have SP1?
There is no "Prompt the User" checkbox for my parameters. The version number
for my RD is: Version 8.00.878.00.
Can anyone tell from that whether im SP1 or not?
TIA,
BrianThat is SP1. Did you install both at the designer client and at the server?
It needs to be installed both places. To check the version of the server do
this:
http://servername/Reportserver
Bruce L-C
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> I thought i'd upgraded my Report Designer for SP1, but now i'm not so
sure.
> There is no "Prompt the User" checkbox for my parameters. The version
number
> for my RD is: Version 8.00.878.00.
> Can anyone tell from that whether im SP1 or not?
> TIA,
> Brian
>|||Report Server is showing the same version number. I should have a checkbox
which says "Prompt Users" when defining parameters, correct?
"Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:edO%23WwzaEHA.1764@.TK2MSFTNGP10.phx.gbl...
> That is SP1. Did you install both at the designer client and at the
server?
> It needs to be installed both places. To check the version of the server
do
> this:
> http://servername/Reportserver
> Bruce L-C
> "G" <brian.grant@.si-intl-kc.com> wrote in message
> news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> > I thought i'd upgraded my Report Designer for SP1, but now i'm not so
> sure.
> > There is no "Prompt the User" checkbox for my parameters. The version
> number
> > for my RD is: Version 8.00.878.00.
> >
> > Can anyone tell from that whether im SP1 or not?
> >
> > TIA,
> > Brian
> >
> >
>|||Someone else will have to jump in. This SP1 feature is not one I have tried
to use.
Bruce L-C
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:OvcJeK0aEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Report Server is showing the same version number. I should have a checkbox
> which says "Prompt Users" when defining parameters, correct?
>
> "Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:edO%23WwzaEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > That is SP1. Did you install both at the designer client and at the
> server?
> > It needs to be installed both places. To check the version of the server
> do
> > this:
> >
> > http://servername/Reportserver
> >
> > Bruce L-C
> >
> > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> > > I thought i'd upgraded my Report Designer for SP1, but now i'm not so
> > sure.
> > > There is no "Prompt the User" checkbox for my parameters. The version
> > number
> > > for my RD is: Version 8.00.878.00.
> > >
> > > Can anyone tell from that whether im SP1 or not?
> > >
> > > TIA,
> > > Brian
> > >
> > >
> >
> >
>|||I figured it out. As usual, i'm an idiot. I was confusing "Report Manager"
and "Report Designer".
On the report manager, the "Prompt User" box is as plain as the nose on my
face.
"Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:OyxQ2j0aEHA.3892@.TK2MSFTNGP10.phx.gbl...
> Someone else will have to jump in. This SP1 feature is not one I have
tried
> to use.
> Bruce L-C
> "G" <brian.grant@.si-intl-kc.com> wrote in message
> news:OvcJeK0aEHA.2520@.TK2MSFTNGP12.phx.gbl...
> > Report Server is showing the same version number. I should have a
checkbox
> > which says "Prompt Users" when defining parameters, correct?
> >
> >
> >
> > "Bruce Loehle-Conger" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> > news:edO%23WwzaEHA.1764@.TK2MSFTNGP10.phx.gbl...
> > > That is SP1. Did you install both at the designer client and at the
> > server?
> > > It needs to be installed both places. To check the version of the
server
> > do
> > > this:
> > >
> > > http://servername/Reportserver
> > >
> > > Bruce L-C
> > >
> > > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > > news:O4i0sqzaEHA.3988@.tk2msftngp13.phx.gbl...
> > > > I thought i'd upgraded my Report Designer for SP1, but now i'm not
so
> > > sure.
> > > > There is no "Prompt the User" checkbox for my parameters. The
version
> > > number
> > > > for my RD is: Version 8.00.878.00.
> > > >
> > > > Can anyone tell from that whether im SP1 or not?
> > > >
> > > > TIA,
> > > > Brian
> > > >
> > > >
> > >
> > >
> >
> >
>
Do i alsocopy sys dbs when i copy a db to a new disk with 'Att & D
I need to copy a user database from disk E to disk G using the 'attach and
detach' and then take that disk to another server where i will attach the
database. Do i also have to copy the systems databases (Master, MSDB, Model)?
How do i also keep the logins and security features that were on the
databases previously? I cant use 'import and export data' as the other
machine is not on the domain/network.
Thank you in advance
You don't have to.
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
"MittyKom" <MittyKom@.discussions.microsoft.com> wrote in message
news:E7B05938-593E-4F3C-9124-EC9957207120@.microsoft.com...
> Hi all
> I need to copy a user database from disk E to disk G using the 'attach and
> detach' and then take that disk to another server where i will attach the
> database. Do i also have to copy the systems databases (Master, MSDB,
> Model)?
> How do i also keep the logins and security features that were on the
> databases previously? I cant use 'import and export data' as the other
> machine is not on the domain/network.
> Thank you in advance
Do CR/LF get stored in a text column
USE Northwind
GO
CREATE TABLE myTable99 (col1 varchar(8000))
GO
DECLARE @.x varchar(8000)
SELECT @.x = 'Wasted away again in
Margaritaville'
INSERT INTO myTable99 (Col1) SELECT @.x
SELECT @.x
GO
DROP TABLE myTable99
GO|||[QUOTE][SIZE=1]Originally posted by Brett Kaiser
I would say yes...
[/quote
I second that.sql
Monday, March 19, 2012
DMO SQLServer->Connect failed for user name with special characters
If I give a user name or password having special character (mainly
semi-colon) then I cannot connect to the SQL Server. Following is the error:
Login failed for user 'a`~!@.#$%^&*()_+|-=[]'.
TCP Provider: An existing connection was forcibly closed by the
remote host.
Communication link failure
Invalid connection string attribute
However, this error was coming in my Cpp code. I tried with VB, I
works. Also, I got same error from Enterprise Manager.
Is this a defect or known behavior in DMO?
TIA,
AjeyActual user name was a`~!@.#$%^&*()_+|-=[];',./{}:"<>?
"Ajey" <ajey5@.hotmail.com> wrote in message
news:ujnaqXcjFHA.1428@.TK2MSFTNGP10.phx.gbl...
> Hi,
> If I give a user name or password having special character (mainly
> semi-colon) then I cannot connect to the SQL Server. Following is the
> error:
> Login failed for user 'a`~!@.#$%^&*()_+|-=[]'.
> TCP Provider: An existing connection was forcibly closed by the
> remote host.
> Communication link failure
> Invalid connection string attribute
> However, this error was coming in my Cpp code. I tried with VB, I
> works. Also, I got same error from Enterprise Manager.
> Is this a defect or known behavior in DMO?
>
> TIA,
> Ajey
>|||/ is an escape character in cpp, you have to replace / with // in your
string for it to work properly.
hth
--
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Ajey" <ajey5@.hotmail.com> wrote in message
news:OqwRXccjFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Actual user name was a`~!@.#$%^&*()_+|-=[];',./{}:"<>?
> "Ajey" <ajey5@.hotmail.com> wrote in message
> news:ujnaqXcjFHA.1428@.TK2MSFTNGP10.phx.gbl...
>|||I think it's mainly due to semi-colon. The error message displays the user
names till the character before the semi-colon. Also, same username &
password does not work while registering the sql server using Enterprise
Manager or connecting through Query Analyser.
- Ajey
"Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
news:uMKZSCkjFHA.3900@.TK2MSFTNGP10.phx.gbl...
>/ is an escape character in cpp, you have to replace / with // in your
>string for it to work properly.
> hth
> --
> Vikram Vamshi
> Database Engineer
> Eclipsys Corporation
> "Ajey" <ajey5@.hotmail.com> wrote in message
> news:OqwRXccjFHA.3316@.TK2MSFTNGP14.phx.gbl...
>|||Can you post your cpp code that can reproduce the issue?
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Ajey" <ajey5@.hotmail.com> wrote in message
news:uZXxuFojFHA.2644@.TK2MSFTNGP09.phx.gbl...
>I think it's mainly due to semi-colon. The error message displays the user
>names till the character before the semi-colon. Also, same username &
>password does not work while registering the sql server using Enterprise
>Manager or connecting through Query Analyser.
> - Ajey
> "Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
> news:uMKZSCkjFHA.3900@.TK2MSFTNGP10.phx.gbl...
>|||Also try to put quotes around the user name (try both single quotes and
double quotes, one of them should be able to handle special characters)
hth
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Ajey" <ajey5@.hotmail.com> wrote in message
news:uZXxuFojFHA.2644@.TK2MSFTNGP09.phx.gbl...
>I think it's mainly due to semi-colon. The error message displays the user
>names till the character before the semi-colon. Also, same username &
>password does not work while registering the sql server using Enterprise
>Manager or connecting through Query Analyser.
> - Ajey
> "Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
> news:uMKZSCkjFHA.3900@.TK2MSFTNGP10.phx.gbl...
>|||strSQLLoginName = L"abc;xyz"
strSQLLoginPassword = L"abc"
HRESULT hrConnect = spServer->Connect( rkstrCurrentServerName.c_str(),
strSQLLoginName.c_str(), strSQLLoginPassword.c_str() );
This code also gives the same error. Also, if i paste user name as abc;xyz
in Enterprise Manager or Query Analyzer I get the same error.
The same thing works with ADO. I had to just escape the special characters
in the connection string. While can pass the username & password directly to
the ADOConnection->Connect() method. But same is not working on DMO.
Thanks.
- Ajey
"Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
news:OrYsYoujFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Also try to put quotes around the user name (try both single quotes and
> double quotes, one of them should be able to handle special characters)
> hth
> --
> Vikram Vamshi
> Database Engineer
> Eclipsys Corporation
> "Ajey" <ajey5@.hotmail.com> wrote in message
> news:uZXxuFojFHA.2644@.TK2MSFTNGP09.phx.gbl...
>
DMO SQLServer->Connect failed for user name with special characters
If I give a user name or password having special character (mainly
semi-colon) then I cannot connect to the SQL Server. Following is the error:
Login failed for user 'a`~!@.#$%^&*()_+|-=[]'.
TCP Provider: An existing connection was forcibly closed by the
remote host.
Communication link failure
Invalid connection string attribute
However, this error was coming in my Cpp code. I tried with VB, I
works. Also, I got same error from Enterprise Manager.
Is this a defect or known behavior in DMO?
TIA,
Ajey
Actual user name was a`~!@.#$%^&*()_+|-=[];',./{}:"<>?
"Ajey" <ajey5@.hotmail.com> wrote in message
news:ujnaqXcjFHA.1428@.TK2MSFTNGP10.phx.gbl...
> Hi,
> If I give a user name or password having special character (mainly
> semi-colon) then I cannot connect to the SQL Server. Following is the
> error:
> Login failed for user 'a`~!@.#$%^&*()_+|-=[]'.
> TCP Provider: An existing connection was forcibly closed by the
> remote host.
> Communication link failure
> Invalid connection string attribute
> However, this error was coming in my Cpp code. I tried with VB, I
> works. Also, I got same error from Enterprise Manager.
> Is this a defect or known behavior in DMO?
>
> TIA,
> Ajey
>
|||/ is an escape character in cpp, you have to replace / with // in your
string for it to work properly.
hth
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Ajey" <ajey5@.hotmail.com> wrote in message
news:OqwRXccjFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Actual user name was a`~!@.#$%^&*()_+|-=[];',./{}:"<>?
> "Ajey" <ajey5@.hotmail.com> wrote in message
> news:ujnaqXcjFHA.1428@.TK2MSFTNGP10.phx.gbl...
>
|||I think it's mainly due to semi-colon. The error message displays the user
names till the character before the semi-colon. Also, same username &
password does not work while registering the sql server using Enterprise
Manager or connecting through Query Analyser.
- Ajey
"Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
news:uMKZSCkjFHA.3900@.TK2MSFTNGP10.phx.gbl...
>/ is an escape character in cpp, you have to replace / with // in your
>string for it to work properly.
> hth
> --
> Vikram Vamshi
> Database Engineer
> Eclipsys Corporation
> "Ajey" <ajey5@.hotmail.com> wrote in message
> news:OqwRXccjFHA.3316@.TK2MSFTNGP14.phx.gbl...
>
|||Can you post your cpp code that can reproduce the issue?
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Ajey" <ajey5@.hotmail.com> wrote in message
news:uZXxuFojFHA.2644@.TK2MSFTNGP09.phx.gbl...
>I think it's mainly due to semi-colon. The error message displays the user
>names till the character before the semi-colon. Also, same username &
>password does not work while registering the sql server using Enterprise
>Manager or connecting through Query Analyser.
> - Ajey
> "Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
> news:uMKZSCkjFHA.3900@.TK2MSFTNGP10.phx.gbl...
>
|||Also try to put quotes around the user name (try both single quotes and
double quotes, one of them should be able to handle special characters)
hth
Vikram Vamshi
Database Engineer
Eclipsys Corporation
"Ajey" <ajey5@.hotmail.com> wrote in message
news:uZXxuFojFHA.2644@.TK2MSFTNGP09.phx.gbl...
>I think it's mainly due to semi-colon. The error message displays the user
>names till the character before the semi-colon. Also, same username &
>password does not work while registering the sql server using Enterprise
>Manager or connecting through Query Analyser.
> - Ajey
> "Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
> news:uMKZSCkjFHA.3900@.TK2MSFTNGP10.phx.gbl...
>
|||strSQLLoginName = L"abc;xyz"
strSQLLoginPassword = L"abc"
HRESULT hrConnect = spServer->Connect( rkstrCurrentServerName.c_str(),
strSQLLoginName.c_str(), strSQLLoginPassword.c_str() );
This code also gives the same error. Also, if i paste user name as abc;xyz
in Enterprise Manager or Query Analyzer I get the same error.
The same thing works with ADO. I had to just escape the special characters
in the connection string. While can pass the username & password directly to
the ADOConnection->Connect() method. But same is not working on DMO.
Thanks.
- Ajey
"Vikram Vamshi" <vikram.vamshi@.online.eclipsys.com> wrote in message
news:OrYsYoujFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Also try to put quotes around the user name (try both single quotes and
> double quotes, one of them should be able to handle special characters)
> hth
> --
> Vikram Vamshi
> Database Engineer
> Eclipsys Corporation
> "Ajey" <ajey5@.hotmail.com> wrote in message
> news:uZXxuFojFHA.2644@.TK2MSFTNGP09.phx.gbl...
>
Sunday, March 11, 2012
dm query taking long time
I'm running a query (see below) on my development server and its taking around 45 seconds. It hosts 18 user databases ranging from 3 MB to 400 MB. The production server, which is very similar but with only 1 25 MB user database, runs the query in less than 1 second. Both servers have been running on VMWare for almost 1 year with no problems. However last week I applied SP 2 to the development server, and yesterday I applied Critical Update KB934458. The production server is still running SQL Server 2005 Standard SP 1. Other than that, both servers are identical and running Windows 2003 Server Standard SP 1. I'm not seeing this discrepancy with other queries running against user databases.
use MyDatabase
GO
select db_name(database_id) as 'Database', o.name as 'Table',
s.index_id, index_type_desc, alloc_unit_type_desc, index_level, i.name as 'Index Name',
avg_fragmentation_in_percent, fragment_count, avg_fragment_size_in_pages,
page_count, avg_page_space_used_in_percent, record_count,
ghost_record_count, min_record_size_in_bytes, avg_record_size_in_bytes, forwarded_record_count,
schema_id, create_date, modify_date from sys.dm_db_index_physical_stats (null, null, null, null, 'DETAILED') s
join sys.objects o on s.object_id = o.object_id
join sys.indexes i on i.object_id = s.object_id and i.index_id = s.index_id
where db_name(database_id) = 'MyDatabase'
order by avg_fragmentation_in_percent desc
--order by avg_fragment_size_in_pages desc
--order by page_count desc
--order by record_count desc
--order by avg_record_size_in_bytes desc
Alright Chap check this out.
Your dev server has 18 user databases and the
sys.dm_db_index_physical_stats (null, null, null, null, 'DETAILED')
checks all the databases.
replace the first NULL with the DBID of the database mydatabase and try running it again.
Jag
|||Thanks. So, I can consider this to be normal behavior?I reduced the number of user databases from 18 to 9. Now it runs in about 1 second. (Same query, I haven't yet made the change you suggested.) I think its safe to say that this query does not scale!
|||In 'DETAILED mode the dmv will read all pages that are used in a database. In the query that you specified, you indicated that you wanted to walk though all the pages in all the databases that were available on the system. If you have one big database with a lot of data, this command will take a long time because of all the I/O.
If you want faster (but less detailed) results, you can use 'LIMITED' mode.
Thanks,
Wednesday, March 7, 2012
distributor_admin not a local user?
do I go about fixing this?
Thanks for your help,
Stephen
Where is your Distributor? Is it on the Publisher?
Is the Subscriber in the same domain as the Publisher?
How did you configure your Subscriber? Can you go to
Tools-Replication-Configure Publishers, Subscribers, Distributors, click on
the Subscribers tab, and click on the browse button (the three ellipses) to
the right of your server name?
Make sure you are using Impersonate the SQL Server Agent account on the
Publisher if you are in the same domain.
"Stephen A." <stephen.accetta@.honeywell.com> wrote in message
news:B6D49A36-D4D7-4D51-85B5-0BDFEA948056@.microsoft.com...
> The distribution server for my publisher is a live server, and the
publisher is a test server that I wish to make it's own distributor.
Whenever I try to select it as it's own distributor, I get an error that
"distributor_admin" is not a local user. How do I go about fixing this?
> Thanks for your help,
> Stephen
|||>>Where is your Distributor? Is it on the Publisher?
No. The distributor is machine A, the publisher is machine B, I wish to
make machine B it's own distributor
Same segment, but the subscriber (Machine C) is not on any domain, I
registered it by IP address. I'm not having any problems with the
subscriber, merely with making the publisher it's own distributor.
click on
ellipses) to
I'll check, but I think so.
the
I already set up a replication account, I merely wish to make the
publisher it's own distributor.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||The solution is easy!!! Register servers to SQL by using their names
or aliasses. Do not use ip numbers.
distributor_admin
In my connection string as below , i have specified to use the user "sa"
but i am not sure why the error msg says login fail for distributor_admin
the server that i am connecting to is set up as a distirbutor on a local
publisher
strConn = "Provider=SQLOLEDB;Data Source=AAA;InititalCatalog
=master;uid=sa;pwd=XXXX"
appreciate any advice
tks & rdgs
Hi,
is there such a so called default password for this distributor_admin user ?
i can see that in the remote login , the sa is being mapped to the
distributor_admin when i tried to change it , it can be changed but once i
come it again it's still being mapped to distributor_admin
appreciate if someone could help
tks & rdgs
"maxzsim" wrote:
> Hi ,
> In my connection string as below , i have specified to use the user "sa"
> but i am not sure why the error msg says login fail for distributor_admin
> the server that i am connecting to is set up as a distirbutor on a local
> publisher
> strConn = "Provider=SQLOLEDB;Data Source=AAA;InititalCatalog
> =master;uid=sa;pwd=XXXX"
> appreciate any advice
> tks & rdgs
distributor_admin
In my connection string as below , i have specified to use the user "sa"
but i am not sure why the error msg says login fail for distributor_admin
the server that i am connecting to is set up as a distirbutor on a local
publisher
strConn = "Provider=SQLOLEDB;Data Source=AAA;InititalCatalog
=master;uid=sa;pwd=XXXX"
appreciate any advice
tks & rdgsHi,
is there such a so called default password for this distributor_admin user ?
i can see that in the remote login , the sa is being mapped to the
distributor_admin when i tried to change it , it can be changed but once i
come it again it's still being mapped to distributor_admin
appreciate if someone could help
tks & rdgs
"maxzsim" wrote:
> Hi ,
> In my connection string as below , i have specified to use the user "sa"
> but i am not sure why the error msg says login fail for distributor_admin
> the server that i am connecting to is set up as a distirbutor on a local
> publisher
> strConn = "Provider=SQLOLEDB;Data Source=AAA;InititalCatalog
> =master;uid=sa;pwd=XXXX"
> appreciate any advice
> tks & rdgs
distributor_admin
In my connection string as below , i have specified to use the user "sa"
but i am not sure why the error msg says login fail for distributor_admin
the server that i am connecting to is set up as a distirbutor on a local
publisher
strConn = "Provider=SQLOLEDB;Data Source=AAA;InititalCatalog
=master;uid=sa;pwd=XXXX"
appreciate any advice
tks & rdgsHi,
is there such a so called default password for this distributor_admin user ?
i can see that in the remote login , the sa is being mapped to the
distributor_admin when i tried to change it , it can be changed but once i
come it again it's still being mapped to distributor_admin
appreciate if someone could help
tks & rdgs
"maxzsim" wrote:
> Hi ,
> In my connection string as below , i have specified to use the user "sa"
> but i am not sure why the error msg says login fail for distributor_admin
> the server that i am connecting to is set up as a distirbutor on a local
> publisher
> strConn = "Provider=SQLOLEDB;Data Source=AAA;InititalCatalog
> =master;uid=sa;pwd=XXXX"
> appreciate any advice
> tks & rdgs
Sunday, February 19, 2012
distributing a database and creating a new user
I'm new to trans-SQL. I wounder how I can add an user to newly created
database?
I've created a window-application that is using a SQL-database for reading
and storing data.
When I now want to distribute my application I also need to distrubute my
database.
Is the best way of distributing a database through trans-SQL?
Or should I create a new database on my localhost and distribute a backup?
the code I've so far is...
USE master
GO
CREATE DATABASE myTestDB
ON
(NAME = myTestDB_dat,
FILENAME= 'c:\program files\microsoft sql server\mssql\data\myTestDBdat.mdf'
,
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5)
GO
I would like to have an user called "testuser" with password "test"
please help.
Thanks in advanced
Best regards
- Hans -
--
(Have fun programming with ... C#)1. you can add a user using the sp_adduser stored proc
sp_adduser [ @.loginame = ] 'login'
[ , [ @.name_in_db = ] 'user' ]
[ , [ @.grpname = ] 'group' ]
2. or you use an exisiting windows nt account using the so addlogin
sp_adduser [ @.loginame = ] 'login'
[ , [ @.name_in_db = ] 'user' ]
[ , [ @.grpname = ] 'group' ]
3. you can also add a "users" table which contains userinformations such
as userid, name, lastname,etc and the password which you can be hashed using
md5 or sha1 technology of the.net .
In this way you can easily add, remove user or changed their password.
you can make the application or a stored proc to verify if the password is
corerct.
in this approach you will be using a single account to connect to sql server
.
will it will depends on you computing needs
hope it helps
"Hans [DiaGraphIT]" wrote:
> Hi!
> I'm new to trans-SQL. I wounder how I can add an user to newly created
> database?
> I've created a window-application that is using a SQL-database for reading
> and storing data.
> When I now want to distribute my application I also need to distrubute my
> database.
> Is the best way of distributing a database through trans-SQL?
> Or should I create a new database on my localhost and distribute a backup?
> the code I've so far is...
> USE master
> GO
> CREATE DATABASE myTestDB
> ON
> (NAME = myTestDB_dat,
> FILENAME= 'c:\program files\microsoft sql server\mssql\data\myTestDBdat.md
f',
> SIZE = 10,
> MAXSIZE = 50,
> FILEGROWTH = 5)
> GO
> I would like to have an user called "testuser" with password "test"
> please help.
> Thanks in advanced
> --
> Best regards
> - Hans -
> --
> (Have fun programming with ... C#)|||sorry got a little messed up. let me correct my self
for sql user
1. sp_addlogin
Creates a new Microsoft? SQL Server? login that allows a user to connect
to
an instance of SQL Server using SQL Server Authentication.
Syntax
sp_addlogin [ @.loginame = ] 'login'
[ , [ @.passwd = ] 'password' ]
[ , [ @.defdb = ] 'database' ]
[ , [ @.deflanguage = ] 'language' ]
[ , [ @.sid = ] sid ]
[ , [ @.encryptopt = ] 'encryption_option' ]
2. sp_grantlogin for windows account
sp_grantlogin [@.loginame =] 'login'
3. to allow SQL users to use the database you can use
sp_adduser/sp_grantdbaccess
4. to allow Nt users you can use
sp_grantdbaccess
"jose g. de jesus jr mcp, mcdba" wrote:
> 1. you can add a user using the sp_adduser stored proc
> sp_adduser [ @.loginame = ] 'login'
> [ , [ @.name_in_db = ] 'user' ]
> [ , [ @.grpname = ] 'group' ]
> 2. or you use an exisiting windows nt account using the so addlogin
> sp_adduser [ @.loginame = ] 'login'
> [ , [ @.name_in_db = ] 'user' ]
> [ , [ @.grpname = ] 'group' ]
> 3. you can also add a "users" table which contains userinformations such
> as userid, name, lastname,etc and the password which you can be hashed usi
ng
> md5 or sha1 technology of the.net .
> In this way you can easily add, remove user or changed their passwo
rd.
> you can make the application or a stored proc to verify if the password is
> corerct.
> in this approach you will be using a single account to connect to sql serv
er.
> will it will depends on you computing needs
> hope it helps
>
> "Hans [DiaGraphIT]" wrote:
>|||this made sense... Ill try it out first thing tomorrow morning
thank you
Best regards
- Hans -
--
(Have fun programming with ... C#)
"jose g. de jesus jr mcp, mcdba" wrote:
> sorry got a little messed up. let me correct my self
> for sql user
> 1. sp_addlogin
> Creates a new Microsoft? SQL Server? login that allows a user to connec
t to
> an instance of SQL Server using SQL Server Authentication.
> Syntax
> sp_addlogin [ @.loginame = ] 'login'
> [ , [ @.passwd = ] 'password' ]
> [ , [ @.defdb = ] 'database' ]
> [ , [ @.deflanguage = ] 'language' ]
> [ , [ @.sid = ] sid ]
> [ , [ @.encryptopt = ] 'encryption_option' ]
> 2. sp_grantlogin for windows account
> sp_grantlogin [@.loginame =] 'login'
> 3. to allow SQL users to use the database you can use
> sp_adduser/sp_grantdbaccess
> 4. to allow Nt users you can use
> sp_grantdbaccess
>
> "jose g. de jesus jr mcp, mcdba" wrote:
>