Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
Wade_Database
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
solho
Wade_Database
Commits
d84f8a0d
Commit
d84f8a0d
authored
Mar 10, 2022
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:memo UP
parent
83f7972b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
0 deletions
+79
-0
其他/Sqlmemo.sql
其他/Sqlmemo.sql
+75
-0
其他/mysql kill ,processlist.sql
其他/mysql kill ,processlist.sql
+4
-0
報表/rpt_CustCaseTot_board_test -dev.sql
報表/rpt_CustCaseTot_board_test -dev.sql
+0
-0
No files found.
其他/Sqlmemo.sql
0 → 100644
View file @
d84f8a0d
--須開放屬性
exec
sp_configure
'show advanced options'
,
1
reconfigure
exec
sp_configure
'Ad Hoc Distributed Queries'
,
1
reconfigure
--DROP LinkServer
Exec
sp_dropserver
'TestServer1'
,
'droplogins'
;
--exec sp_dropserver '192.168.1.174', 'droplogins';
--Add LinkServer
EXEC
master
.
dbo
.
sp_addlinkedserver
@
server
=
N
'TestServer1'
,
@
srvproduct
=
N
'MysqlLink'
,
@
provider
=
N
'SQLNCLI'
,
--@provstr = N'DRIVER={MySQL ODBC 8.0 unicode Driver}; SERVER=192.168.1.174; DATABASE=IPEasy; USER=sol; PASSWORD=Sport5000';
--@provstr = N'DRIVER={SQL Server};SERVER=120.78.73.107,6000;UID=account;PWD=accounttp;DATABASE=IPEasy';
--@provstr = N'DRIVER={SQL Server};SERVER=47.91.213.74,6001;UID=account;PWD="accuonttp";DATABASE=IPEasy';
@
provstr
=
N
'DRIVER={SQL Server};SERVER=120.79.0.56,6000;UID=sol;PWD=Sport5000;DATABASE=IPEasy'
;
--check linkedservers
exec
sp_linkedservers
--add linkserverloging
--exec master.dbo.sp_addlinkedsrvlogin @rmtsrvname ='TestServer1',@useself =false,@rmtuser='account', @rmtpassword ='accounttp'
exec
master
.
dbo
.
sp_addlinkedsrvlogin
@
rmtsrvname
=
'TestServer1'
,
@
useself
=
false
,
@
rmtuser
=
'sol'
,
@
rmtpassword
=
'Sport5000'
exec
sp_serveroption
@
server
=
'TestServer1'
,
@
optname
=
'rpc'
,
@
optvalue
=
'true'
exec
sp_serveroption
@
server
=
'TestServer1'
,
@
optname
=
'rpc out'
,
@
optvalue
=
'true'
exec
sp_helpserver
--MSSQL
delete
from
TestServer1
.
IPEasy
.[
dbo
].[
esn_Customer_Group
]
insert
into
TestServer1
.
IPEasy
.[
dbo
].[
esn_Customer_Group
](
Handle_GroupId
,
Handle_GroupName
,
GroupId
,
GroupName
,
GroupId_parent
,
CustId
)
select
Handle_GroupId
,
Handle_GroupName
,
GroupId
,
GroupName
,
GroupId_parent
,
CustId
from
IPEasy
.[
dbo
].[
esn_Customer_Group
]
select
Handle_GroupId
,
Handle_GroupName
,
GroupId
,
GroupName
,
GroupId_parent
,
CustId
from
TestServer1
.
IPEasy
.[
dbo
].[
esn_Customer_Group
]
select
top
100
*
from
TestServer1
.
IPEasy
.[
dbo
].
esn_todos
--Mysql
--搜尋語法1 來源需支援4部分名稱結構
select
top
10
*
FROM
TestServer1
.
IPEasy
.
dbo
.
esn_todos
--搜尋語法2 可跨資料庫
select
*
from
openquery
(
MyLink
,
'SELECT * FROM esm.t_pat_cpc_creation;'
)
a
--須排除問題table
select
top
100
a
into
#
tmptest
from
OPENQUERY
(
TestServer1
,
'SET FMTONLY OFF;exec [dbo].[rpt_PerformanceMonth] @p_RptType =
''
showemp
''
,@p_Emp_ID =
''
FD67D192-041B-4725-A3E1-CB5E62A5CC61
''
,@p_DateB =
''
2020-03-01
''
,@p_DateE =
''
2020-03-31
''
, @p_Date_settlement=
''''
,@p_gtPoint=0 '
)
a
SELECT
*
INTO
#
tempTable
from
OPENROWSET
(
'SQLNCLI11'
,
'Server=localhost;UID=sol;PWD=Sport5000'
,
'exec IPEasy.[dbo].[rpt_PerformanceMonth] @p_RptType =
''
showemp
''
,@p_Emp_ID =
''
FD67D192-041B-4725-A3E1-CB5E62A5CC61
''
,@p_DateB =
''
2020-03-01
''
,@p_DateE =
''
2020-03-31
''
, @p_Date_settlement=
''''
,@p_gtPoint=0 '
)
a
SELECT
top
10
*
FROM
OPENDATASOURCE
(
'SQLOLEDB'
,
'Data Source=47.91.213.74,6001
\;
User ID=account;Password=accounttp'
).
IPEasy
.
dbo
.[
rpt_CustCaseTot
]
'2020-05'
,
'2020-05'
,
'byPeople_board_todos'
,
''
,
'Month'
,
'All'
EXECUTE
TestServer1
.
IPEasy
.[
dbo
].
rpt_CustCaseTot
@
p_YM_F
=
'2020-05'
,
@
p_YM_T
=
'2020-05'
,
@
p_RptType
=
'byPeople'
-- byItem ,bydept,byds,bypeople,byPeople_board
,
@
p_CustName
=
''
,
@
DisplayType
=
'Month'
,
@
DataMode
=
'All'
--用完須開放屬性
exec
sp_configure
'Ad Hoc Distributed Queries'
,
0
reconfigure
exec
sp_configure
'show advanced options'
,
0
reconfigure
\ No newline at end of file
其他/mysql kill ,processlist.sql
0 → 100644
View file @
d84f8a0d
SHOW
PROCESSLIST
;
select
GROUP_CONCAT
(
stat
SEPARATOR
' '
)
from
(
select
concat
(
'KILL '
,
id
,
';'
)
as
stat
from
information_schema
.
processlist
WHERE
user
=
'sol'
AND
HOST
LIKE
'%michael-dev%'
)
as
stats
;
報表/rpt_CustCaseTot_board_test -dev.sql
View file @
d84f8a0d
B
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment