SQL Server is deployed on multiple platforms (Windows,Linux and Container) in many enterprises. A solution that can support multiple platforms is needed to collect and display related monitoring indicators.
I choose the popular monitoring display tool Grafana and monitoring indicator collection tool Telegraf to implement. This is also t ...
Posted by hermand on Mon, 01 Jun 2020 03:48:16 -0700
Building database and table:
if DB_id('TicketManager ')is not null --Judge whether the database already exists
drop database TicketManager --Remove the existing database
create database TicketManager --New database
name='TicketManager ',--Database name
filename='E:\CS Review cases of Architecture\TicketManager\DB\TicketManager. ...
Posted by waltonia on Mon, 04 May 2020 04:11:09 -0700
Assuming that we are a coupon offering platform, the story happens after the customer has successfully paid for the purchase of our platform.
Some actions to be done by the platform after the payment is completed:
SMS informs customer that an order has been generated
Increase customer credit
Start vouching on order
Posted by bachx on Wed, 22 Apr 2020 20:49:04 -0700
When there is a large amount of data in a table, it is natural for us to think of splitting the table into many small tables. When we execute the query, we go to each small table to query. Finally, we summarize the data set and return it to the caller to speed up the query. For example, the order table and inventory table of e-c ...
Posted by miro on Tue, 07 Apr 2020 22:29:17 -0700
About the uniqueness of object naming in SQL Server database. For example, database objects such as tables, indexes, constraints, etc. sometimes, DBA s often need to create or rename objects when doing database maintenance. At this time, they will encounter a problem, the uniqueness of object naming. Although it's a small question, it's not cle ...
Posted by EverToDesign on Thu, 20 Feb 2020 21:10:20 -0800
Cursors can be very useful sometimes. When updating a small part of data, they can easily update the data. There is no need to write another small tool to do this, just write SQL directly
Here is a practical example:
-- Declare field variables
DECLARE @RegionCode INT;
DECLARE @RegionName NVARCHAR(64);
DECLARE @ProvinceId INT;
-- d ...
Posted by shock on Tue, 04 Feb 2020 10:02:03 -0800
1. When we create the primary key of the data table of SQL server, sometimes a string of random strings will be added, as shown in the figure:
2. If you have obsessive-compulsive disorder, you can use the following sql script to modify the name of the primary key to the PK UU table name
--Unify the primary key name of the table as PK_T ...
Posted by ollie007 on Wed, 08 Jan 2020 07:55:49 -0800
/****** Object: Table [dbo].[Person] script date: 11 / 23 / 2008 13:37:48******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[Person](
[PersonId] [nchar](18) NOT NULL,
[PersonName] [nchar](20) NOT NULL,
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
)WITH (PAD_INDEX = OFF, S ...
Posted by Lodar on Sun, 05 Jan 2020 05:05:58 -0800
Yesterday, a netizen on the Internet said that after his colleague mistakenly set "max server memory" to 10M, the SQL Server database could not be logged in. At that time, I simply tested it. Today, I will sort out the whole process and record it here. Set "max server memory" in the UI of SSMS. Even if you set it to 10M, i ...
Posted by mwd2005 on Mon, 23 Dec 2019 19:43:03 -0800
SQL Prompt not only formats the code exactly as you want, but also helps you quickly switch to other styles or apply exceptions to parts of SQL scripts that don't require specific styles.
SQL Prompt automatically retrieves object names, syntax, and code snippets from the database to provide users with appropriate code choices.Automatic script ...
Posted by Confessions on Sat, 21 Dec 2019 11:17:52 -0800