Uppercase sql

uppercase sql SELECT UPPER(FIRST_NAME) , LOWER(LAST_NAME) FROM CUSTOMERS ; uppercase and lowercase in sql select UPPER(‘converted to upper’); select LOWER(‘CONVERTED TO LOWER’);

Uppercase sql Read More

T-sql remove all non-alphanumeric characters from a string

t-sql remove all non-alphanumeric characters from a string Create Function [dbo].[RemoveNonAlphaCharacters](@Temp VarChar(1000)) Returns VarChar(1000) AS Begin Declare @KeepValues as varchar(50) Set @KeepValues = ‘%[^a-z]%’ While PatIndex(@KeepValues, @Temp) > 0 Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, ”) Return @Temp End

T-sql remove all non-alphanumeric characters from a string Read More

Sql server loop over query

sql server loop over query DECLARE @id INT DECLARE @name NVARCHAR(100) DECLARE @getid CURSOR SET @getid = CURSOR FOR SELECT table.id, table.name FROM table OPEN @getid FETCH NEXT FROM @getid INTO @id, @name WHILE @@FETCH_STATUS = 0 BEGIN EXEC stored_proc @[email protected], @otherVarName=’test’, @[email protected] FETCH NEXT FROM @getid INTO @id, @name END CLOSE @getid DEALLOCATE @getid

Sql server loop over query Read More

Vbscript connect mssql

vbscript connect mssql Const adLockBatchOptimistic = 4 Const adUseClient = 3 Set iconnTrans = CreateObject(“ADODB.Connection”) iconnTrans.open _ “Provider=SQLOLEDB.1;Data Source = localhost\sqlexpress;Integrated Security = SSPI;Initial Catalog=dw2” Set rsTrans = CreateObject(“ADODB.Recordset”) rsTrans.CursorLocation = adUseClient rsTrans.LockType = adLockBatchOptimistic rsTrans.open “SELECT * FROM ir_Transactions”, iconnTrans

Vbscript connect mssql Read More