Khi ta muốn gôm 2 ArrayList trong C# làm 1 thì làm như sau: Đọc hết bài viết
Đăng bởi: admin | Chuyên mục Backup - Restore | Ngày 06-04-2012
Tags: Backup - Restore
Hôm nay trong công ty, một bạn backup database SQL Server bị lỗi như thế này
TITLE: Microsoft SQL Server Management Studio Express——————————
Backup failed for Server ‘VPS’. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Backup+Server&LinkId=20476
——————————ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The backup of the file or filegroup “sysft_contentfulltext” is not permitted because it is not online. BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Serv
Sau vài phút mày mò Internet, giải pháp khắc phục như sau: Đọc hết bài viết
Đăng bởi: admin | Chuyên mục SQL 2012 | Ngày 03-04-2012
Tags: SQL Server 2012
Nền tảng dữ liệu thế hệ kế tiếp của Microsoft vừa được ra mắt sẽ giúp khách hàng quản lý “dữ liệu bất kì, theo kích thước bất kỳ và tại bất kì đâu”.
Đăng bởi: admin | Chuyên mục Lập trình T-SQL | Ngày 02-04-2012
Tags: Chứng chỉ 70-433, T-SQL
Ví dụ sau đây tạo 1 Table, sau đó cho Insert 100.000 dòng, điểm đáng chú ý nhất ở đây là câu lệnh
[Go 100000]
Everyone has their favorite way or running a block of code over and over again. If you have to run an entire batch over and over again there is nothing as quick and easy as using the “GO n” syntax. When you put a number after the GO batch separator SQL Server Management Studio (as well as SQLCMD) will run that entire batch however many times that you have specified. Đọc hết bài viết
Đăng bởi: admin | Chuyên mục Lập trình T-SQL | Ngày 01-04-2012
Khi chúng ta join các Table với nhau, nếu các field được join có giá trị NULL sẽ bị bỏ qua. Bài viết trình bày thủ thuật để có thể join các dòng có giá trị NULL với nhau.
Problem
When building database tables you are faced with the decision of whether to allow NULL values or to not allow NULL values in your columns. By default SQL Server sets the column value to allow NULL values when creating new tables, unless other options are set. This is not necessarily a bad thing, but dealing with NULL values especially when joining tables can become a challenge. Let’s take a look at this issue and how this can be resolved. Đọc hết bài viết
Đăng bởi: admin | Chuyên mục Monitoring, Quản trị SQL Server | Ngày 01-04-2012
Tags: Chứng chỉ 70-433
Trong bài viết này, chúng ta thấy tác giả Aaron Bertrand trình bày 1 giải pháp rất thú vị: lưu vết tất cả thay đổi trên database SQL Server, kỹ thuật ở đây là dùng DDL trigger. Bài viết gồm những điểm chính sau:
- Tạo table để lưu vết các thay đổi trên database
- Tạo DDL trigger để log lại các thay đổi cấp độ database: SessionID, User đăng nhập, IP đăng nhập, thay đổi trên đối tượng gì và đối tượng thay đổi (alter_procedure, alter_function…), thậm chí cả việc đổi tên các object (procedure, view…) cũng được lưu vết lại.
Problem
In a perfect world, only the DBA would have sa privileges, F5 would only ever be hit on purpose, every change would go through rigorous source control procedures, and we would have full backups of all databases every minute. Of course, in reality, we deal with much different circumstances, and we can find ourselves (or overhear someone else) saying, “Oops… how do I fix that?” One of the more common scenarios I’ve seen involves someone editing a stored procedure multiple times between backups or within some kind of cycle, and then wishing they had version (current – 1) available. It’s not in the backup yet, so can’t be restored; and the user, of course, has closed his or her window without saving. Đọc hết bài viết
Đăng bởi: admin | Chuyên mục Lập trình T-SQL | Ngày 27-03-2012
Tags: Chứng chỉ 70-433, T-SQL
Looking for a quick, efficient way to summarize the data stored in your database? The SQL ROLLUP and CUBE commands offer a valuable tool for gaining some quick and dirty insight into your data. ROLLUP and CUBE are SQL extensions and they’re available in SQL Server 6.5 (and above) and Oracle 8i (and above). Đọc hết bài viết
Đăng bởi: admin | Chuyên mục Lập trình T-SQL | Ngày 27-03-2012
Tags: Chứng chỉ 70-433
In this article we will go over basic understanding of Rollup clause in SQL Server. ROLLUP clause is used to do aggregate operation on multiple levels in hierarchy. Let us understand how it works by using an example. Đọc hết bài viết
Đăng bởi: admin | Chuyên mục Lập trình T-SQL | Ngày 27-03-2012
Tags: Chứng chỉ 70-433, T-SQL
1 bài viết hay về cách sử dụng CROSS APPLY và OUTER APPLY
Introduction
Part of my self-imposed job has always been to learn and adopt new technologies. As part of that process, I share what I learn by writing about it. The amount of information and content that is produced each year is much, much than anyone person can master, so I choose. Generally, I focus on OO technologies and languages, UML, design patterns, refactoring, and SQL. As a general rule, these areas have worked out pretty well for me. Unfortunately, the trade offs are that I may never master Ruby or really understand the difference between Ruby and Ruby on Rails. I am at peace with this decision. Đọc hết bài viết
Trong C# để thay thế dấu ngoặc kép, ta làm như sau:
Giả sử chuỗi str có dấu ngoặc kép. Đọc hết bài viết
