Forum Replies Created

Viewing 15 posts - 31 through 45 (of 82 total)

  • RE: Arithmetic overflow

    From SQl Books on Line:

    ----

    int, bigint, smallint, and tinyint

    Exact number data types that use integer data.

    bigint

    Integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.

    int

    Integer...

  • RE: Results need to be Fields

    declare @table1 table ([Day] int,[Count] int)

    declare @table2 table (day1 int, day2 int, day3 int, day4 int, day5 int)-- etc...

    insert into @table1

    select day(callwhen) as day,

    count(day)

    from billable_transactions

    group by day(callwhen)...

  • RE: how to do a Common Task with stored procedure

    The way we commonly use is a UDF function (provided you are on SQL2000) that will take in a list of values, in our case we pipe delimit them, and...

  • RE: Convert data

    ... Also if you look at the definition of SmallDateTime in Books On Line, you will see it is not what you are after.

  • RE: Convert data

    Another suggestion to return what you want. Replace GetDate() with your datetime value.

    select stuff(convert(varchar,getdate(),101),7,2,'')

    select stuff(convert(varchar,getdate(),103),7,2,'') + ' ' + substring(convert(varchar,getdate(),113),13,5)

    Basically have a look at Convert in Books on line, and...

  • RE: Deleting complete contents of a table

    Deleting all contents of a table: I would have thought truncate would be the fastest way as it does not log much in the transaction log, unlike a delete statement:

    Truncate...

  • RE: SqlJunkies.com: Just Launched Web Logs

    "What are Blogs?":

    Have a look at:

    http://ask.yahoo.com/ask/20021115.html

  • RE: SUM(@Month1)

    You cannot pass a field name into a select using a variable.

    One solution would be to pass it in to a dynamic select statement:

    declare @sql varchar(8000)

    set @SQl =

    'SELECT TOP...

  • RE: Using the CASE syntax with GOTO

    That sounds just like an error you get if you call:

    Exec @SQL

    rather than

    Exec (@SQL)

    Are you doing it with brackets?...

  • RE: Stored procedure dilemma

    Hot summers day, not much else on:

    create function dbo.MaxChoice (@Choices varchar(8000))

    returns int

    as

    begin

    declare @Pos int

    declare @MaxChoice int

    declare @WorkingChoice int

    set @Choices = @Choices + ','

    while len(@Choices) > 0

    begin

    set @pos = charindex(',',@Choices)

    set @WorkingChoice...

  • RE: Using the CASE syntax with GOTO

    As far as I know, you cannot use a goto in a select statement.

    As you are not selecting data from a table, try just using an if statement:

    If @name =...

  • RE: How to remove leading zeros?

    Replace varchar(12) to varchar(15) in last post.

  • RE: How to remove leading zeros?

    dynamically add zeros:

    declare @String varchar(15)

    set @String = '123'

    select convert(varchar(12),(replicate('0', (12 - len(@String))))) + cast(@String as varchar(12))

    returns 000000000123 etc..

  • RE: Syntax Error

    UPDATE tblProtocol

    SET tblProtocol.tblSponsorFK = [tblSponsor]![tblSponsorPK]

    from tblProtocol

    INNER JOIN tblSponsor ON tblProtocol.tblSponsorFK = tblSponsor.SponsorID

  • RE: Why is SQL Server ignoring me?!

    Using cast will convert it to a varchar, however even varchar datatype's will return 1 to a isnumeric() if it can evaluated into a number. Casting it to a varchar...

Viewing 15 posts - 31 through 45 (of 82 total)