Showing posts with label guy. Show all posts
Showing posts with label guy. Show all posts

Wednesday, March 21, 2012

Recover the DTS packages

Hello, everyone:
A guy think that the DTS packages can be recoved by restore MSDB database. Is that true? Does anyone have experience on that? Thanks.
ZYThi's rihgt|||DTS packages can be saved in the sysdtspackages table of the MSDB database in SQL Server. DTS packages can also be saved outside of SQL Server in Meta Data Services, a structured storage file or a Visual Basic file.

Wednesday, March 7, 2012

Recordset with SQL and VB

Hi,

I am trying to cycle through a table and trigger an event based on some critera. I am not sure how to do it. I am a classic VBA guy, so I might be way off:

 Dim myConnectionAs SqlConnectionDim myCommandAs SqlCommand myConnection =New SqlConnection("MY SQL DATA SOURCE") myConnection.Open() myCommand =New SqlCommand("SELECT * FROM history", myConnection)Dim dr = myCommand.ExecuteReader()Dim iAs Integer = 1While dr.read() i = i + 1' HOW DO I CYCLE THROUGH THE ROWS AND ASK IF A FIELD EQUALS A VALUE ' field name = "Tail"If dr(i) = ?Then MsgBox("ok")End If End While dr.Close() myConnection.Close()
Dim myConnectionAs SqlConnection
Dim myCommandAs SqlCommand
myConnection =New SqlConnection("MY SQL DATA SOURCE")
myConnection.Open()

myCommand =New SqlCommand("SELECT * FROM history", myConnection)
Dim dr As SqlDataReader = myCommand.ExecuteReader()
While dr.read()
If dr("Tail").ToString() = somestringvalue Then'do your thang
End While
dr.Close()
myConnection.Close()

|||

Have a look at the two examples fromhere on how to loop through data.

|||

Perfect..thanks to both of you!