Forum Replies Created

Viewing 15 posts - 3,211 through 3,225 (of 13,460 total)

  • RE: how to substring chunks of a string starting at different positions?

    drew how about using patindex to find the first [0-9] match?

    this gets us kinda close, i think, except for that "10 SERIES BP MIS MONITOR"

    select

    patindex('%[0-9]%',drugname )...

    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: 3 or more txns in 3 hours

    we can probably help, but not without providing some DDL and sample data that represents the structure and data we need to look at;

    if you can convert "customerID, transactionid, transactiontime,...

    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: Linked Primary Keys after INSERT within the same table

    do you mean how do you get teh newly created PK values for data you inserted? especially so you can then do a subsequent insert into a child table?

    the answer...

    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: granting insert access for everyone to a table

    yep that's exactly correct. you end up doing a GRANT INSERT ON dbo.ServerLogonHistory TO public in the AuditDb; that way your trigger does not run into permissions issues when...

    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 insert images or pictures in sql 2005 table

    the absolute best way is via a programming language.

    you'd need to first establish some sort of relationship to the data...that is, you know that C:\AutoCad\drawing_424.tif

    is related to a specific record...

    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: joining multiple databases in one Sr...

    you'll run into permissions problems accessing, say 10 databases in a single query;

    the calling user would need at least read permissions in every single database for the specific table(s) involved..

    i...

    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: Data movement from one server to another

    kapil_kk (6/26/2013)


    But Lowell when we do a backup and restore on another server then I faced problems related to collations. what to do in this scenario?

    collation differences can be 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: Syntax error in SQL Statement when executing SPROC

    can you change this:

    EXEC(@finalquery)

    to this, and paste the results after running the procedure?

    PRINT @finalquery

    EXEC(@finalquery)

    also, is there any reason you are rrunning it twice in the same proc?

    EXEC(@finalquery)

    EXEC sp_executesql @finalquery

    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: Exporting Output Data of an Stored Procedure

    wak_no1 (6/26/2013)


    Thanks.

    If I run the SP unaltered, it outputs a neat looking script, is there no way I can simply backup the output, without having to amend the SP and...

    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: Syntax error in SQL Statement when executing SPROC

    also, this looks incorrect to me, there's commas, double commas but no values:

    'AND (@Part_Type_MP = ,, OR (CHARINDEX(, + CAST(P.Part_Type as VARCHAR(50)) + ,, @Part_Type_MP) >0))'

    is it the single quotes...

    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: Syntax error in SQL Statement when executing SPROC

    well, syntax wise, it's fine for SQL2008; i was able to create it without a problem.

    on a SQL2005 or compatibility 90 database, i get an error because SQL2005 did not...

    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: Data movement from one server to another

    i would do a backup and restore as -a-new-database name so both sources are on a single instance, and then review the differences for either specific insert/update/delete, or a MERGE...

    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 Showing sp_executesql in SSMS

    mister magoo i have a kinda-sorta solution i use for that issue; instead of a drag and drop, i have a keyboard shortcut in SSMS that i call on any...

    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: Subquery returned more than 1 value. This is not permitted when the subquery follows

    psingla (6/26/2013)


    use

    if (select TOp 1 UNITE_COUT_MATERIEL from DIM_INTER_MATERIEL)= 'Unité'

    or

    if exists (select 1 from DIM_INTER_MATERIEL where UNITE_COUT_MATERIEL = 'Unité')

    both the above query will work in your case.

    sub query...

    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: Exporting Output Data of an Stored Procedure

    if you know the shape of the data being output from the procedure, you can insert it directly into a table;

    for example, if your proc returns a single column table...

    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 - 3,211 through 3,225 (of 13,460 total)