Forum Replies Created

Viewing 15 posts - 1,756 through 1,770 (of 3,544 total)

  • RE: Reading Binary Data

    quote...the '00' unicode country code in these examples sticks out like a sore thumb...

    Thanks Jeff

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Reading Binary Data

    Try

    CAST([columnname] as nvarchar(100))

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Check for 0 rows on list of tables

    Change

    set @mysql = 'select count(*) from ' + @myname

    select @mycnt = count(*) from @myane

    set @mycnt = execute(@mysql)

    to

    set @mysql = 'select @mycnt=count(*) from ' + @myname

    exec sp_executesql @mysql, N'@mycnt int...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Why is this subject to deadlocks?

    Ah, OK

    Besides any solution will require a SELECT/JOIN because of the INSERT

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Unique datetime for each row

    Heck, I only found out when I experimented before my first post

    There is always something in SQL to catch me out

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Why is this subject to deadlocks?

    quoteDon't use NOT EXISTS. It forces the whole table to be looked at because it has to check...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: grouping by character data

    If data consists of fixed values then use CASE statements and GROUP BY

    If data consists of variable values then create a function to concatenate data for and use it...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Unique datetime for each row

    But for uniqueness it is 4.

    ie add 3 or 4 milliseconds to 13 milliseconds and you will get 17 milliseconds for both

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Unique datetime for each row

    The only way I can think of is to use temp table/table variable to store the unique key of the selected records plus IDENTITY column and update datetime using the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: convert a column of varchar data type to datetime

    Just some observations

    You will not be able to update the new column in a set based update unless all of your dates are valid or SQL will stop at the...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Update Table on a LINKED Server

    You could try to reduce the rows selected in the Linked Server like this

    UPDATE u

    SET [LinkCol_1] = l.[LocalCol_1]

    FROM OPENQUERY(LinkedServerName, 'SELECT [LinkCol_ID],[LinkCol_1] FROM DBName..TblName WHERE LinkCol_3]=''ABC''') u

    INNER JOIN...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Trigger Syntax Using Columns_updated

    Something like this

    IF ((SUBSTRING(COLUMNS_UPDATED(),1,1) & 128) > 0 OR 

        SUBSTRING(COLUMNS_UPDATED(),2,1) > 0 OR 

       (SUBSTRING(COLUMNS_UPDATED(),3,1) & 7) > 0) AND

       EXISTS(SELECT * FROM [2nd table] WHERE ...)

       RAISERROR ('Record is...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Convert month number to month names

    or

    DATENAME(month,DATEADD(month,[monthcolumn],-1))

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Evaluating Derived Columns within a Select

    Are you looking for SQL Server solution?

    Translate Access to TSQL first

    SELECT @YearInput AS [input],

      s.Department,

      s.DateAwarded,

      s.StudentNumber,

      p.Forenames AS fore,

      p.Surname AS Sur,

      s.Mode,...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: fin date month year diff

    DECLARE @months int

    SET @months = DATEDIFF(month,@firstdate,@seconddate)

    SELECT @months % 12 AS [Months],@months / 12 AS [Years]

    Some more detail and example data and results would be helpful

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 1,756 through 1,770 (of 3,544 total)