Showing posts with label dts. Show all posts
Showing posts with label dts. Show all posts

Tuesday, March 27, 2012

Cannot DTS connect to SQL Server 2005

I have installed SQL Server 2005 Beta 2 on my PC. When I try to make a
connection to it from the DTS environment, I get following error:

=============================================
Could not get server list. (DTS Import/Export Wizard)
=============================================
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied. (Microsoft OLE DB Provider for SQL Server)
------------

Making a connection from within SQL Server Management Studio works fine.
If I try to connect from within a .NET program using SQLConnection, it
fails on the conn.Open() call. But SQL Server Management Studio works
fine.

Has anyone run into this? Could someone please help?

RobIf it works from one application but not from another, then I would
guess that it's an incorrect connection string, the wrong
authentication mode or something similar. There are connection string
samples here:

http://www.able-consulting.com/ADO_Conn.htm

And this KB article covers possible reasons for the error:

http://support.microsoft.com/defaul...306&Product=sql

Simon

Sunday, March 25, 2012

Cannot display/return SQL Query Output from a Variable in DTS

I have been having a very difficult time trying to get the output of a
sql query that is in a dts global variable to return either into a
msgbox or for populating a portion of the body of a mail task.
I created an Execute SQL task with the query I wish to use. The query
has been tested in Query Analyzer and works fine and returns the results
I am looking for. Four rows are returned. Basically, I wish to put these
results in the body of a mail task or right now I would settle for a
msgbox just to see it work.
I have created the Execute SQL task as described in
http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
I have tried to retrieve the results using the example in
http://msdn.microsoft.com/library/d...y/en-us/howtosq
l/ht_dts_task_6llt.asp but I have been unable to do so.
I also tried the GetString method of the recordset without success.
I also tried the using the Storing the resultset in a flat file
example from dotnetbips.com/displayarticle.aspx?id=228 and I was unable
to write the recordset to a file.
I feel like I am going about this all wrong and the answer is just
staring me in the face and I dont get it.
I welcome suggestions and comments on how to achieve the goal of putting
the query results into the email body.
Thanks.
*** Sent via Developersdex http://www.examnotes.net ***Hi
You may want to use call xp_sendmail directly (see Books online) rather than
the DTS Send Mail task. If not this may help:
http://www.sqldts.com/default.aspx?235
John
"SJM" <nospam@.devdex.com> wrote in message
news:O8fvDgusFHA.596@.TK2MSFTNGP12.phx.gbl...
>I have been having a very difficult time trying to get the output of a
> sql query that is in a dts global variable to return either into a
> msgbox or for populating a portion of the body of a mail task.
> I created an Execute SQL task with the query I wish to use. The query
> has been tested in Query Analyzer and works fine and returns the results
> I am looking for. Four rows are returned. Basically, I wish to put these
> results in the body of a mail task or right now I would settle for a
> msgbox just to see it work.
> I have created the Execute SQL task as described in
> http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
> I have tried to retrieve the results using the example in
> http://msdn.microsoft.com/library/d...y/en-us/howtosq
> l/ht_dts_task_6llt.asp but I have been unable to do so.
> I also tried the GetString method of the recordset without success.
> I also tried the using the "Storing the resultset in a flat file"
> example from dotnetbips.com/displayarticle.aspx?id=228 and I was unable
> to write the recordset to a file.
> I feel like I am going about this all wrong and the answer is just
> staring me in the face and I don't get it.
> I welcome suggestions and comments on how to achieve the goal of putting
> the query results into the email body.
> Thanks.
>
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Indeed, I am considering sending the mail from within the script, but
right now I am concentrating on getting the data and other info into the
message body. Thanks for the suggestion.
*** Sent via Developersdex http://www.examnotes.net ***sql

Cannot display/return SQL Query Output from a Dispatch Variable


I have been having a very difficult time trying to get the output of a
sql query that is in a DTS global variable to return, presently to a
messagebox.
I created an Execute SQL task with the query I wish to use. The query
has been tested in Query Analyzer and works fine and returns the results
I am looking for. I set a global variable to the result set. Basically,
I wish to display the results as a string or similar in a messagebox.
I have created the Execute SQL task as described in
http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
I have tried to retrieve the results using the example in
http://msdn.microsoft.com/library/d...y/en-us/howtosq
l/ht_dts_task_6llt.asp but I have been unable to do so.
I also tried the GetString method of the recordset without success.
I also tried the using the Storing the resultset in a flat file
example from http://dotnetbips.com/displayarticle.aspx?id=228 and I was
unable to write the recordset to a file.
What is the proper way to display a variable of type dispatch? I feel
like I am going about this the wrong way.
I welcome suggestions and comments on how to achieve the goal of
displaying the query results.
Thanks.
*** Sent via Developersdex http://www.examnotes.net ***Hi
You don't seem to have:
http://msdn.microsoft.com/library/d...>
ask_4gkl.asp
listed.
John
"SJM" <nospam@.devdex.com> wrote in message
news:u6hU08ItFHA.304@.TK2MSFTNGP11.phx.gbl...
>
> I have been having a very difficult time trying to get the output of a
> sql query that is in a DTS global variable to return, presently to a
> messagebox.
> I created an Execute SQL task with the query I wish to use. The query
> has been tested in Query Analyzer and works fine and returns the results
> I am looking for. I set a global variable to the result set. Basically,
> I wish to display the results as a string or similar in a messagebox.
> I have created the Execute SQL task as described in
> http://msdn.microsoft.com/library/e...s_task_4gkl.asp .
> I have tried to retrieve the results using the example in
> http://msdn.microsoft.com/library/d...y/en-us/howtosq
> l/ht_dts_task_6llt.asp but I have been unable to do so.
> I also tried the GetString method of the recordset without success.
> I also tried the using the "Storing the resultset in a flat file"
> example from http://dotnetbips.com/displayarticle.aspx?id=228 and I was
> unable to write the recordset to a file.
> What is the proper way to display a variable of type dispatch? I feel
> like I am going about this the wrong way.
> I welcome suggestions and comments on how to achieve the goal of
> displaying the query results.
> Thanks.
>
>
> *** Sent via Developersdex http://www.examnotes.net ***|||
Indeed, that MSDN is what I followed to get the data into the variable,
getting it out is the problem.
The workaround I am using is to execute the SQL statements in the
VBscript and not use the execute SQL DTS task. For example:
Option Explicit
Function Main()
dim cnn
dim rs
dim intLoop
set cnn=createobject("ADODB.Connection")
cnn.Open "Provider=sqloledb;" & _
"Data Source=SERVER;" & _
"Initial Catalog=msdb;" & _
"Integrated Security=SSPI"
set rs=cnn.execute("SQL STATEMENT HERE")
if rs.eof and rs.bof then
msgbox "Error: No records"
else
do until rs.EOF
For intLoop = 0 To rs.Fields.Count - 1
msgbox " " & rs.Fields(intLoop).Name
Next
set rs = rs.Next
loop
end if
Main = DTSTaskExecResult_Success
End Function
*** Sent via Developersdex http://www.examnotes.net ***|||
Everything is fine with the code listed below. I am going to use this
instead of the DTS execute sql task.
Option Explicit
Function Main()
dim cnn
dim rs
dim intLoop
dim strText
set cnn=createobject("ADODB.Connection")
cnn.Open "Provider=sqloledb;" & _
"Data Source=SERVER;" & _
"Initial Catalog=msdb;" & _
"Integrated Security=SSPI"
set rs=cnn.execute("SQL QUERY")
If rs.BOF then
msgbox "No Records Found"
else
do until rs.EOF
For intLoop = 0 To rs.Fields.Count - 1
strText = strText & rs.fields(intLoop).value & " " & vbCrLf
Next
rs.MoveNext
loop
msgbox strText
end if
set rs = nothing
Main = DTSTaskExecResult_Success
End Function
*** Sent via Developersdex http://www.examnotes.net ***|||Hi
It was the wrong link, should have sync'd
http://msdn.microsoft.com/library/d...asp?frame=true
I have just followed
http://msdn.microsoft.com/library/d...>
ask_4gkl.asp
and the above and there have been no problems.
John
"SJM" <nospam@.devdex.com> wrote in message
news:euD9JTUtFHA.2624@.TK2MSFTNGP12.phx.gbl...
>
> Everything is fine with the code listed below. I am going to use this
> instead of the DTS execute sql task.
> Option Explicit
> Function Main()
> dim cnn
> dim rs
> dim intLoop
> dim strText
> set cnn=createobject("ADODB.Connection")
> cnn.Open "Provider=sqloledb;" & _
> "Data Source=SERVER;" & _
> "Initial Catalog=msdb;" & _
> "Integrated Security=SSPI"
> set rs=cnn.execute("SQL QUERY")
> If rs.BOF then
> msgbox "No Records Found"
> else
> do until rs.EOF
> For intLoop = 0 To rs.Fields.Count - 1
> strText = strText & rs.fields(intLoop).value & " " & vbCrLf
> Next
> rs.MoveNext
> loop
> msgbox strText
> end if
> set rs = nothing
> Main = DTSTaskExecResult_Success
> End Function
>
> *** Sent via Developersdex http://www.examnotes.net ***

Tuesday, March 20, 2012

Cannot Delete Job

I used the DTS transfer Jobs to copy a couple of jobs from one server to
another, I now aant to delete those jobs on the target server but I get an
error saying
"Error14274" Cannot add, update, or delete a job (or its steps or
schedule) that originated from an MSX server"
How can I delete these jobs I urgently need to get rid of these....
Thanks for your help,
BrianYou are using an MSX and TSX server, which means that the job you have on
your server was targetted from a master server.
The targetted client can not delete the job, it needs to be done on the
master server.
Check books online on master server jobs
To defect a target server from a master server
1.. Expand a server group, and then expand a server configured as a target
server.
2.. Expand Management.
3.. Right-click SQL Server Agent, point to Multi Server Administration,
and then click Defect from MSX.
4.. Click Yes to confirm that you want to defect this target server from a
master server.
Regards,
Dandy Weyn
MCSE, MCSA, MCDBA, MCT
www.dandyman.net
"Brian" <bfordSPAMOFF@.markem.com> wrote in message
news:%23Gw%23YoR3DHA.3936@.TK2MSFTNGP11.phx.gbl...
quote:

> I used the DTS transfer Jobs to copy a couple of jobs from one server to
> another, I now aant to delete those jobs on the target server but I get

an
quote:

> error saying
> "Error14274" Cannot add, update, or delete a job (or its steps or
> schedule) that originated from an MSX server"
> How can I delete these jobs I urgently need to get rid of these....
> Thanks for your help,
> Brian
>
|||Dandy,
Thank you very much for your response, however, I am not using an MSX and
TXS server, at least not knowingly. When I right click Server Agent, I only
get the options to make the server a Master or a Target, is there anyway
that I can edit a system table to remove these?
The original server that the jobs came from will be going away today......
Thanks again,
Brian
"Dandy Weyn" <mct@.dandyman_nospam.net> wrote in message
news:40096d0e$0$773$ba620e4c@.news.skynet.be...
quote:

> You are using an MSX and TSX server, which means that the job you have on
> your server was targetted from a master server.
> The targetted client can not delete the job, it needs to be done on the
> master server.
> Check books online on master server jobs
> To defect a target server from a master server
> 1.. Expand a server group, and then expand a server configured as a

target
quote:

> server.
>
> 2.. Expand Management.
>
> 3.. Right-click SQL Server Agent, point to Multi Server Administration,
> and then click Defect from MSX.
>
> 4.. Click Yes to confirm that you want to defect this target server from

a
quote:

> master server.
> --
> Regards,
> Dandy Weyn
> MCSE, MCSA, MCDBA, MCT
> www.dandyman.net
> "Brian" <bfordSPAMOFF@.markem.com> wrote in message
> news:%23Gw%23YoR3DHA.3936@.TK2MSFTNGP11.phx.gbl...
> an
>
|||Brian,
I am interested in the answer to this one too. My situation occurred becaus
e we renamed the server and sql name when jobs were still there. now the or
iginal server doesnt exist but the jobs do. I've tried removejobbyid method.
The next thing I was look
at is how to defect a master server. these servers are not really multi-hom
ed, they just think they are because the owner of the job is not part of the
new sql server. sp_help_job will tell you who owns it
Mitch|||Brian
check out Can't delete job.
Tibor put a script in there that fixed it for me
mitchsql

Cannot Delete Job

I used the DTS transfer Jobs to copy a couple of jobs from one server to
another, I now aant to delete those jobs on the target server but I get an
error saying
"Error14274" Cannot add, update, or delete a job (or its steps or
schedule) that originated from an MSX server"
How can I delete these jobs I urgently need to get rid of these....
Thanks for your help,
BrianYou are using an MSX and TSX server, which means that the job you have on
your server was targetted from a master server.
The targetted client can not delete the job, it needs to be done on the
master server.
Check books online on master server jobs
To defect a target server from a master server
1.. Expand a server group, and then expand a server configured as a target
server.
2.. Expand Management.
3.. Right-click SQL Server Agent, point to Multi Server Administration,
and then click Defect from MSX.
4.. Click Yes to confirm that you want to defect this target server from a
master server.
--
Regards,
Dandy Weyn
MCSE, MCSA, MCDBA, MCT
www.dandyman.net
"Brian" <bfordSPAMOFF@.markem.com> wrote in message
news:%23Gw%23YoR3DHA.3936@.TK2MSFTNGP11.phx.gbl...
> I used the DTS transfer Jobs to copy a couple of jobs from one server to
> another, I now aant to delete those jobs on the target server but I get
an
> error saying
> "Error14274" Cannot add, update, or delete a job (or its steps or
> schedule) that originated from an MSX server"
> How can I delete these jobs I urgently need to get rid of these....
> Thanks for your help,
> Brian
>|||Dandy,
Thank you very much for your response, however, I am not using an MSX and
TXS server, at least not knowingly. When I right click Server Agent, I only
get the options to make the server a Master or a Target, is there anyway
that I can edit a system table to remove these?
The original server that the jobs came from will be going away today......
Thanks again,
Brian
"Dandy Weyn" <mct@.dandyman_nospam.net> wrote in message
news:40096d0e$0$773$ba620e4c@.news.skynet.be...
> You are using an MSX and TSX server, which means that the job you have on
> your server was targetted from a master server.
> The targetted client can not delete the job, it needs to be done on the
> master server.
> Check books online on master server jobs
> To defect a target server from a master server
> 1.. Expand a server group, and then expand a server configured as a
target
> server.
>
> 2.. Expand Management.
>
> 3.. Right-click SQL Server Agent, point to Multi Server Administration,
> and then click Defect from MSX.
>
> 4.. Click Yes to confirm that you want to defect this target server from
a
> master server.
> --
> Regards,
> Dandy Weyn
> MCSE, MCSA, MCDBA, MCT
> www.dandyman.net
> "Brian" <bfordSPAMOFF@.markem.com> wrote in message
> news:%23Gw%23YoR3DHA.3936@.TK2MSFTNGP11.phx.gbl...
> > I used the DTS transfer Jobs to copy a couple of jobs from one server to
> > another, I now aant to delete those jobs on the target server but I get
> an
> > error saying
> >
> > "Error14274" Cannot add, update, or delete a job (or its steps or
> > schedule) that originated from an MSX server"
> >
> > How can I delete these jobs I urgently need to get rid of these....
> >
> > Thanks for your help,
> >
> > Brian
> >
> >
>

Monday, March 19, 2012

Cannot create DSN to SQL Express

I installed SQL Express and was able to create a new DB using Management Studio. I was able to copy over tables from another DB using DTS, but strangely the Native Client would not work I had to use OLE for SQL Server.

But I am unable to create a DSN to the database using ODBC Administrator. I keep getting Login Timeout expired error message, using both Native Client and SQL Server drivers. What am I missing?

Thanks

Mark

WHat is the exact error message you are getting ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

This is the error message when I try using Native Client:

Attempting connection
[Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2].
[Microsoft][SQL Native Client]Login timeout expired
[Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

This when I try SQL Server driver:

Attempting connection
[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.

BTW this is a local connection, I'm trying to get it all working on my laptop. I also tried playing with the SQLEXPRESS and CLient Protocols. I enabled Shared Memory, Named Pipes and TCP/IP, to no avail.

Thanks

Mark

|||

Finallly I managed to get it to work, when I realized the ODBC Administrator does not display the full name of the server. It displayed MARK_LAP, which is the name of my computer. I realized I needed to type in MARK_LAP\SQLEXPRESS which is the name of the server, and it works now. Connecting to [local] does not work either.

So, I thought I would post this in case someone else has the same problem.

Mark

|||The statement "MARK_LAP\SQLEXPRESS which is the name of the server" is a bit misleading as this is the name of the named instance which the service uses. YOu always have to name the instance with the "\instanceName" snippet if its not a default instance. Otherwise the client tries to connect to a default instance which is probably not installed in all cases.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Cannot create DSN to SQL Express

I installed SQL Express and was able to create a new DB using Management Studio. I was able to copy over tables from another DB using DTS, but strangely the Native Client would not work I had to use OLE for SQL Server.

But I am unable to create a DSN to the database using ODBC Administrator. I keep getting Login Timeout expired error message, using both Native Client and SQL Server drivers. What am I missing?

Thanks

Mark

WHat is the exact error message you are getting ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||

This is the error message when I try using Native Client:

Attempting connection
[Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2].
[Microsoft][SQL Native Client]Login timeout expired
[Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

This when I try SQL Server driver:

Attempting connection
[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.

BTW this is a local connection, I'm trying to get it all working on my laptop. I also tried playing with the SQLEXPRESS and CLient Protocols. I enabled Shared Memory, Named Pipes and TCP/IP, to no avail.

Thanks

Mark

|||

Finallly I managed to get it to work, when I realized the ODBC Administrator does not display the full name of the server. It displayed MARK_LAP, which is the name of my computer. I realized I needed to type in MARK_LAP\SQLEXPRESS which is the name of the server, and it works now. Connecting to [local] does not work either.

So, I thought I would post this in case someone else has the same problem.

Mark

|||The statement "MARK_LAP\SQLEXPRESS which is the name of the server" is a bit misleading as this is the name of the named instance which the service uses. YOu always have to name the instance with the "\instanceName" snippet if its not a default instance. Otherwise the client tries to connect to a default instance which is probably not installed in all cases.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de