Forum Replies Created

Viewing 12 posts - 16 through 27 (of 27 total)

  • RE: Difference between type and xtype fields in sysobjects

    No, I am sorry.  I don't recall where I found it.  I was working with version 7 at the time, using an old, old administrator's handbook I had and trying...

  • RE: Difference between type and xtype fields in sysobjects

    I am 90% sure that 'type' is to provide backward compatibilty to old versions of SQL Server. 

    xtype is the 'real' field that you want to use. 

  • RE: new year new number Generating in SQL server

    That looks like a snippet of code from a bigger VB program.  You appear to be accessing a table thru an ADO connection.  You need to alter the ADO Connection...

  • RE: What does N... mean?

    'N' casts the string as a double-byte string (two bytes per character, international language support).  The destination field is type nchar, nvarchar, etc. 

  • RE: Replacing imbedded blanks

    Another way....  (un-comment print statements to watch it work)

    CREATE PROCEDURE spStripSpacesToComma

         @sVariable varchar(50)

        ,@sReturn varchar(50) OUTPUT

      as

    declare @iPtr integer

    set @iPtr = 0

    select @iPtr = charindex(' ', @sVariable, @iPtr)

    while @iPtr...

  • RE: OPENXML and non-ascii characters

    This is a little out of my area, but I think you need to handle the double-byte character in a nchar field rather than plain old, char.

  • RE: Calling SQL Scripts

    CREATE PROCEDURE spRunEmAll as

      EXEC spProc01

      EXEC spProc02

      EXEC spProc03

      EXEC spProc04

    etc...

    I would normally implement this sort of thing using .CMD files and the ISQL commandline interface.  I find...

  • RE: Identifying changed rows in a table

    You don't have to make the application keep track of updates to the table.  Create TRIGGERs to handle the INSERT, UPDATE and DELETE events.  You can maintain a 'shadow' table...

  • RE: Help

    You can use a cursor and a nested loop.  Dress up the output by altering the PRINT statements.

    -- Cursor variables...

    declare @msg as varchar(50)

    declare @area as char(2)

    declare @store as char(6)

    -- Work...

  • RE: SP ScriptProblem

    Try this instead:

    declare @UnitWeight as Real

    SELECT @UnitWeight  = SUM(FVALUE) from ITEM

     

  • RE: DateTime to Character

    Error is in the eye of the beholder, I suppose.  But by definiton there could never be a matching record in Table1.  The join 'works', but there are orphaned rows. ...

  • RE: DateTime to Character

    How about...

    select t1.datefield, t2.datefield, t2.timefield, .....

      from Table1 t1

        inner join Table2 t2

          on t2.datefield = convert(char(10), t1.datefield, 101) and

             t2.timefield = convert(char(8), t1.datefield, 114)

    Assumes your dates are mm/dd/yyyy...

Viewing 12 posts - 16 through 27 (of 27 total)