Forum Replies Created

Viewing 15 posts - 16 through 30 (of 413 total)

  • RE: Stored procedure incomplete concatenation of string

    Is this a query analyzer problem only? In query analyzer, check tools, options, results tab. What does it say under "maximum characters per column"?

     

  • RE: Update Statement

    That's definitely a possibility. With this query, however, you cannot control what fiscal_monthname will be if there is more than one (distinct) possible value. If that's a problem, you might consider...

  • RE: Gotcha! SQL Aggregate Functions and NULL

    As I tried to say in my previous post, I think I understand your point.... I only wanted to say that on SQL Server 2000 you don't lose anything (except...

  • RE: shipping system - stored procedure - self-referencing table

    How can we solve this if there is more than one route from origin to destination? Do you have a way of specifying the route?

    I.e. do you want the route...

  • RE: Parent Child Link

    I assume you mean an initial value of 100 Try this:

    declare @a table(ID varchar(10))

    declare @b-2 table(PID varchar(10), ID varchar(10))

    insert...

  • RE: Help with an update query

    There is a well-known trick for this, which uses a function. Please see code below.

     

    -- Table definitions

    create table productoptions

    (optionid int, productid int, optionname varchar(10))

    insert productoptions select 200, 1027, 'Size'

    insert productoptions...

  • RE: Gotcha! SQL Aggregate Functions and NULL

    The point I wanted to make was that "select count(x) from table" gives you the number of non-null values returned by the statement "select x from table". This applies when x is...

  • RE: Concatenation & Matching

    If Jeff's and Vladan's posts don't help you, please see if you can write a script that reconstructs the error. I.e give us table definitions, a few sample data on...

  • RE: Gotcha! SQL Aggregate Functions and NULL

    Mike, you consider count(*) a special case and write that "count(column) eliminates null values". jwainz has a point in mentioning that count(*) and count(1) are equivalent, since count(1) is not...

  • RE: help needed with a set based update

    A side remark: Perfromance while setting up test data is probably not something one worries much about... But it is faster (and easier, I think) to use a Numbers table:

    SELECT TOP...

  • RE: help needed with a set based update

    Kevin, very interesting... I couldn't get your loop started, so I pre-added some code... Also, I think "AND t1.datetimestamp > t2.maxFlag" is redundant...

  • RE: Four Rules for NULLs

    First of all, thanks for a nice article, Michael. I liked it.

    I have two comments. In the "ANSI Versus Microsoft" section, you give the example

    SET ANSI_NULLS OFF
    SELECT * FROM [Northwind].[dbo].[Employees]
    WHERE...
  • RE: Summarizing Question

    I guess so Try something like this:

     

    declare @tbl table(Name varchar(100), Surname varchar(100), Ref int, Amount int, Date datetime)

    insert @tbl select 'Joe',         'Blogs',            2333,    ...

  • RE: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

    You could also try

    select dateadd(d, datediff(d, '1900', pi_dtbirth), '1900') as [Date] from pi

    (or a number of other possibilities). Then you don't have to worry about language settings

  • RE: How delete the rows where comlete record is null.

    This seems not to work. I get one row with the example below:

     

    create table #test(a int null, b varchar(10) null)

    go

    insert #test select 1, ''

    SELECT *

    FROM #Test

    WHERE BINARY_CHECKSUM(*) = CHECKSUM(*)

    drop...

Viewing 15 posts - 16 through 30 (of 413 total)