Forum Replies Created

Viewing 15 posts - 2,566 through 2,580 (of 3,543 total)

  • RE: Is all code really code? One question from an interview

    To be honest, I don't know. I think it is just a name that was chosen, maybe I should have typed it as Maud. Just seemed appropriate, no offence to...

  • RE: Is all code really code? One question from an interview

    A lot of interesting comments.

    I have no problem with asking this type of question as it will give you insight into the approach to problem solving. That is, do they...

  • RE: How to expand @variables in SQL Statement

    create proc spListEmployees (@Active smallint = 0)

    as

    Declare @NoOfEmployee  integer

    select @NoOfEmployee = count(*)

    from employee

    where charindex(status,substring('IA',@Active+1,2)) > 0

    print 'NoOfEmployee=' + Cast (@NoOfEmployee as varchar(10))

    GO

  • RE: Can DTS do this??

    nice on kailash, good solution.

    FINDSTR is a DOS command for finding text in a file.

    If you goto 'Command Prompt' (Satrt/Programs/Accessories) and type in

    FINDSTR /?

    you will see all the parameters available.

  • RE: Can DTS do this??

    Yes but why. Use FINDSTR.

    But if you do want to use DTS then

    Create two tables using Execute SQL Task

    Transform the text file (Source) to first table

    Insert into second table rows required using...

  • RE: Turn integer x into x rows.

    If cnt will not exceed 255 then

    select c.acctNo

    from tblCalcs c

    inner join master.dbo.spt_values n

    on n.type = 'P' and n.number between 1 and c.cnt

    where c.cnt > 0

    otherwise...

  • RE: Get Update script

    Openrowset should work, like this

    UPDATE t2

    SET t2.Status = t1.Status

    FROM Table2 t2

    INNER JOIN OPENROWSET('MSDASQL',

      'Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\mydb.mdb;Uid=admin;Pwd=',

      'select * from Table1') t1

    ON t1.ID =...

  • RE: Getting Max Value from list

    If all columns the same datatype, ugly, poor performance but maybe ...

    SELECT MAX(maxval) as [maxval]

    FROM (

    SELECT MAX(col3) as [maxval] FROM

    UNION

    SELECT MAX(col4) as [maxval] FROM

    UNION...

  • RE: Simulate Identity column

    Use a temp table and identity column

    create table #temp1 (rowid int, col1 char(1))

    insert into #temp1 values (1,'A')

    insert into #temp1 values (2,'B')

    insert into #temp1 values (3,'C')

    create table...

  • RE: How to Transforming Data

    You caould use another temp table and a loop (see below) but probably not what you want if you do not want to use a cursor. Otherwise your only hope...

  • RE: Functoin call in Dynamic SQL

    How about this

    ALTER PROCEDURE PS_Migration_DBMED_PABI_2 @DbnameSource  _label, @DbNameDestination _label

    AS

    SET NOCOUNT ON

    Declare @sql nvarchar(1200)

    BEGIN TRAN

    SET @sql = 'INSERT INTO ' + @DbNameDestination + '..PABI

    (PA_ID)

    SELECT

    (

    SELECT MIN(pa_id)

    FROM  ' + @DbNameDestination.dbo.PA +...

  • RE: Replace statement on ntext / text fields

    Hopefully the table has an ID column.

    DECLARE @reviewid int, @ptr binary(16), @idx int

    SET @reviewid = 0

    SELECT TOP 1 @reviewid = reviewid,...

  • RE: Self table join

    SELECT d.Account, d.ManTyp,

    ISNULL(a.Document,'') AS [Document1],

    ISNULL(b.Document,'') AS [Document2],

    COALESCE(b.Portvalue,a.Portvalue) AS [Portvalue]

    FROM (

      SELECT DISTINCT Account, ManTyp

      FROM  

         ) d

    LEFT OUTER JOIN a

    ON...

  • RE: Month end date

    quoteShowing your age?

    Ouch!

    quote

  • RE: How to find a number in a space separated string?

    Why are you running it in EM?

    EM will not like queries like this as it cannot substitue the parameter.

    If you are using this in .NET then you can either create...

Viewing 15 posts - 2,566 through 2,580 (of 3,543 total)