Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

VBScript para se conectar ao SQL Server 2005 e atualizar uma tabela

Const DB_CONNECT_STRING = "Provider=SQLOLEDB.1;Data Source=sql14\qw;Initial Catalog=fret;user id ='admin';password='pass'"
Set myConn = CreateObject("ADODB.Connection")
Set myCommand = CreateObject("ADODB.Command" )
myConn.Open DB_CONNECT_STRING
Set myCommand.ActiveConnection = myConn
myCommand.CommandText = "UPDATE lookup SET Col1 = 'Hello'"
myCommand.Execute
myConn.Close

Testado usando o Integrated Windows Security, não testado com SQL Login.