Forum Replies Created

Viewing 15 posts - 4,696 through 4,710 (of 13,460 total)

  • RE: query to count repating alphabet in a string

    saltpepo (9/21/2012)


    Cool Guys u rock.

    Could you give some good links to learn sql basics

    a lot of great guys here have put together a bunch of "stairways" series on many of...

    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: query to count repating alphabet in a string

    Mark-101232 (9/21/2012)


    declare @asd varchar(20)

    set @asd ='asdaaaadffa'

    select len(@asd) - len(replace(@asd,'a',''))

    oh your fast on the draw there, partner!

    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: query to count repating alphabet in a string

    saltpepo (9/21/2012)


    Hello,

    I need to count repeating alphabet only

    a=6 thats it.

    well, 'f' repeats as well in your example.

    the easiest way for the count is simply

    SELECT LEN(@asd) - LEN(REPLACE(@asd,'a',''))

    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: query to count repating alphabet in a string

    saltpepo (9/21/2012)


    declare @asd varchar(20)

    set @asd ='asdaaaadffa'

    so do you want a count of the max number of repeats in the string for each letter?

    so a=4,s=1,d=1,f=2, or are you after just...

    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: Database table, columns and types + more TSQL

    dwain.c (9/21/2012)


    It runs in SQL 2008.

    runs on 2005 also;

    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: Print Statement in Trigger

    jean 93062 (9/20/2012)


    I was reading about this and I think the print statement actually does go somewhere. Another developer recommended that the Print statement be used instead of returning...

    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: Print Statement in Trigger

    jean 93062 (9/20/2012)


    Please tell me where the results of a print statement can be retrieved when the print statement is executed by a trigger.

    Thx. Jean

    if you are running a...

    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: Ever feel your boss is expecting you to make a house out of sand?

    jasona.work (9/20/2012)


    And before anyone suggests making up a pros / cons to actually buying something vs the script, I've done that. I often feel my boss is of the...

    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: Strange taht I cannot connect to localhost but can connect to remote one.

    xinli923 (9/20/2012)


    Error:2

    the entire error message is what we need to help; the state and actual error message are critical.

    error 2 is cannot connect in general;

    for example:

    Microsoft SQL Server Login

    Connection failed:...

    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: Max Recursion issue; Where does the OPTION(MAXRECURSION 250) go?

    yep, answering my own question, found a post from an MS spokesman:

    Unfortunately, OPTION (MAXRECURSION limit) is not allowed in the definition

    of views or user-defined functions. This restriction may be...

    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: Max Recursion issue; Where does the OPTION(MAXRECURSION 250) go?

    agreed, that's where i thought it should go, but when i put it there i get a syntax error:

    Msg 156, Level 15, State 1, Procedure XML_To_ASCII, Line 91

    Incorrect syntax near...

    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: Billing of Materials query

    cidr (9/19/2012)


    lowell 2012-09-12

    @67 posts, i didn't think this was homework for the OP, and i got all excited about making a recursive CTE work before someone else beat me...

    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: Get the overall status of a particular product

    iit depends on your data, if any status other than OK, then it fails, for example?

    With MyCTE (Product,Parts,Status)

    AS

    (

    SELECT 'Laptop1','mouse','OK' UNION ALL

    SELECT 'Laptop1','screen','OK' UNION ALL

    SELECT 'Laptop1','button','OK' UNION ALL

    ...

    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: ms standards doc?

    there's more than a few great threads here on SSC on the subject: i think all of the threads here have actual documents attached from various posters as well.

    http://www.sqlservercentral.com/Forums/Topic590668-338-1.aspx

    http://www.sqlservercentral.com/Forums/Topic857703-391-1.aspx

    http://www.sqlservercentral.com/Forums/Topic560087-145-1.aspx

    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: Billing of Materials query

    Lynn Pettis (9/19/2012)


    And I thought there was no spoon. 😉

    @67 posts, i didn't think this was homework for the OP, and i got all excited about making a recursive...

    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 - 4,696 through 4,710 (of 13,460 total)