Forum Replies Created

Viewing 15 posts - 376 through 390 (of 429 total)

  • RE: SUM of Latest 4 dates

    I made it this way. Please provide some easy solutions

    DECLARE @CurWeek DATETIME

    DECLARE @Week1 DATETIME

    DECLARE @Week2 DATETIME

    DECLARE @Week3 DATETIME

    SELECT @CurWeek = MAX(DataDate) FROM @DataTable

    SELECT @Week1 = MAX(DataDate) FROM @DataTable WHERE DataDate < @CurWeek

    SELECT @Week2...

  • RE: Urgent - Locking and Exceptions

    Try using number of re-trys and donot report error properties of SQL server job.

    Or

    Create an application with C#, VB which can very well handle these errors and call the...

  • RE: In using a parameter in a stored procedure

    Remi I don't belive you are suggesting Dynamic SQL

    How about this

    CREATE PROC MyProc

    (

    @pParam VARCHAR(2000)

    )

    /* Parse the Params */

    DECLARE @TblParam TABLE

    (

    Param VARCHAR(25)

    )

    WHILE CHARINDEX(',', @pParam) > 0

    BEGIN

    INSERT @TblParam VALUES(SUBSTRING(@pParam,1,CHARINDEX(',', @pParam) -1))

    SELECT @pParam...

  • RE: Passing Database Name as Parameter to a SQL Script File

    It would need to build a dyanic query which will lead to security lapses/issues.

    (Normally db name is determined by the connection unless there is a need to make external...

  • RE: issue with base64 binary data

    Hi NS Rao

  • RE: export to csv using t-sql

    If you can call DTS package from coldfusion (We can do it with ASP) create a DTS Package and Execute the package.

  • RE: need help with this report

    Made it without a loop.

    SET NOCOUNT ON

    /* Add sample Data Start */

    DECLARE @status TABLE

    (

    RecTime DATETIME,

    Status VARCHAR(25)

    )

    DECLARE @DELAY INT, @DELAY1 INT

    DECLARE @CTR...

  • RE: Max Min Agg func blues ...

    You have all the these functions in crystal Reports. It is a way better than access I would say. Max, Min, COunt, Avg allare there you name it it is...

  • RE: Searching a Table

    I would assume '2005/a/b/001' is record number and is in one column.

    Next recorde would be some thing like '2005/a/b/002'  the '/' in the data is confusing.

    IF EXISTS (SELECT *...

  • RE: Max Min Agg func blues ...

    There can be

    Only one row for the criteria or

    somtimes it happens to me. Make the changes but forget to excute the changes in the data base.

    Query looks fine...

  • RE: 5 mins report

    I had to go another level to get the results.

    SET NOCOUNT ON

    DECLARE @temperatures TABLE

    (

    TempTime DATETIME,

    Temperature NUMERIC(5,2)

    )

    DECLARE @CTR INT

    DECLARE @Temp NUMERIC(5,2)

    DECLARE @myDate DATETIME SET @myDate = '06/07/2005'

    SET @CTR = 0

    WHILE @CTR <=...

  • RE: How to deal with this DATETIME issue!

    The problem is if the regional settings of a client is dd/mm/yyyy and regional SQL server date format is mm/dd/yyyy. Client will send 02/03/2005 as 2nd March and Server will...

  • RE: Wildcard in Dynamic SQL

    SQL Server version 6.5 we face a lot of problems like this. There If the table has datatype varchar(10) and if we insert a 11 character string it doesn't complain....

  • RE: group by

    SELECT university_id,college_id,department_id,year_id,semister_id, grade, count(student_id) as number_of_students

    FROM

    (

    SELECT university_id,college_id,department_id,year_id,semister_id,'grade'=

       CASE  WHEN score <.5 then 'c'

         WHEN score>=.5 AND score< .7 THEN 'b'

         ELSE 'a'

         END,

     student_id

    FROM  university_grades

    WHERE university_id=@university_id AND

  • RE: Wildcard in Dynamic SQL

    Also check the length of variable that holds dynamic SQL.

Viewing 15 posts - 376 through 390 (of 429 total)