28 Lip 2008

Dodawanie wpisu Linked Servers

EXEC sp_addlinkedserver
  @server = ‚ba2ws’,
  @provider = ‚SQLOLEDB’,
  @srvproduct=”,
  @provstr = ‚DRIVER={SQL Server};SERVER=10.1.0.10;UID=polska;WD=polska2;’
–mapuje konto na lokalnym i odległym serwerze
EXEC
sp_addlinkedsrvlogin  @rmtsrvname =  ‚ba2ws’
    ,  @useself =  ‚false’
    ,  @locallogin =  ‚sa’
    ,  @rmtuser =  ‚polska’
    ,  @rmtpassword =  ‚polska2’

28 Lip 2008

Prosty sposób na katakanę w sql

insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ź%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ż%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ą%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ł%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ś%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ń%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ć%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ó%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ą%'
insert into slo_pl(id, slowo) select id,slowo from slo where slowo like '%ę%'
update slo_pl set slowo=replace(slowo,'ź','z')
update slo_pl set slowo=replace(slowo,'ż','z')
update slo_pl set slowo=replace(slowo,'ą','a')
update slo_pl set slowo=replace(slowo,'ł','l')
update slo_pl set slowo=replace(slowo,'ś','s')
update slo_pl set slowo=replace(slowo,'ń','n')
update slo_pl set slowo=replace(slowo,'ć','c')
update slo_pl set slowo=replace(slowo,'ó','o')
update slo_pl set slowo=replace(slowo,'ę','e')