Forum Replies Created

Viewing 15 posts - 7,576 through 7,590 (of 13,460 total)

  • RE: How to sort any type of data in sql

    seshukumar.thokala (5/12/2011)


    Hi Lowell

    I tried ur example wt u posted but my problem is in my database i am having data like 30.6.1 so how to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to sort any type of data in sql

    Sergiy (5/11/2011)


    Lowell (5/11/2011)


    it ooks like the desired sorting is "strip non numeric chars and order by the numeric portion(if it exists) then by the string"

    Your assumption is onviously wrong.

    Look at...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Join vs Where

    it's the left join that is confusing you.

    in the first query, the left table has all rows, and matching records from the second table get joined.

    after that, you are filtering...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Replication or Triggers

    you should avoid(actually...i say never) trying to move data to another database or another server from within a trigger; the trigger could fail and rollback if the database/network/latency issues arise....

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: bcp row terminator

    slash-r is for the RETURN of CrLf, very typical from unix/linux-sourced files: slash-n is CrLf, which you were already aware.

    vbCrLf = CHAR(13) + CHAR(10) = \n

    vbCr = CHAR(13)...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL Newbie in Need of Help!!!

    Aaron you want to change it a little so your lookup tables get populated by a SELECT featuring the DISTINCT clause:

    ----INSERT INTO WorldTable using Select

    INSERT INTO World (Description)

    SELECT DISTINCT World

    FROM...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: single column data spit into multiple columns to another table

    my only suggestion is going to echo Mike; show us what you have so far; if the columns are variable length, I'd end up writing a program instead of trying...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How to sort any type of data in sql

    it ooks like the desired sorting is "strip non numeric chars and order by the numeric portion(if it exists) then by the string"

    so

    ORDER BY

    CASE

    WHEN ISNUMERIC(dbo.StripnonNumeric(ColName))...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: single column data spit into multiple columns to another table

    you can simply use the SELECT... INTO TABLENAME FROM ... functionality to create the table, wethehr permenant or temp, of the fly:

    SELECT SUBSTRING(ColumnData,1,3) AS ,

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Function to calculate fiscal days between two dates

    ok in theory, this is pretty close. I didn't test too many examples, so its up to you to improve it and test the edge cases, but it seems to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Reducing software created db_owner rights

    yep i had inherited a similar situation; i created a role that had access to db_datareader,db_datawriter and EXECUTE, and replaced their original db_owner model; that worked for 99% of what...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Calculate future date based on input date. Must be rolling

    ok i think this might help you visualize:

    /*

    InputDate StartOfMonth AS...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Function to calculate fiscal days between two dates

    with MySampleData

    AS (

    SELECT

    '06/01/2007' as StartDate,

    '10/04/2010' as EndDate

    )

    SELECT *,

    datediff(dd,StartDate,EndDate)

    FROM MySampleData

    ok that returns 1221 days...but lets...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQLRally Orlando 2011!

    we should all plan on meeting for a networking session at a local restaurant or something Thursday night; at least it'd be nice to put a face to your forum...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How do I go from SQL 2008 build 10.0.1600 to build 10.50.1600

    ma29 (5/10/2011)


    I do have an R2 version do I need to go through the whole install or does it update all

    aspects of the program.

    that's up to you; you can either...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 7,576 through 7,590 (of 13,460 total)