Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)

  • RE: What seems like an easy task is kickin my butt. :(

    truncate the time from your date field.

    try this:

    select cast(cast(TransDate as int) as smalldatetime) as TransDate, sum(CR) as dailyTotal, paytype,

    ...

  • RE: xp_cmdshell Limitation

    can you give us an example of the command line?

    I think your command line require a user input, or something

  • RE: Select string truncation problem!

    If you want to review your generated sql in the interface you can cast him as xml, see the example

    declare @sql nvarchar(max)

    select @sql = replicate('0123456789'+char(13)+char(10),400),

  • RE: how to save a blob to harddisk?

    use a format file with this content:

    9.0

    1

    1 SQLBINARY 0 0 ...

  • RE: Delete rows without key

    GSquared suggested you a much faster solution, I will finish his script for your situation:

    delete tx from dbo.table_xx tx

    inner join (

    select t1.*

    from table_1 t1 left outer join table_2 t2...

  • RE: more elegant search

    Hi wdillon and Jef,

    I purpose you one solution witch will not replicate the procedure entirely (the strings have same relevance)

    First create a table which contains all the strings - you...

  • RE: Query optimization

    rbarryyoung (6/26/2008)


    Catalin Enescu (6/26/2008)


    Jeff Moden (6/26/2008)


    Alright... you need to tell us why you say that... useless for what?

    nolock hint on select statement

    according to BOL :"This is the default for SELECT...

  • RE: Creating a view on stored procedure

    in fact you can, it's not a direct way and not recommended for production databases

    try this:

    create view who as

    select * from openrowset('SQLOLEDB','Trusted_connection=yes;Data Source=(local)','exec sp_who') who

    go

    select * from who

  • RE: Query optimization

    Jeff Moden (6/26/2008)


    Alright... you need to tell us why you say that... useless for what?

    nolock hint on select statement

    according to BOL :"This is the default for SELECT operations"

  • RE: Increase Max characters retrieved in SQL SERVER 2005

    cast the field as xml:

    select cast('<FieldContent><![CDATA['+FieldName+']]></FieldContent>' as xml) as FieldName from ....

    I don't know how to increase non XML data length more than 65535 but you can increase XML...

  • RE: Query optimization

    with(nolock) on select statement are useless

    I suppose you already solve the problem but... for the art 🙂 you can try this script and post the select execution time after

    alter table...

  • RE: Finding and object in multiple databases

    I have a procedure that you can use for this and can be used for finding tables or views also.

    I hope will help you

    example: exec spSearchObject '%SearchObject%', '%','P'

    create procedure...

  • RE: Query optimization

    I have another suggestion: create a computed persisted column for CONVERT(INT, RIGHT(vendor, LEN(vendor)-1)) and index this column. Make the left join on this and exclude the the useless isnull() part...

  • RE: how to save a blob to harddisk?

    I have same problem and the solution suggested by tung does not working (add some descriptors at beginning of the file, for JPG also)

    1. create a format file "bulk_data.fmt" containing:

    9.0

    1

    1...

  • RE: Creating create table script

    I'm interested if you found a script for that, if not I'm interested to collaborate to make one

Viewing 15 posts - 1 through 15 (of 16 total)