Forum Replies Created

Viewing 15 posts - 451 through 465 (of 663 total)

  • RE: changing dates on one instance/database

    Not the best, but seems to be working.

    CREATE VIEW Test as Select DateAdd(hh,2,GetDate()) as TheDate

    GO

    CREATE FUNCTION TestDate()

    Returns @TheTable TABLE ([GETDATE] DateTime) as

    BEGIN

    ...

  • RE: changing dates on one instance/database

    Try a view

    Create view Test as Select DateAdd(hh,2,GetDate()) as TheDate

    I have used 2 hours as an offset value.

  • RE: cast varchar as datetime

    You do not need the 'Fri' characters to convert correctly to a date type. The Day, Month and Year is enough.

    See Books On Line for the CONVERT FUNCTION to convert...

  • RE: cast varchar as datetime

    Try

    CREATE FUNCTION MyStrip(@v varchar(50)) RETURNS Varchar(50) AS

    BEGIN

    Declare @vv Varchar(50)

    Set @vv=Right(@v,DataLength(@v)-CharIndex(' ',@v))

    RETURN Left(@vv,DataLength(@vv)-CharIndex(' ',Reverse(@vv)))

    END

    Select dbo.MyStrip('Fri, 06 Dec 2002 14:52:26 -0500')

  • RE: strange problem with table

    Depends on the number of rows but copy table into another table, like tableTMP, truncate or (drop old,recreate,table,indexes) and copy data back. Maybe run checkdb before repopulating

  • RE: Slow SQL on PC

    Check through windows TaskManager for a excessive disk IO, had it last week on a under resource machine. Set SQL max memory to Total - about 100MB for Windows.

  • RE: Computer lazy after error on programming with SQL

    What I find a less 'intrusive' method is to fire up SQL Profiler and intially track only the sp:completed and rpc:completed events. Then run the sp's manually by copy and...

  • RE: Understanding Views

    BOL 2000 :

    Using Views as Security Mechanisms

    Scenarios...

  • RE: help!!

    Oops this is through Enterprise Manager!

  • RE: help!!

    SQL BOL 2000:

    To attach a database

    Expand a server group, and then expand a server.

    Right-click Databases, and select All Tasks/Attach Database.

    Enter the name of the MDF (master data file) of...

  • RE: Column Ordinal Position changed in OpenRowSet

    Replace the * with the actual column names.

    Select [zBLOOD_TYP_GRP_CD],

    [BTABOGDOM_DESC_TX] ......

  • RE: changing dates on one instance/database

    Interesting question.

    Not that I am aware of, maybe define a function which returns the date/time with your date/time offset applied and use it in the place of GetDate().

  • RE: help with complex query/results

    Agree with dgermundson.

    Depending on what you want to do with the output, one can also use a pivot table in Excel or a crosstab Crystal Reports which will make the...

  • RE: Dynamic SQL With USE

    Can also do a

    Select * from Database..Table Where

  • RE: Memory Table vs Temporary Table

    Just wondering if memory table exceed available memory will SQL / Windows start paging or create a temp table underhood.

    I think there was a previous post saying it's very similar.

Viewing 15 posts - 451 through 465 (of 663 total)