Forum Replies Created

Viewing 15 posts - 2,821 through 2,835 (of 3,543 total)

  • RE: Import CSV file with Key Fields

    Personally I would preprocess the data outside of sql then load.

    But if you want to use sql

    1. DTS the data into staging table (varchar columns as Mike suggested) including an...

  • RE: Can you match text rows using LIKE in a join?

    SELECT table1.name,table2.name

    FROM table1

    INNER JOIN table2

    ON CHARINDEX(table2.name,table1.name) > 0

  • RE: Dynamically Generate Table Name in Stored Procedure

    I agree with Frank, use a single table with id, otherwise you will have to use dynamic sql.

  • RE: How to copy a table in a sp

    The simple solution for copying data is

    to create the table and insert

    SELECT *

    INTO newdatabase..newtable

    FROM olddatabase..oldtable

    WHERE ...

    to insert into an existing table

    INSERT

    INTO newdatabase..newtable

    (col1,col2,col3...)

    SELECT col1,col2,col3......

  • RE: Can you write out multiple views automatically?

    "Btw, Access exposure can be treated, and maybe some day you will get your normal life back."

    Yeh but I hated those padded cells.

  • RE: Refer to a certain line of the DB

    How about this

    SELECT TOP 24

    i.codigoind,

    i.mesind,

    i.anoind,

    i.numeroind,

    (i.numeroind - m.numeroind) / m.numeroind AS 'varmesind',

    (i.numeroind - y.numeroind) / y.numeroind AS 'varanoind',

    (i.numeroind - a.numeroind) / a.numeroind AS 'vardozemesind',...

  • RE: Can you write out multiple views automatically?

    OK, OK, short reply just to keep you happy.  The only reason I did not respond before is that I am not well versed...

  • RE: Null Date

    Dates cannot contain 'empty' string, as you found out sql will set id to '1900-01-01'. If your input is not datetime (eg varchar) then use NULLIF, eg

    DECLARE @string varchar(10)

    SET @string =...

  • RE: Refer to a certain line of the DB

    Without structure can only guess. Assume that row contains a date and all months present then

    SELECT TOP 24 a.[date],a.CPI,

    (a.CPI / b.CPI,1) AS 'Increase'

    FROM a

    INNER JOIN ...

  • RE: Can you write out multiple views automatically?

    It is the drop statement not object_id that is the problem. You will have to use dynamic sql like

    SET @sql='If Object_ID(''NBP'+@yearcount+''') is not NULL Drop View NBP'+@yearcount

    EXEC(@SQL)

    SET @sql='CREATE...

  • RE: How to change Server collation for SQL2000?

    Having not used SQL2K (but will be soon), collation is more of a black art than a grey area for me. I thought that SQL2K allowed different collations for different...

  • RE: BOL Update

    My shortcut shows

    Target

    C:\WINNT\System32\hh.exe sql80en.col

    Start In

    "C:\Program Files\Microsoft SQL Server Books Online\1033\"

    The Start In dir contains

    123 File(s)     39,038,612 bytes

  • RE: BOL Update

    Have a look at the properties for the shortcut (if there is one) on the programs menu, it should tell you where the files are.

  • RE: BOL Update

    My link is

    ©1988-2002 Microsoft Corporation. All Rights Reserved.

    and shows

    Version: 8.00.002

    Gonna try your url now

  • RE: BOL Update

    Prior to Frank's post I downloaded sqlbolsetup.cab (SQL2K (SP3) BOL). The cab contains setup plus msi's for the Windows Installer and one msi for BOL. It installed to the default location

    C:\Program...

Viewing 15 posts - 2,821 through 2,835 (of 3,543 total)