


MS-SQL server database development classic skills_PHP tutorial
1. Sort by strokes of last name:
Select * From TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as
2. Database encryption:
select encrypt('original password')
select pwdencrypt('original password')
select pwdcompare('original password','encrypted password') = 1--the same; otherwise not the same encrypt('original password')
select pwdencrypt('original password')
select pwdcompare(' Original password','encrypted password') = 1--the same; otherwise different
3. Retrieve the fields in the table:
declare @list varchar(1000),@sql nvarchar(1000)
select @list=@list ',' b.name from sysobjects a,syscolumns b where a.id=b.id and a.name='Table A'
set @sql='select ' right(@list, len(@list)-1) ' from table A'
exec (@sql)
4. Check the hard disk partition:
EXEC master..xp_fixeddrives
5. Compare tables A and B to see if they are equal :
if (select checksum_agg(binary_checksum(*)) from A)
=
(select checksum_agg(binary_checksum(*)) from B)
print 'Equal'
else
print 'not equal'
6. Kill all profiler processes:
DECLARE hcforeach CURSOR GLOBAL FOR SELECT 'kill ' RTRIM(spid) FROM master.dbo.sysprocesses
WHERE program_name IN('SQL profiler',N'SQL Profiler')
EXEC sp_msforeach_worker '?'
'www.knowsky.com
7. Record search:
Start to N records
Select Top N * From table
----------------------------------
N to M records (must have primary index ID)
Select Top M-N * From table Where ID in (Select Top M ID From table) Order by ID Desc
--------------------- -------------
N to end record
Select Top N * From table Order by ID Desc
8. How to modify the name of the database:
sp_renamedb 'old_name ', 'new_name'
9: Get all user tables in the current database
select Name from sysobjects where xtype='u' and status>=0
10: Get all fields of a certain table
select name from syscolumns where id=object_id('table name')
11: View views, stored procedures, and functions related to a table
select a.* from sysobjects a, syscomments b where a.id = b.id and b.text like '%table name%'
12: View all stored procedures in the current database
select name as stored procedure name from sysobjects where xtype='P'
13: Query All databases created by users

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This AI-assisted programming tool has unearthed a large number of useful AI-assisted programming tools in this stage of rapid AI development. AI-assisted programming tools can improve development efficiency, improve code quality, and reduce bug rates. They are important assistants in the modern software development process. Today Dayao will share with you 4 AI-assisted programming tools (and all support C# language). I hope it will be helpful to everyone. https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot is an AI coding assistant that helps you write code faster and with less effort, so you can focus more on problem solving and collaboration. Git

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

In PHP, there are two ways to sort an array in a custom order: Custom comparator: implement the Comparable interface and specify the comparison rules of the two objects. Anonymous function: Create an anonymous function as a custom comparator to compare two objects against a criterion.

How to integrate GoWebSocket with a database: Set up a database connection: Use the database/sql package to connect to the database. Store WebSocket messages to the database: Use the INSERT statement to insert the message into the database. Retrieve WebSocket messages from the database: Use the SELECT statement to retrieve messages from the database.

The new features of PHP functions greatly simplify the development process, including: Arrow function: Provides concise anonymous function syntax to reduce code redundancy. Property type declaration: Specify types for class properties, enhance code readability and reliability, and automatically perform type checking at runtime. null operator: concisely checks and handles null values, can be used to handle optional parameters.

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.
