Search Results

Search found 295 results on 12 pages for 'derek dieter'.

Page 2/12 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Find Duplicate Fields in a Table

    - by Derek Dieter
    A common scenario when querying tables is the need to find duplicate fields within the same table. To do this is simple, it requires utilizing the GROUP BY clause and counting the number of recurrences. For example, lets take a customers table. Within the customers table, we want to find all the [...]

    Read the article

  • SQL Server Begin Try

    - by Derek Dieter
    The try catch methodology of programming is a great innovation for SQL 2005+. The first question you should ask yourself before using Try/Catch should be “why?”. Why am I going to use Try/Catch? Personally, I have found a few uses, however I must say I do fall into the category of not [...]

    Read the article

  • SQL Server Max SmallInt Value

    - by Derek Dieter
    The maximum value for a smallint in SQL Server is: -32768 through 32767 And the byte size is: 2 bytes other maximum values: BigInt: -9223372036854775808 through 9223372036854775807 (8 bytes) Int: -2147483648 through 2147483647 (4 bytes) TinyInt: 0 through 255 (1 byte) Related Posts:»SQL Server Max TinyInt Value»SQL Server Max Int Value»SQL Server Bigint Max Value»Dynamic Numbers Table»Troubleshooting SQL Server Slowness

    Read the article

  • Find Column in All Databases

    - by Derek Dieter
    Occasionally, there comes a requirement to search all databases on a particular server for either columns with a specific name, or columns relating to a specific subject. In the most recent case, I had to find all similar columns in all databases because the company plans to change the datatype of these columns. [...]

    Read the article

  • SQL Server Max TinyInt Value

    - by Derek Dieter
    The maximum value for a tinyint in SQL Server is: 0 through 255 And the byte size is: 1 byte other maximum values: BigInt: -9223372036854775808 through 9223372036854775807 (8 bytes) Int: -2147483648 through 2147483647 (4 bytes) SmallInt: -32768 through 32767 (2 bytes) Related Posts:»SQL Server Max SmallInt Value»SQL Server Max Int Value»SQL Server Bigint Max Value»Create Date Table»Dynamic Numbers Table

    Read the article

  • SELECT TOP 1

    - by Derek Dieter
    There are many good uses of the SELECT TOP 1 method of querying. Essentially, the select top 1 method is used to find the min or max record for a particular value. There is some debate as to whether this is the ‘correct’ method of querying, however it should be known that this [...]

    Read the article

  • String or binary data would be truncated.

    - by Derek Dieter
    This error message is relatively straight forward. The way it normally happens is when you are trying to insert data from a table that contains values that have larger data lengths than the table you are trying to insert into. An example of this would be trying to insert data from a permanent table, into [...]

    Read the article

  • Rownum in SQL Server

    - by Derek Dieter
    Prior to SQL Server 2005, there was no inherent function to generate a rownumber within a row. There is a workaround however for SQL 2000. If you are on SQL 2005+, then you will utilize the following function:-- SQL 2005+ SELECT RowNumber = ROW_NUMBER() OVER (ORDER BY c.CustomerID ASC) [...]

    Read the article

  • Get Session ID

    - by Derek Dieter
    To get the session ID, simply use the intrinsic variable @@SPID:SELECT @@SPIDThe acronym for SPID means Server Process ID. It is synonymous with session. Related Posts:»SQL Server Kill»Using sp_who2»Blocking Processes (lead blocker)»A Better sp_who2 using DMVs (sp_who3)»Troubleshooting SQL Server Slowness»SQL Server 2008 Minimally Logged Inserts»Insert Results of Stored Procedure Into Table»SQL Server Slow Performance»View Active [...]

    Read the article

  • SQL Date Comparison

    - by Derek Dieter
    When comparing the datetime datatype in SQL Server, it is important to maintain consistency in order to gaurd against SQL interpreting a date differently than you intend. In at least one occasion I have seen someone specify a short format for a date, like (1/4/08) only to find that SQL interpreted the month as [...]

    Read the article

  • Gracefully Handling Deadlocks

    - by Derek Dieter
    In some situations, deadlocks may need to be dealt with not by changing the source of the deadlock, but by changing handling the deadlock gracefully. An example of this may be an external subscription that runs on a schedule deadlocking with another process. If the subscription deadlocks then it would be ok to [...]

    Read the article

  • Alter Index All Tables

    - by Derek Dieter
    This script comes in handy when needing to alter all indexes in a database and rebuild them. This will only work on SQL Server 2005+. It utilizes the ALL keyword in the Alter index statement to rebuild all the indexes for a particular table. This script retrieves all base tables and stores [...]

    Read the article

  • Copy Table to Another Database

    - by Derek Dieter
    There are few methods of copying a table to another database, depending on your situation. Same SQL Server Instance If trying to copy a table to a database that is on the same instance of SQL Server, The easiest solution is to use a SELECT INTO while using the fully qualifed database names.SELECT * INTO Database2.dbo.TargetTable FROM Database1.dbo.SourceTableThis will [...]

    Read the article

  • Using Coalesce

    - by Derek Dieter
    The coalesce function is used to find the first non-null value. The function takes limitless number of parameters in order to evaluate the first non null. If all the parameters are null, then COALESCE will also return a NULL value.-- hard coded example SELECT MyValue = COALESCE(NULL, NULL, 'abc', 123)The example above returns back [...]

    Read the article

  • SQL Server For Each Row Next

    - by Derek Dieter
    It is difficult for me to write this particular article and I’ll tell you why. If you don’t care then just skip down to the example, but here goes anyway. It is very rare that you should have to perform looping in SQL. There are certain situations that do require it, and [...]

    Read the article

  • SQL Insert Into Statement

    - by Derek Dieter
    The “insert into” statement is used in order to insert data into an existing table. The syntax for this is fairly simple. In the first section of the statement, you specify the table name and column names in which you are inserting data into. The second part is where the source of [...]

    Read the article

  • How to Truncate the Log File

    - by Derek Dieter
    Sometimes after one or more large transactions, the t-log (transaction log) will become full. In these particular cases you may receive an error message indicating the transaction log is full. In order to alleviate this issue, you need to find the names of the transaction logs on your system and then shrink them. To find the [...]

    Read the article

  • Gracefully Dealing with Deadlocks

    - by Derek Dieter
    In some situations, deadlocks may need to be dealt with not by changing the source of the deadlock, but by changing handling the deadlock gracefully. An example of this may be an external subscription that runs on a schedule deadlocking with another process. If the subscription deadlocks then it would be ok to [...]

    Read the article

  • Find cosine similarity in R

    - by Derek
    I'm wondering if there is a built in function in R that can find the cosine similarity (or cosine distance) between two arrays? Currently, I implemented my own function, but I can't help but think that R should already come with one :) Thanks, Derek

    Read the article

  • how to suppress output in R

    - by Derek
    Hi, I would like to suppress output in R when I run my r script from the command prompt. I tried numerous options including "--slave" and "--vanilla". Those options lessens the amount of text outputted. I also tried to pipe the output to "NUL" but that didn't help. Thanks a lot, Derek

    Read the article

  • transform a matrix wtih 2 columns into a multimap

    - by Derek
    Hi, I am wondering if there is a way to transform a matrix of 2 column into a multimap or list of list. The first column of the matrix is an id (with possibly duplicated entries) and the 2nd column is some value. For example, if I have to following matrix m<-matrix(c(1,2,1,3,2,4), c(3,2)) i would like to transform it into the following list [[1]] 3,4 [[2]] 2 Thanks, Derek

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >