Browse by Tags

Tagged Content List
  • Wiki Page: T-SQL: How to Find Rows with Bad Characters

    One of the commonly asked questions in Transact SQL Forum on MSDN is how to filter rows containing bad characters. Also, often times these bad characters are not known, say, in one of the recent posts the question was to filter all the rows where characters were greater than ASCII 127. The...
  • Wiki Page: SQL Server 2008+: Group By with Wings

    This article includes information about a feature from SQL Server 2008 (and up) - Group by extensions. Table of Contents Problem Definition Solution Grouping Sets Cube: Conclusion References Problem Definition In SQL Server 2005 and earlier versions, we would have faced the situation...
  • Wiki Page: How to Store Different Languages Data in the Same Database and Analyse them Effectively

    Reference # http://social.msdn.microsoft.com/Forums/sqlserver/en-US/d6da2336-5208-4d1c-9406-dcccbb003dca/collation Today we got an interesting question from the user, where he is trying to store multiple collations consisting of multiple languages in the same database and he needs to manage it...
  • Wiki Page: Finding Floor and Fraction of the Decimal Number

    Today I presented a solution for a very common request - given a decimal number, find its floor (I am using this Wikipedia definition ) as well as its fraction. This is the solution as appeared in that referenced thread: DECLARE @amount MONEY; SET @amount = 812.85; ...
  • Wiki Page: Patindex Case Sensitive Search

    This article is a result of a quick research of the problem of using PATINDEX to search case insensitive column using case sensitive search. The BOL does not show examples of how to implement particular collation with the PATINDEX function. A relevant thread in MSDN Transact-SQL forum showed the syntax...
  • Wiki Page: Database Size Limitations in All Versions and Editions of SQL Server

    This article is a stub and it is related to this MSDN thread According to this thread, the data file size limitation is not exposed through the query and most likely is hardcoded into the SQL Server assembly code. We can find data file limitations in BOL and we can create our own table to...
  • Wiki Page: How SQL Server Determines Type of the Constant

    Table of Contents Problem Definition Explanation Conclusion See Also Problem Definition There was an interesting question asked recently in Transact-SQL forum "Basic doubt in Round function" . The problem was stated as following: SELECT ROUND(744, -3) produced...
  • Wiki Page: SET ANSI_PADDING Setting and Its Importance

    Table of Contents Problem Description Investigation Resolution Script to correct problem in the whole database Default Database Settings See Also Other Languages Problem Description Recently I got an interesting escalation to solve for the client. Our VFP based application was getting the following...
  • Wiki Page: SQL Server Resource Re-Balancing in Failover Cluster

    The poster asked how to automatically adjust SQL Server's max server memory setting following a cluster fail-over - see here . I provided the following script with suggestions for how it could be tailored for their environment. USE [ master ] GO /****** Object: StoredProcedure [dbo...
  • Wiki Page: Thinking in Sets

    Thinking in Sets is a great book by Joe Celko . This book tells us about concepts, how we need to think when we are working with databases. Columns are not fields, rows are not records and tables are not files, hence SQL is declarative, not procedural. There is no sequential access or ordering...
  • Wiki Page: Structured Query Language

    By a “set” we mean any collection M into a whole of definite, distinct objects m (which are called the “elements” of M) of our perception or of our thought. —G eorge C antor , in “G eorg C antor ” by J oseph W. D auben (P rinceton U niversity P ress , 1990) Standard SQL is based...
  • Wiki Page: Windows Azure and SQL Database Tutorials - Tutorial 2: Using SQL Database

    Table of Contents Objectives Prerequisites Understanding the Architecture In this Article Lesson 1: Prepare SQL Database Account Procedures What did I just do? Next Steps: Lesson 2: Modify the Application to use SQL Database Procedures What did I just do? Next Steps: Lesson 3: Test and Deploy the Application...
  • Wiki Page: T-SQL: Group by Time Interval

    Table of Contents Simple Problem Definition Solution Complex Problem Definition and Solution See Also Simple Problem Definition A question was posted today in Transact-SQL forum " Counts by Time Interval " The thread originator wanted to know how to find how many jobs were completed...
  • Wiki Page: SQL Server 2008+: Merge (Unity is Strength - Strengthen your Performance by Merge)

    Table of Contents Problem Definition Solution MERGE Points to note Conclusion Problem Definition In SQL Server for each DML transaction (Insert, Update, Delete) we need to write separate statements which will be executed one by one in SQL Server execution engine. Let's give a basic...
  • Wiki Page: T-SQL: How to Find Stored Procedures that Use Dynamic SQL

    Dynamic SQL is a programming technique that enables you to build SQL statements dynamically at runtime. You can create more general purpose, flexible applications by using dynamic SQL because the full text of a SQL statement may be unknown at compilation. For example, dynamic SQL lets you...
  • Wiki Page: T-SQL: FIFO Inventory Problem - Cost of Goods Sold

    In this article I am going to explain the FIFO (first in first out) algorithm for calculating cost of goods sold. This is the real business problem I am working on now. Table of Contents Different methods of calculating Cost of Goods Sold in the Inventory Calculation Implementing FIFO Cost of Goods...
  • Wiki Page: Federations: Building Scalable, Elastic, and Multi-tenant Database Solutions with Windows Azure SQL Database

    Table of Contents Introduction: What are Federations? Who are Federations for? Federation Architecture How to Create a Federation? Further Information on Federations Introduction: What are Federations? Federations simply bring in the sharding pattern into Windows Azure SQL Database...
  • Wiki Page: Task Sequence – Changing a Property of a Deployment Appears to not be Saved in System Center 2012 Configuration Manager

    Problem I configured Operating System Deployment feature in System Center 2012 Configuration Manager to deploy Windows 7 customized master image, and during deploy Task Sequence on specific collection in step to Specify how to run the content for this program I set Deployment options to Access...
  • Wiki Page: Preparing your MAP Environment

    Return to the MAP Toolkit Getting Started Guide Table of Contents Preparing your environment Troubleshooting environmental issues Now that you have determined the collectors that will be required, there are certain considerations and configurations that must be verified or implemented in...
  • Wiki Page: SQL Server FAQs

    SQL Server 1. Truncate table vs Delete table Deleting Data Using TRUNCATE TABLE TRUNCATE TABLE is a statement that quickly deletes all records in a table by deallocating the data pages used by the table. This reduces the resource overhead of logging the deletions, as well as the number...
  • Wiki Page: Veritabanı Adını Değiştirme - Change Database Name (tr-TR)

    Bir çok yerde ismi değiştirilecek veritabanı önce single_user mode alınıp ardından isim değişikliği yapacak T-SQL kodlar paylaşılıyor. Evet, ismi değiştirilecek veritabanı adını single_user mode alıp değiştirebilirsiniz hatta SQL Server ile ilgili bir çok kaynakta Master veritabanını seçtirerek ...
  • Wiki Page: SQL Server: No Fragmentation in HEAP from INSERT / UPDATE

    A HEAP won't be "fragmented" in two cases: - only INSERTS may occur - UPDATES will occur in the attributes with fixed data length (e.g. char ) The following example demonstrates the above mentioned situations: First a simple HEAP will be created: 01. USE tempdb; ...
  • Wiki Page: T-SQL: Removing all non-Numeric Characters from a String

    Someone asked, what is the fastest way to remove all non-numeric characters (including space) from a varchar variable without affecting the performance. This will be used to check multiple columns in the table so thread originator was looking for some efficient way to do this: Example of the...
  • Wiki Page: Ranking Functions (Row_Number, Rank, Dense_Rank and NTILE)

    In this article we will discuss very simple and useful information in our daily SQL development work. SQL server 2005 introduced four new functions, ROW_NUMBER, RANK, DENSE_RANK and NTILE that are referred as Rank functions. Ranking functions return a ranking value for each row in a table. Ranking...
  • Wiki Page: ASP.NET İle Stored Procedure Kullanımı – 1 (No Wizard) (tr-TR)

    Merhaba arkadaşlar, bu makalemizde ASP.NET İle SQL Server üzerinde Stored Procedure oluşturup, oluşturduğumuz stored procedurü ASP.NET Projemizde kullanacağız… Stored Procedure Nedir? Ilk olarak kısaca Stored Procedürden bahsedeyim; Stored Procedures SQL Server üzerinde...
Page 2 of 4 (87 items) 1234
Can't find it? Write it!