Forum Replies Created

Viewing 15 posts - 5,641 through 5,655 (of 6,036 total)

  • RE: READTEXT into variable

    Author posted:

    arrrg! I only need to catch a little piece from a text file!!!!

    My solution absolutely fits this task.

  • RE: READTEXT into variable

    Declare text vriable as a parameter of your SP.

  • RE: DATEFORMAT

    You need to be sure nobody will change settings of front end application and sent you strings with dates in American format. Otherwise you SP will fail again.

  • RE: DATEFORMAT

    Try this:

    SET @StartDate = '05/01/2006'

    SET @EndDate = '25/01/2006'

    And I prescribed to use a function because within function you can check for ISDATE(@string) = 1, if not try another format, etc.

    If...

  • RE: DATEFORMAT

    Something like this:

    CREATE PROC USP_RptActions @StartDateString nvarchar(20), @EndDateString DATETIME

    AS

    DECLARE @StartDate DATETIME, @EndDate DATETIME

    SELECT @StartDate = dbo.SomeConversionUDF(@StartDateString), @EndDate = dbo.SomeConversionUDF(@EndDateString)

    SELECT ...

  • RE: DATEFORMAT

    Two ways to do it.

    1. Check what are the settings of your SQL Server and convert strings from your forms into appropriate format inside your code, before you call SP.

    2....

  • RE: DATEFORMAT

    Datetime values are not stored in database as YYYY-MM-DD. They are stored as decimal numbers where int part represents number of full days passes since 1/1/1900 00:00:00.000 and fractional part...

  • RE: DATEFORMAT

    And you convert you parameters to DATETIME out of SP scope because parameters are datetime datatype.There is no point for SET DATEFORMAT DMY inside this SP.

  • RE: DATEFORMAT

    Use

    @EndDate + convert(datetime, '23:59:00.000')

     

  • RE: Distributed Transaction Trigger Problem

    First of all get rid of @IRN and @RequestNo

    If eventually you insert 2 or more rows trigger will fail.

    You can do it in one statement:

    UPDATE ImagingWorks

    SET DA = 1

    FROM...

  • RE: Specifying GUID''''s as SP Parameters

    Check your data, check datatypes, etc.

    You definitely do something wrong.

    I tested this on real table:

    CREATE PROC dbo.test_Address @RowId uniqueidentifier

    AS

    select * from address where rowguid = @rowid

    go

    declare @RowId uniqueidentifier

    select...

  • RE: READTEXT into variable

    Why not to use simple SUBSTRING ?

    You can use start > 8000 only length must be within 8000 (4000 for "N" types).

     

  • RE: Characters only from A to Z problem

    CREATE TABLE dbo.CharReplace (

       CharToReplace nchar(1) NOT NULL,

       CharReplacement nchar(1) NOT NULL

      )

    INSERT INTO dbo.CharReplace (CharToReplace, CharReplacement)

    SELECT .... -- put here your replacement rules

    SELECT REPLACE(datename(w,t.data), C.CharToReplace , C.CharReplacement )

    FROM Table...

  • RE: Inline function in subquery not working

    You are trying to create "3 dimentional" query: assign table to each cell in another table. SQL Server cannot handle this.

    Create scalar function for

    Select count(*) from dbo.ArticlesByProject(@ProjectID)

Viewing 15 posts - 5,641 through 5,655 (of 6,036 total)