Forum Replies Created

Viewing 15 posts - 166 through 180 (of 240 total)

  • RE: Interesting errors trying to assign a value to a variable and use a union

    What value do you expect @Count to have if this was to work?

    SELECT @Count = COUNT(DISTINCT Number)

    FROM #First

    UNION

    SELECT @Count = COUNT(DISTINCT Number)

    FROM #Second

    Given your sample, if you expect 4 then:

    SELECT...

  • RE: Insert/Update processing on a batch of new records

    I actually find that using a LEFT OUTER JOIN performs better than a NOT EXISTS.  The syntax that I normally use to insert new records that don't already exist is:

  • RE: CASE statement help

    Try something like this:

     

    Select top 5

    A.ApplicationId,

    A.Id as ExamId,

    DateOfExam,

    B.DateStartEffectiveEligibility,

    IsNULL(Failure.LatestFailure, B.DateStartEffectiveEligibility) as DateEffectiveFailed

    APIExamSequence,

    AppCount.NumOfApps

    From CW_Exams A

    Inner Join CW_Applications B on A.ApplicationId = B.Id And B.DateStartEffectiveEligibility > '2004-12-31' And

       DateOfExam is not...

  • RE: Data overflow problem importing data from .csv file

    What is the table definition of the destination?

    If the VFROM is a timestamp column, then this a not a date and can not be imported.

  • RE: Convert Money to Text

    I've used this method before to do this:

    http://www.users.drew.edu/skass/sql/NameMoney.sql.txt

  • RE: usp stored procedure prefix

    If I was trying to learn the system at the database level with the intent of making changes to the tables, I would look at an ER diagram and see...

  • RE: how to move data

    Try something like this:

     

    declare @Contract table (ContractID int, ContractName varchar(255))

    insert @Contract values (1, 'NCLA Galley')

    insert @Contract values (2, 'NCLA Galley')

    insert @Contract values (3, 'Some Other Contract')

    declare @Person table (PersonID int,...

  • RE: create table as select

    this creates a temporary table #a:

    select name

    into #a

    from sysobjects

    select * from #a

  • RE: Replace part of string question

    For case sensitivity try:

    declare @Word table (Word varchar(255))

    declare @String varchar(255)

    select @String = 'This part is a ROHS Compliant widget.'

    insert @Word values ('Lead Free')

    insert @Word values ('Rohs Compliant')

    insert @Word values ('Rohs')

    select...

  • RE: Replace part of string question

    declare @Word table (Word varchar(255))

    declare @String varchar(255)

    select @String = 'This part is a ROHS Compliant widget.'

    insert @Word values ('Lead Free')

    insert @Word values ('Rohs Compliant')

    insert @Word values ('Rohs')

    select @String = replace(@String,...

  • RE: Comparison of empty string with string containing space characters

    SQL Server 2000 follows the ANSI SQL standards when comparing strings of different lengths, the shorter string is padded with blanks and then compared. So SQL Server 2000 is...

  • RE: usp stored procedure prefix

    Why does it matter in any environment?  If I "Select CustomerName, City From Customer Where CustomerID = 1", when does it matter what the implementation of Customer is?  Do I care...

  • RE: usp stored procedure prefix

    Does it matter when selecting data from it?  I does matter when doing inserts but the advantages of the ability to refactor parts of the database and not affect existing...

  • RE: sp_addlinkedsrvlogin text file

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_NULLS ON

    GO

    SET ANSI_WARNINGS ON

    GO

    CREATE PROCEDURE A

    as

    ...

    GO

  • RE: sp_addlinkedsrvlogin text file

    I don't need the sp_addlinkedsrvlogin for this to work for me.  Changes are highlighted:

    c:\temp.txt

    aaaaaaaaaa

    bbbbbbbb

    ccccccccc

    dddddddddddddddddd

    eeeeeeeeeeeee

    ffffffffffffffffff

    gggggggggggg

    c:\schema.ini

    [temp.txt]

       ColNameHeader=False

       Format=FixedLength

       MaxScanRows=25

       CharacterSet=OEM

       Col1=columnname Text

    SQL Script

    --Create a linked server

    EXEC sp_addlinkedserver txtsrv, 'Jet 4.0',

    'Microsoft.Jet.OLEDB.4.0',

    'c:\',

    NULL,

    'Text'

    GO

    --Query one of the...

Viewing 15 posts - 166 through 180 (of 240 total)