Forum Replies Created

Viewing 15 posts - 46 through 60 (of 248 total)

  • RE: how to get consective dates from a table?

    declare @table table

    (ID_VAL INT identity(1,1),

     Date_Field Datetime

    )

    insert into @table values ('02/12/2006')

    insert into @table values ('02/13/2006')

    insert into @table values ('02/14/2006')

    insert into @table values ('02/15/2006')

    insert into @table values ('02/17/2006')

    insert into @table values ('02/19/2006')

    insert...

  • RE: HOW TO DELETE RECORDS

    declare @Delete_Dup_Records table

    (

    id_val INT IDENTITY(1,1),

    vid int,

    vName varchar(50),

    vAddress varchar(40),

    VGroup   char(1) default 'N' not null

    )

    INSERT INTO @Delete_Dup_Records (VID, VNAME, VADDRESS, VGROUP) SELECT VID, VNAME, VADDRESS, VGROUP FROM Delete_Dup_Records

    PRINT '**************'

    PRINT 'BEFORE DELETE'

    PRINT...

  • RE: Using If Statements in Stored Procedure

    Use a CASE conditional statement instead (if is not allowed in the select statement), example:

    CASE tbldatatablenew.custtype when 'xyz' then ImageItems else 0 end)

    You can also do:

    CASE

    WHEN col1 = 'Y' then...

  • RE: Sql editor

    QA (in SQL 2000) is typically good for most people.  SQL 2005 has an even better tool SSMS (SQL Server Management Studio).  If you are looking for third party tools,...

  • RE: using variables in CREATE TABLE query

    It is a scope thing...if you create the temp table like this, it will be visible only within that scope of execution, example:

    SET NOCOUNT ON

    DECLARE @SQL as nvarchar(4000), @table_name1 nvarchar(100)

    set @table_name1...

  • RE: Mulitple entries for one Parameter

    Why do you need to incorporate all of them in the list ?  If they select a particular employee, you filter by it, if they select the static list of...

  • RE: dts SQL 2000 to Oracle

    A better option would be to use DTS to dump the data into a text file (this will be pretty fast) and then load into Oracle using sql *ldr (either...

  • RE: INFORMATION_SCHEMA.TRIGGERS ?????

    sp_helptext trigger_name_here

    go

     

  • RE: Retrieving Date Formats

    declare @table table (col1 varchar(50))

    insert into @table values ('2006-02-10T17:30:00.0000000-00:00')

    select col1 original,  cast(substring(replace(col1, 'T', ' '), 1, 19) as datetime) new

    from @table

    original                                           new                                                   

    -------------------------------------------------- ------------------------------------------------------

    2006-02-10T17:30:00.0000000-00:00                  2006-02-10 17:30:00.000

    (1 row(s) affected)

  • RE: sp_addlinkedsrvlogin text file

    Why not use DTS or Bulk insert to do this ?  Even if modifications are required after loading of the data, you can have a staging table to load this...

  • RE: Uploading to xml

    Search for OpenXML on this site and you wil get some very good articles on how to do this - infact, there have been some recent articles which talk about...

  • RE: TSQL - Minimum of numeric value

    You can write a function that goes through the string one character at a time, does a isnumeric() check on it - if it is 0, then replaces it with...

  • RE: When was index last used

    Except for a lightweight trace, there is no way to know that in SQL Server 2000 (not sure about SQL 2005).  Oracle does have a nice feature to flag the...

  • RE: Date Calculation and Querying multiple columns

    Q1) :

    Why are you storing them separately rather than a single column ?

    Looks like you have those stored in string data-types...there are couple of ways of doing this:

    DECLARE @DOB TABLE...

  • RE: Parsing a comma delimited string into multiple rows---Please Help!!!

    SQL Server MVP Erland Sommarskog has posted a solution for this on his site..actually a couple of solutions: 

    http://www.sommarskog.se/arrays-in-sql.html#iterative

     

Viewing 15 posts - 46 through 60 (of 248 total)