users

select * from cmusxhd

update Testmhaq_CureMD..CMUSXHD
set vuname=’mdadminmhaqtst’
where VUNAME=’mdadminmhaq’

–insert into controldb..practiceuserdata(vusername,curemd_dsn_name,curepatient_dsn_name,curemobile_dsn_name,curemd_db_name,curepatient_db_name,curemobile_db_name,curemdimage_db_name,curemd_userid,curemd_password)
SELECT DISTINCT RTRIM(LTRIM(vuname)),’Testmhaq_CureMD’,’Testmhaq_CurePatient’,’Testmhaq_CureMobile’,
‘Testmhaq_CureMD’,’Testmhaq_CurePatient’,’Testmhaq_CureMobile’, ‘Testmhaq_CureImage’,’curemd’,’cure2000′
FROM Testmhaq_CureMD.dbo.cmusxhd
WHERE RTRIM(LTRIM(vuname)) NOT IN
(
SELECT vUserName FROM controldb..PRACTICEUSERDATA
)
AND VUNAME”
and len(RTRIM(LTRIM(vuname)))<=16

update CMUSXHD
set VPASSWORD=’a41c1199d6fdba0d0230d5103b0e715d’
,bpasswordrest=0

where VUNAME=’mdadminhfspctst’
Continue reading “users”

Advertisements

Script: Remove Ghost Characters


/*
Script By: Aasim Abdullah
For: ReConnectSQL and http://www.connectsql.com
Purpose: to remove special characters from data
*/
Create FUNCTION [dbo].[RemoveGhostCharacters] (@s varchar(MAX)) returns varchar(MAX)
with schemabinding
BEGIN
if @s is null
return null
declare @s2 varchar(MAX)
set @s2 = ''
declare @l int
set @l = len(@s)
declare @p int
set @p = 1
while @p <= @l begin
declare @c int
set @c = ascii(substring(@s, @p, 1))
if @c between 32 and 126 OR @C BETWEEN 156 AND 157
set @s2 = @s2 + char(@c)
set @p = @p + 1
end
if len(@s2) = 0
return null
return @s2
END
GO

Continue reading “Script: Remove Ghost Characters”