Create an IMG table in the database, which contains an IMG field, type: image or binary
'Store bytes into the database
Dim stream as new IO. memorystream
Picturebox1.image. Save (stream, system. Drawing. imaging. imageformat. BMP)
Stream. Flush (
When writing SQL statements that query by time period, we generally write the query conditions as follows:
Where date> = '2014-01-01 'and date
However, some SQL statements are converted into the following:
Where date> = '2014-01-01 0:00:00 'and
If exists (select * From sysobjects where name = 'webname') Drop table stuwebnamegocreate table stuwebname (stuid int identity (1, 1) primary key, stuname varchar (50) not null, stupassword varchar (50) not null, stusex char (2) default ('male'),
-- Replace the original unitcodingCommunityReplace data with the new unitcodingCreate procedure DBO. sp_changeunitcoding(@ Oldunitcoding varchar (20 ),@ Newunitcoding varchar (20))AsDeclare @ returnvalue varchar (1)Begin Tran T1
-- 1Update tab_a
Recently, many people are looking for the SQL Server Personal Edition CD. I don't have the CD, but you can download it from the following link. I have already verified the file, and there is no problem! (If you have any questions, find me again. You
select getdate () -- current date 17:01:34. 717 select month (getdate ()) -- select day (getdate () of the current month ()) -- the current day of the month is 17 select getdate () - day (getdate () -- last day of last month 17:01:47. 920
Returns the table name, index name, and number of rows.
Select object_name (I. object_id) as objectname, I. [name] As indexname, sum (P. Rows) as rowcnt
From SYS. Indexes I
Inner join SYS. partitions P
On I. object_id = P. object_id
And I. index_id =
Select dpcode1 + dpcode2 + dpcode3 as department code, dpname1 + dpname2 + dpname3 as department name from t_dpt where dpname1 is not null and dpname2 is not null and dpname3 is not null Union all select dpcode1 + dpcode2 + dpcode3 as department
SQL Server 2000 implements a case of sorting by functions similar to the VB Val Function
Recently, the following data was sorted during project maintenance:
Before sorting:
Class photo nameMechanical Class 1, Zhang san.jpgMechanical Class 1 7Li
Call the COM component in the stored procedure of SQL ServerHttp://www.cnblogs.com/bonny.wong/archive/2005/03/29/127373.html
Sometimes, due to the lack of Functions of SQL Server, we need to use external programs to implement it.
The following errors always occur during the afternoon when the database is used: syntax error converting the nvarchar value to a column of Data Type int is found at last because the return value in the stored procedure can only be a simple int type,
Cross apply and outer apply are similar to join.
They are mainly engaged in M * n Cartesian sets. The obvious feature is that on joins are not used.
It is also reasonable to think about it. The application scenario should meet the join constraint,
-- DBO. fnsplittovarchar
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->If exists (select * From information_schema.routines where routine_name = 'fnsplittovarchar ')
Begin
Drop function
1. Export the table:
Select top (1, 100) percentCase when a. colorder = 1 then D. Name else ''end as table name, case when a. colorder = 1 then isnull (F. Value ,'')Else ''end as table description, A. colorder as field serial number, A. Name as
Sp_executesql
Execute statements or batch processing that can be reused multiple times or dynamically generated. Transact-SQL statements or batch processing can contain embedded parameters.
[For details, refer to SQL Server online help]
Here is a
Every system cannot avoid list pages, while list pages generally require pagination. Although all languages provide the internal paging function, the efficiency is very poor when there is a large amount of data, especially in the B/S architecture.
1. String Functions
Length and Analysis
Datalength (char_expr) returns the number of characters in the string, but does not contain spaces
Substring (expression, start, length ).
Right (char_expr, int_expr) returns int_expr characters to the right
Error: I gave a demo to my colleague yesterday, which is about sequence usage in enhance T-SQL: Select * From privtdemo sequence (sum ([Mark]) for [course] In ([Chinese], [mathematics], [English]) as PVT usage has the following error
MSG 102,
The first and last days of a known year are obtained in the project. I think the network is good and I will leave it as a backup.1. The first day of a month
Select dateadd (mm, datediff (mm, 0, getdate (), 0)
2. Monday of the week
Select dateadd (
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