Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Friday, March 30, 2012

runtime error 80040e37

hi:

i m new to VB.thatswhy i have some problem in connecting VB with sql server.actually i m able to connect but it would nt run the query,giving me the run time error "invalid object name <tablename>".
in the begining i thought i have probelm with the name but i changed the name.
then i thought it might have something to do with database permissions.i did checke that but for some reason the error would nt go away.
here is the code

Private Sub btnSubmit_Click()

Dim Conn As New ADODB.Connection
Dim RecSet As New ADODB.Recordset
Dim SQLQuery

Fname = txtFname.Text 'getting var from text box
Lname = txtLname.Text

'The database is on romote server

SQLQuery = "Insert into introduction (fname,lname) values ('" & Fname & "','" & Lname & "')"
Conn.Open "Provider=SQLOLEDB.1;UID=someID;PWD=myPWD;Intitial Catalog=test;Data Source=MYserver"
RecSet.Open SQLQuery, Conn

Conn.Close
Set RecSet = Nothing

End Sub

This code runs under a command button click.i m getting the values from the text boxes and try to insert them in the database.but i m getting this weird error.
Please help!!!!Who's the schema owner of your INTRODUCTION table? I suspect it's someone other than DBO.|||...pressed on the button too early :)

Preceed the table name with the schema owner in your INSERT:

insert into user_name.introduction ...|||thanks for prompt reply.but the problem still persists.
i checked on ownership of the table .it is DBO.
any ideas!!|||The problem is, that your SQL statements isn't a query, but a DML statement. How do you expect to get a recordset by issueing an INSERT statement?!

Change your line
RecSet.Open SQLQuery, Conn

into
Conn.Execute SQLQuery

and it will work fine.|||Thanks for ur reply.
i did try that ,change the line to "Conn.Execute SQLQuery",and still its giving me the same error

any other suggestions...|||hi

Actually i solved the problem.it was not working with DSN less connection as i was trying to do.
so i created DSN,test the connection,and then used it in my code,and it worked fine.

although i still dont know why it was not working with DSN less connection. i used the same parameters as i was doing it in DSN less,and it worked.
but hey as long it works i happy.

thanks guys

Runtime error / Do you wish to debug -- Unspecified error

I hope someone can help us....
We have a database that is using SQL7 and
My local pc = WinXP Pro Ver5.1_sp2
Suspect it is a local setting when I connect for remote access
(Have been using VNC and www.gotoassist.com)
I do not get this error on the other workstation or at the server
I do not connect remote access on the other workstation or at the server
Error will go away when restore from backup (bak)
But will reappear when I connect for remote access again
Windows Server2000 / SQL 7
Visual Studio Debugger unknown exception
Stops at following line
document.all.dbNameTag.innerText = objSQLNSContext.GetDisplayName
(GetParameter("SQLNSCookie"))
function main()
{ document.all.lblLoadingDatabaseInformation.innerText = objSQLNSContex
t.
ProvideLocalizedString("sqlmmc.rll", 4051); document.all.dbNameTag.innerText
= objSQLNSContext.GetDisplayName(GetParameter("SQLNSCookie"))
timer1 = window.setInterval("main2()",1,"JScript");
}
Any ideas why this occurs?
It appears in Enterprise manager after disconnecting either remote access
program listed above.Here is somone else that had same problem we found searching for answers...
[Lew Garrett
Thu, 13 Jun 2002 17:57:28 -0700
I have completed Chapter 17 of Beginning Active Server Pages 3.0 and I have
a
problem that I haven't
been able to solve. Any guidance would be appreciated.
I have the Bank.mdf database installed on two different computers, both
running XP Professional.
Both are running SQL-7 server. When I use the Enterprise Manager mmc snapin
to access SQL-7 and
double-click the database 'Bank', an htm file, "C:\mssql7\html\database.htm"
should be loaded into
Internet Explorer and displayed in the display window. On one machine, it
works fine, on the other, I
get an error message -- unidentified error -- and the htm file fails to load
.
I have traced the error to line 361 of the htm file. This line is embedded i
n
a <script> block within the
file. Specifically, the line is part of function main. I have excerpted this
function and pasted it here.
code-
function main() /* from C:\mssql7\html\database.htm */
{
document.all.lblLoadingDatabaseInformation.innerText = objSQLNSContext.
ProvideLocalizedString
("sqlmmc.rll", 4051);
document.all.dbNameTag.innerText = objSQLNSContext.GetDisplayName
(GetParameter
("SQLNSCookie")) /*line 361 */
timer1 = window.setInterval("main2()",1,"JScript");
}
The comments are mine. It seems that the code is failing when it tries to
access the parameter
"SQLNSCookie". Does anyone out there know what this object is and can you
point me toward some
documentation concerning it.
Thanks in advance,
--Lew
Michael V wrote:
>I hope someone can help us....
>We have a database that is using SQL7 and
>My local pc = WinXP Pro Ver5.1_sp2
>Suspect it is a local setting when I connect for remote access
>(Have been using VNC and www.gotoassist.com)
> I do not get this error on the other workstation or at the serv
er
>I do not connect remote access on the other workstation or at the server
>Error will go away when restore from backup (bak)
>But will reappear when I connect for remote access again
> Windows Server2000 / SQL 7
>Visual Studio Debugger unknown exception
>Stops at following line
>document.all.dbNameTag.innerText = objSQLNSContext.GetDisplayName
>(GetParameter("SQLNSCookie"))
>function main()
> { document.all.lblLoadingDatabaseInformation.innerText = objSQLNSCont
ext.
>ProvideLocalizedString("sqlmmc.rll", 4051); document.all.dbNameTag.innerTex
t
>= objSQLNSContext.GetDisplayName(GetParameter("SQLNSCookie"))
> timer1 = window.setInterval("main2()",1,"JScript");
> }
>Any ideas why this occurs?
>It appears in Enterprise manager after disconnecting either remote access
>program listed above.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...onnect/200508/1sql

Runtime error / Do you wish to debug -- Unspecified error

I hope someone can help us....
We have a database that is using SQL7 and
My local pc = WinXP Pro Ver5.1_sp2
Suspect it is a local setting when I connect for remote access
(Have been using VNC and www.gotoassist.com)
I do not get this error on the other workstation or at the server
I do not connect remote access on the other workstation or at the server
Error will go away when restore from backup (bak)
But will reappear when I connect for remote access again
Windows Server2000 / SQL 7
Visual Studio Debugger unknown exception
Stops at following line
document.all.dbNameTag.innerText = objSQLNSContext.GetDisplayName
(GetParameter("SQLNSCookie"))
function main()
{ document.all.lblLoadingDatabaseInformation.innerTe xt = objSQLNSContext.
ProvideLocalizedString("sqlmmc.rll", 4051); document.all.dbNameTag.innerText
= objSQLNSContext.GetDisplayName(GetParameter("SQLNS Cookie"))
timer1 = window.setInterval("main2()",1,"JScript");
}
Any ideas why this occurs?
It appears in Enterprise manager after disconnecting either remote access
program listed above.
Here is somone else that had same problem we found searching for answers...
[Lew Garrett
Thu, 13 Jun 2002 17:57:28 -0700
I have completed Chapter 17 of Beginning Active Server Pages 3.0 and I have a
problem that I haven't
been able to solve. Any guidance would be appreciated.
I have the Bank.mdf database installed on two different computers, both
running XP Professional.
Both are running SQL-7 server. When I use the Enterprise Manager mmc snapin
to access SQL-7 and
double-click the database 'Bank', an htm file, "C:\mssql7\html\database.htm"
should be loaded into
Internet Explorer and displayed in the display window. On one machine, it
works fine, on the other, I
get an error message -- unidentified error -- and the htm file fails to load.
I have traced the error to line 361 of the htm file. This line is embedded in
a <script> block within the
file. Specifically, the line is part of function main. I have excerpted this
function and pasted it here.
code-
function main() /* from C:\mssql7\html\database.htm */
{
document.all.lblLoadingDatabaseInformation.innerTe xt = objSQLNSContext.
ProvideLocalizedString
("sqlmmc.rll", 4051);
document.all.dbNameTag.innerText = objSQLNSContext.GetDisplayName
(GetParameter
("SQLNSCookie")) /*line 361 */
timer1 = window.setInterval("main2()",1,"JScript");
}
The comments are mine. It seems that the code is failing when it tries to
access the parameter
"SQLNSCookie". Does anyone out there know what this object is and can you
point me toward some
documentation concerning it.
Thanks in advance,
--Lew
Michael V wrote:
>I hope someone can help us....
>We have a database that is using SQL7 and
>My local pc = WinXP Pro Ver5.1_sp2
>Suspect it is a local setting when I connect for remote access
>(Have been using VNC and www.gotoassist.com)
> I do not get this error on the other workstation or at the server
>I do not connect remote access on the other workstation or at the server
>Error will go away when restore from backup (bak)
>But will reappear when I connect for remote access again
> Windows Server2000 / SQL 7
>Visual Studio Debugger unknown exception
>Stops at following line
>document.all.dbNameTag.innerText = objSQLNSContext.GetDisplayName
>(GetParameter("SQLNSCookie"))
>function main()
> { document.all.lblLoadingDatabaseInformation.innerTe xt = objSQLNSContext.
>ProvideLocalizedString("sqlmmc.rll", 4051); document.all.dbNameTag.innerText
>= objSQLNSContext.GetDisplayName(GetParameter("SQLNS Cookie"))
> timer1 = window.setInterval("main2()",1,"JScript");
> }
>Any ideas why this occurs?
>It appears in Enterprise manager after disconnecting either remote access
>program listed above.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums...nnect/200508/1

Monday, March 26, 2012

Running Transact-SQL script from SQL server agent with a different account

Hi,
I whised to run a T-SQL script as a SQL server Job that uses a linked
server to connect to a remote DB.
When I run the stored procedure in Query Analyser (with a specified
user) everything works fone but on SQL Agent I have the following
error:
Access to the remote server is denied because the current security
context is not trusted
How can I specify with wich user should the step run? The "run as" list
on Job Step window is disabled. How to use the new credential?
(The user exists on local and remote server).
ThanksHi
You don't say if your SQL Agent Service is running under a domain account or
not? At a guess you are using LOCALSYSTEM? See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
John
"pedro.f.silva@.gmail.com" wrote:
> Hi,
> I whised to run a T-SQL script as a SQL server Job that uses a linked
> server to connect to a remote DB.
> When I run the stored procedure in Query Analyser (with a specified
> user) everything works fone but on SQL Agent I have the following
> error:
> Access to the remote server is denied because the current security
> context is not trusted
> How can I specify with wich user should the step run? The "run as" list
> on Job Step window is disabled. How to use the new credential?
> (The user exists on local and remote server).
> Thanks
>|||It is using LOCALSYSTEM, I think.
But I would like to use a domain account just for this job. Is it
possible?
Why cannot i use "run as" on job step?
I thought that could be done creating a credential and a proxy but SQL
server agent doesn't allow proxys on T-SQL steps.
What can I do?
John Bell escreveu:
> Hi
> You don't say if your SQL Agent Service is running under a domain account or
> not? At a guess you are using LOCALSYSTEM? See
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> John
> "pedro.f.silva@.gmail.com" wrote:
> > Hi,
> >
> > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > server to connect to a remote DB.
> > When I run the stored procedure in Query Analyser (with a specified
> > user) everything works fone but on SQL Agent I have the following
> > error:
> >
> > Access to the remote server is denied because the current security
> > context is not trusted
> >
> > How can I specify with wich user should the step run? The "run as" list
> > on Job Step window is disabled. How to use the new credential?
> >
> > (The user exists on local and remote server).
> >
> > Thanks
> >
> >|||Hi
With a T-SQL step there is a run as user on the avanced options if you are
running xp_cmdshell or a cmdexec then look at xp_sqlagent_proxy_account.
John
"pedro.f.silva@.gmail.com" wrote:
> It is using LOCALSYSTEM, I think.
> But I would like to use a domain account just for this job. Is it
> possible?
> Why cannot i use "run as" on job step?
> I thought that could be done creating a credential and a proxy but SQL
> server agent doesn't allow proxys on T-SQL steps.
> What can I do?
> John Bell escreveu:
> > Hi
> >
> > You don't say if your SQL Agent Service is running under a domain account or
> > not? At a guess you are using LOCALSYSTEM? See
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> >
> > John
> >
> > "pedro.f.silva@.gmail.com" wrote:
> >
> > > Hi,
> > >
> > > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > > server to connect to a remote DB.
> > > When I run the stored procedure in Query Analyser (with a specified
> > > user) everything works fone but on SQL Agent I have the following
> > > error:
> > >
> > > Access to the remote server is denied because the current security
> > > context is not trusted
> > >
> > > How can I specify with wich user should the step run? The "run as" list
> > > on Job Step window is disabled. How to use the new credential?
> > >
> > > (The user exists on local and remote server).
> > >
> > > Thanks
> > >
> > >
>|||I had noticed that there was a "run as" user on advanced options but it
didn't work.
I was expecting it (no working) since there's no place to specify the
user password. How could it run with that identify if I hadn't
specified the password? But there's no place to do it!
John Bell escreveu:
> Hi
> With a T-SQL step there is a run as user on the avanced options if you are
> running xp_cmdshell or a cmdexec then look at xp_sqlagent_proxy_account.
> John
> "pedro.f.silva@.gmail.com" wrote:
> > It is using LOCALSYSTEM, I think.
> >
> > But I would like to use a domain account just for this job. Is it
> > possible?
> >
> > Why cannot i use "run as" on job step?
> >
> > I thought that could be done creating a credential and a proxy but SQL
> > server agent doesn't allow proxys on T-SQL steps.
> >
> > What can I do?
> >
> > John Bell escreveu:
> > > Hi
> > >
> > > You don't say if your SQL Agent Service is running under a domain account or
> > > not? At a guess you are using LOCALSYSTEM? See
> > >
> > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> > >
> > > John
> > >
> > > "pedro.f.silva@.gmail.com" wrote:
> > >
> > > > Hi,
> > > >
> > > > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > > > server to connect to a remote DB.
> > > > When I run the stored procedure in Query Analyser (with a specified
> > > > user) everything works fone but on SQL Agent I have the following
> > > > error:
> > > >
> > > > Access to the remote server is denied because the current security
> > > > context is not trusted
> > > >
> > > > How can I specify with wich user should the step run? The "run as" list
> > > > on Job Step window is disabled. How to use the new credential?
> > > >
> > > > (The user exists on local and remote server).
> > > >
> > > > Thanks
> > > >
> > > >
> >
> >|||Hi
I would suggest that you create an account to use for a service account and
change the service account to be that.
John
"pedro.f.silva@.gmail.com" wrote:
> I had noticed that there was a "run as" user on advanced options but it
> didn't work.
> I was expecting it (no working) since there's no place to specify the
> user password. How could it run with that identify if I hadn't
> specified the password? But there's no place to do it!
>
> John Bell escreveu:
> > Hi
> >
> > With a T-SQL step there is a run as user on the avanced options if you are
> > running xp_cmdshell or a cmdexec then look at xp_sqlagent_proxy_account.
> >
> > John
> >
> > "pedro.f.silva@.gmail.com" wrote:
> >
> > > It is using LOCALSYSTEM, I think.
> > >
> > > But I would like to use a domain account just for this job. Is it
> > > possible?
> > >
> > > Why cannot i use "run as" on job step?
> > >
> > > I thought that could be done creating a credential and a proxy but SQL
> > > server agent doesn't allow proxys on T-SQL steps.
> > >
> > > What can I do?
> > >
> > > John Bell escreveu:
> > > > Hi
> > > >
> > > > You don't say if your SQL Agent Service is running under a domain account or
> > > > not? At a guess you are using LOCALSYSTEM? See
> > > >
> > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> > > >
> > > > John
> > > >
> > > > "pedro.f.silva@.gmail.com" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > > > > server to connect to a remote DB.
> > > > > When I run the stored procedure in Query Analyser (with a specified
> > > > > user) everything works fone but on SQL Agent I have the following
> > > > > error:
> > > > >
> > > > > Access to the remote server is denied because the current security
> > > > > context is not trusted
> > > > >
> > > > > How can I specify with wich user should the step run? The "run as" list
> > > > > on Job Step window is disabled. How to use the new credential?
> > > > >
> > > > > (The user exists on local and remote server).
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > >
> > >
>|||Thanks John.
That works if I want all my Jobs to run with the same user.
Since I only have one it's ok :) - SQL server agent runs with the
account I need to invoke the Stored Procedure.
It would be nice however to be able to run different T-SQL Jobs with
different users.
John Bell escreveu:
> Hi
> I would suggest that you create an account to use for a service account and
> change the service account to be that.
> John
> "pedro.f.silva@.gmail.com" wrote:
> > I had noticed that there was a "run as" user on advanced options but it
> > didn't work.
> >
> > I was expecting it (no working) since there's no place to specify the
> > user password. How could it run with that identify if I hadn't
> > specified the password? But there's no place to do it!
> >
> >
> > John Bell escreveu:
> > > Hi
> > >
> > > With a T-SQL step there is a run as user on the avanced options if you are
> > > running xp_cmdshell or a cmdexec then look at xp_sqlagent_proxy_account.
> > >
> > > John
> > >
> > > "pedro.f.silva@.gmail.com" wrote:
> > >
> > > > It is using LOCALSYSTEM, I think.
> > > >
> > > > But I would like to use a domain account just for this job. Is it
> > > > possible?
> > > >
> > > > Why cannot i use "run as" on job step?
> > > >
> > > > I thought that could be done creating a credential and a proxy but SQL
> > > > server agent doesn't allow proxys on T-SQL steps.
> > > >
> > > > What can I do?
> > > >
> > > > John Bell escreveu:
> > > > > Hi
> > > > >
> > > > > You don't say if your SQL Agent Service is running under a domain account or
> > > > > not? At a guess you are using LOCALSYSTEM? See
> > > > >
> > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> > > > >
> > > > > John
> > > > >
> > > > > "pedro.f.silva@.gmail.com" wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > > > > > server to connect to a remote DB.
> > > > > > When I run the stored procedure in Query Analyser (with a specified
> > > > > > user) everything works fone but on SQL Agent I have the following
> > > > > > error:
> > > > > >
> > > > > > Access to the remote server is denied because the current security
> > > > > > context is not trusted
> > > > > >
> > > > > > How can I specify with wich user should the step run? The "run as" list
> > > > > > on Job Step window is disabled. How to use the new credential?
> > > > > >
> > > > > > (The user exists on local and remote server).
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >|||Hi
I don't know what your job is doing or why it needs to communicate with the
remote server, but it seems to be your only option with your current
implementation. If you used SQL 2005 there are more alternatives.
John
"pedro.f.silva@.gmail.com" wrote:
> Thanks John.
> That works if I want all my Jobs to run with the same user.
> Since I only have one it's ok :) - SQL server agent runs with the
> account I need to invoke the Stored Procedure.
> It would be nice however to be able to run different T-SQL Jobs with
> different users.
>
> John Bell escreveu:
> > Hi
> >
> > I would suggest that you create an account to use for a service account and
> > change the service account to be that.
> >
> > John
> >
> > "pedro.f.silva@.gmail.com" wrote:
> >
> > > I had noticed that there was a "run as" user on advanced options but it
> > > didn't work.
> > >
> > > I was expecting it (no working) since there's no place to specify the
> > > user password. How could it run with that identify if I hadn't
> > > specified the password? But there's no place to do it!
> > >
> > >
> > > John Bell escreveu:
> > > > Hi
> > > >
> > > > With a T-SQL step there is a run as user on the avanced options if you are
> > > > running xp_cmdshell or a cmdexec then look at xp_sqlagent_proxy_account.
> > > >
> > > > John
> > > >
> > > > "pedro.f.silva@.gmail.com" wrote:
> > > >
> > > > > It is using LOCALSYSTEM, I think.
> > > > >
> > > > > But I would like to use a domain account just for this job. Is it
> > > > > possible?
> > > > >
> > > > > Why cannot i use "run as" on job step?
> > > > >
> > > > > I thought that could be done creating a credential and a proxy but SQL
> > > > > server agent doesn't allow proxys on T-SQL steps.
> > > > >
> > > > > What can I do?
> > > > >
> > > > > John Bell escreveu:
> > > > > > Hi
> > > > > >
> > > > > > You don't say if your SQL Agent Service is running under a domain account or
> > > > > > not? At a guess you are using LOCALSYSTEM? See
> > > > > >
> > > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> > > > > >
> > > > > > John
> > > > > >
> > > > > > "pedro.f.silva@.gmail.com" wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > > > > > > server to connect to a remote DB.
> > > > > > > When I run the stored procedure in Query Analyser (with a specified
> > > > > > > user) everything works fone but on SQL Agent I have the following
> > > > > > > error:
> > > > > > >
> > > > > > > Access to the remote server is denied because the current security
> > > > > > > context is not trusted
> > > > > > >
> > > > > > > How can I specify with wich user should the step run? The "run as" list
> > > > > > > on Job Step window is disabled. How to use the new credential?
> > > > > > >
> > > > > > > (The user exists on local and remote server).
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>|||I am using SQL Server 2005 :)
Which alternatives do I have?
John Bell escreveu:
> Hi
> I don't know what your job is doing or why it needs to communicate with the
> remote server, but it seems to be your only option with your current
> implementation. If you used SQL 2005 there are more alternatives.
> John
> "pedro.f.silva@.gmail.com" wrote:
> > Thanks John.
> >
> > That works if I want all my Jobs to run with the same user.
> >
> > Since I only have one it's ok :) - SQL server agent runs with the
> > account I need to invoke the Stored Procedure.
> >
> > It would be nice however to be able to run different T-SQL Jobs with
> > different users.
> >
> >
> > John Bell escreveu:
> > > Hi
> > >
> > > I would suggest that you create an account to use for a service account and
> > > change the service account to be that.
> > >
> > > John
> > >
> > > "pedro.f.silva@.gmail.com" wrote:
> > >
> > > > I had noticed that there was a "run as" user on advanced options but it
> > > > didn't work.
> > > >
> > > > I was expecting it (no working) since there's no place to specify the
> > > > user password. How could it run with that identify if I hadn't
> > > > specified the password? But there's no place to do it!
> > > >
> > > >
> > > > John Bell escreveu:
> > > > > Hi
> > > > >
> > > > > With a T-SQL step there is a run as user on the avanced options if you are
> > > > > running xp_cmdshell or a cmdexec then look at xp_sqlagent_proxy_account.
> > > > >
> > > > > John
> > > > >
> > > > > "pedro.f.silva@.gmail.com" wrote:
> > > > >
> > > > > > It is using LOCALSYSTEM, I think.
> > > > > >
> > > > > > But I would like to use a domain account just for this job. Is it
> > > > > > possible?
> > > > > >
> > > > > > Why cannot i use "run as" on job step?
> > > > > >
> > > > > > I thought that could be done creating a credential and a proxy but SQL
> > > > > > server agent doesn't allow proxys on T-SQL steps.
> > > > > >
> > > > > > What can I do?
> > > > > >
> > > > > > John Bell escreveu:
> > > > > > > Hi
> > > > > > >
> > > > > > > You don't say if your SQL Agent Service is running under a domain account or
> > > > > > > not? At a guess you are using LOCALSYSTEM? See
> > > > > > >
> > > > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> > > > > > >
> > > > > > > John
> > > > > > >
> > > > > > > "pedro.f.silva@.gmail.com" wrote:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > > > > > > > server to connect to a remote DB.
> > > > > > > > When I run the stored procedure in Query Analyser (with a specified
> > > > > > > > user) everything works fone but on SQL Agent I have the following
> > > > > > > > error:
> > > > > > > >
> > > > > > > > Access to the remote server is denied because the current security
> > > > > > > > context is not trusted
> > > > > > > >
> > > > > > > > How can I specify with wich user should the step run? The "run as" list
> > > > > > > > on Job Step window is disabled. How to use the new credential?
> > > > > > > >
> > > > > > > > (The user exists on local and remote server).
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> >
> >|||Hi
Look at the using extensions to the EXECUTE command. But first read
http://www.sommarskog.se/grantperm.html
John
"pedro.f.silva@.gmail.com" wrote:
> I am using SQL Server 2005 :)
> Which alternatives do I have?
> John Bell escreveu:
> > Hi
> >
> > I don't know what your job is doing or why it needs to communicate with the
> > remote server, but it seems to be your only option with your current
> > implementation. If you used SQL 2005 there are more alternatives.
> >
> > John
> >
> > "pedro.f.silva@.gmail.com" wrote:
> >
> > > Thanks John.
> > >
> > > That works if I want all my Jobs to run with the same user.
> > >
> > > Since I only have one it's ok :) - SQL server agent runs with the
> > > account I need to invoke the Stored Procedure.
> > >
> > > It would be nice however to be able to run different T-SQL Jobs with
> > > different users.
> > >
> > >
> > > John Bell escreveu:
> > > > Hi
> > > >
> > > > I would suggest that you create an account to use for a service account and
> > > > change the service account to be that.
> > > >
> > > > John
> > > >
> > > > "pedro.f.silva@.gmail.com" wrote:
> > > >
> > > > > I had noticed that there was a "run as" user on advanced options but it
> > > > > didn't work.
> > > > >
> > > > > I was expecting it (no working) since there's no place to specify the
> > > > > user password. How could it run with that identify if I hadn't
> > > > > specified the password? But there's no place to do it!
> > > > >
> > > > >
> > > > > John Bell escreveu:
> > > > > > Hi
> > > > > >
> > > > > > With a T-SQL step there is a run as user on the avanced options if you are
> > > > > > running xp_cmdshell or a cmdexec then look at xp_sqlagent_proxy_account.
> > > > > >
> > > > > > John
> > > > > >
> > > > > > "pedro.f.silva@.gmail.com" wrote:
> > > > > >
> > > > > > > It is using LOCALSYSTEM, I think.
> > > > > > >
> > > > > > > But I would like to use a domain account just for this job. Is it
> > > > > > > possible?
> > > > > > >
> > > > > > > Why cannot i use "run as" on job step?
> > > > > > >
> > > > > > > I thought that could be done creating a credential and a proxy but SQL
> > > > > > > server agent doesn't allow proxys on T-SQL steps.
> > > > > > >
> > > > > > > What can I do?
> > > > > > >
> > > > > > > John Bell escreveu:
> > > > > > > > Hi
> > > > > > > >
> > > > > > > > You don't say if your SQL Agent Service is running under a domain account or
> > > > > > > > not? At a guess you are using LOCALSYSTEM? See
> > > > > > > >
> > > > > > > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_overview_6k1f.asp
> > > > > > > >
> > > > > > > > John
> > > > > > > >
> > > > > > > > "pedro.f.silva@.gmail.com" wrote:
> > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > I whised to run a T-SQL script as a SQL server Job that uses a linked
> > > > > > > > > server to connect to a remote DB.
> > > > > > > > > When I run the stored procedure in Query Analyser (with a specified
> > > > > > > > > user) everything works fone but on SQL Agent I have the following
> > > > > > > > > error:
> > > > > > > > >
> > > > > > > > > Access to the remote server is denied because the current security
> > > > > > > > > context is not trusted
> > > > > > > > >
> > > > > > > > > How can I specify with wich user should the step run? The "run as" list
> > > > > > > > > on Job Step window is disabled. How to use the new credential?
> > > > > > > > >
> > > > > > > > > (The user exists on local and remote server).
> > > > > > > > >
> > > > > > > > > Thanks
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > >
> > >
>sql

Tuesday, March 20, 2012

Running SQL Server Enterprise 2005 on MS Virtual Server

I keep wondering if this is safe. I am getting errors here and there along with the inability to connect to my database via connection string in ASP.NET no matter if the user has complete permissions or not amongst other difficulties and I wonder if this is causing a lot of the problems. WE are running SQL Server Enterprise 2005 on Microsoft Virtual Server. Is this approved?

Running SQL Server in a virtual machine should work. I do this for scenario testing all the time.

The usual suspects for connectivity problems in virtual machines are whether the virtual network adapter is attached to the host's network adapter (vs. the "local adapter" that can't be seen outside the virtual server environment) and the host's firewall getting in the way of other computer's talking to the virtual machine.

The typical issues with SQL Server connectivity also apply to SQL Servers running in virtual machines. Make sure SQL Server is configured to listen to TCP/IP connections on the virtual network adapter that is mapped to the host's network adapter. Also, make sure that the firewall in your virtual machine is allowing external connections to SQL Server's port.

|||We are running some test environments on Virtual Server.
We haven't experienced any issues so far.

Running sql scripts

How does one run an sql script against a database then using sql management express.

I have the script and i connect to the correct database using the sql management express and execute the script. It even says that it completed successfully. But when i check the database there is nothing new added.

Is it somthing to do with the community preview version of sql management express??

thanks for any help

In Management Studio, the query window (where you run your query) can connect to different SQL instance/database from the Object Explorer (connect to a SQL instance when you open Management Studio). So check the dropdown list on the left of Execute(!) button to make sure your current query is connecting to the right database then execute the script. Before you check changes in the database, right click on the database ->select Refresh, then check the changes.