Copy Code code as follows:
Select *
From table1
Where (ID in (3,5,1,4,2))
Copy Code code as follows:
Select *
From table1
Where (ID in (3,5,1,4,2)) if the condition in the back is a number, then the MSSQL sort
One, write to another table in the same database:
Copy Code code as follows:
Use DB1
Go
CREATE TABLE T1 (
Item varchar (100),
Prov varchar (100),
Qty int);
INSERT into T1 (item,prov,qty)
Select ' formerly known ', ' xx
Ask:
What is the difference between varchar and nvarchar in SQL Server, varchar seems to be an English and a Chinese character is standing two bytes, while nvarchar is an English account of a byte, Chinese characters accounted for two bytes. But
Burst Library statement, modify the red part of the number to guess the library
/**/and/**/(Select/**/top/**/1/**/isnull ([Name]/**/as/**/nvarchar (), char ())%2bchar (124)/**/from/**/ [Master]. [dbo].
In many base table based queries, a join to another table is often required to satisfy one condition. In this case, using EXISTS (or not EXISTS) usually increases the efficiency of the query. In a subquery, the NOT IN clause performs an internal
The attached database can be completed.
Additional databases:
Enterprise Manager
--Right Key "database"
--All Tasks
--Additional databases
--Choose your. mdf filename
-Determine
--If the prompt does not have a. ldf file, create it, select
empty all the tables in the database .
Copy Code code as follows:
DECLARE @tablename varchar (50)
DECLARE @truncatesql varchar (255)
DECLARE Trcun_cursor Cursor for
Select [Name] from sysobjects where type = ' U '
--Conditional
1. Pagination of all records:
SELECT Top Page Size *
From
Users
WHERE
(Id not in (the SELECT top (page Size * (pages 1)) ID from the Users order by ID DESC)//SKIP (page size * (pages-1)) record
ORDER BY
ID DESC
2. Qualifying records of the paging (
Copy Code code as follows:
/*
* @curentpage Current Page
* @pagesize number of records per page
* @TableName Table name
* @key PRIMARY KEY (auto sort)
* @where Query conditions
1 NULL NULL
2 There are query conditions do not take where
*
Copy Code code as follows:
On Error Resume Next
' Code by Netpatch
Set arg=wscript.arguments
If arg.count=0 Then Wscript.Quit
Set Fso = CreateObject ("Scripting.FileSystemObject")
Set Conn = CreateObject ("ADODB. Connection ")
Set Rs =
After entering the query window, enter the following statement:
CREATE INDEX Mycolumn_index on MyTable (myclumn)
This statement establishes an index named Mycolumn_index. You can give a rope any name, but you should include the indexed field name
CreateFolder method
Create a folder.
object.CreateFolder(foldername)
Parameters
Object
Required option. Should be the name of the FileSystemObject object.
FolderName
Required option. A string expression that indicates the folder you want to
CreateTextFile method
Creates a specified file and returns a TextStream object that can be used to read or write the created file.
object.CreateTextFile(filename[, overwrite[, unicode]])
Parameters
Object
Required option. Should be the name of the
Delete method
Deletes the specified file or folder.
object.Delete force
Parameters
Object
Required option. Should be the name of the File or Folder object.
Force
Options available. A Boolean value. True if the property of the file or folder
DeleteFile method
Deletes the specified file.
object.DeleteFile filespec[, force]
Parameters
Object
Required option. The name that should be FileSystemObject.
Filespec
Required option. The name of the file to delete. filespec can contain
FolderExists method
Returns Trueif the specified folder exists, otherwise False.
object.FolderExists(folderspec)
Parameters
Object
Required option. The name that should be FileSystemObject.
Folderspec
Required option. The folder name that
Copy Code code as follows:
' Handle Errors
On Error Resume Next
' Get the Provider object
Set prov = GetObject ("WinNT:")
' Examine the available domains the provider can reach
For all Dom in Prov
' Examine the objects in the domain
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service