Forum Replies Created

Viewing 15 posts - 3,061 through 3,075 (of 13,460 total)

  • RE: Find integer at end of a string. There *must* be a better solution ?

    probably very similar, using reverse and patindex for the first non numeric character: from there, for the 1/-1, a case based on the len() would be what i would use.

    with...

    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: Conditional print for testing scripts.

    procedure a supposed to be called with the full EXEC ProcName @Parameters or EXECUTE ProcName @Parameters.

    only when a procedure is the only line item (or the first line item in...

    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: Grant permission to access only 2 tables in a database

    Learner, it kind of sounds like these users are sysadmins? i don't think you can deny a sysadmin anything, so you have to take away their superpowers before you can...

    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: Simple Interview Question

    its a binary AND operation.

    5 = 00000101

    17 = 00010001

    the only column in BOTH values binary representation above is the first column, representing 2^0, so the value is 1.

    16...

    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: Securty Trigger stroed procedure

    ok i created this complete example by merging some of your stuff into my known, working trigger example.

    it's working well for me, but has a couple of duplicate columns 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: Update table values if corresponding values change in another table

    pwalter83 (7/24/2013)


    Thanks Lowell,

    However, I was wondering is it not possible to implement this logic within the table structure because as I mentioned earlier, the values in one table would 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: Update table values if corresponding values change in another table

    pwalter83 (7/24/2013)


    Hi,

    I am very new to SQL and really dont know how to phrase my question.

    There are 2 tables linked through a primary key and if the values in...

    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: Looking for clean way to aggregate the same column multiple times in my query

    can you use the trick of a SUM(CASE...

    not sure if you need a count, or the coutn distinct for each item:

    SELECT

    [DateofScan]

    ,[DeviceType]

    ,count([PlugInID])

    ,SUM(CASE WHEN Critical = 'Y' THEN 1 ELSE 0...

    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: Are the posted questions getting worse?

    Koen Verbeeck (7/23/2013)


    Didn't know this site censored some words.

    Hum. Whaddayaknow...

    Oh man,so you've been added into the naughty list, then right?

    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 Trace on a specific report

    you should be able to fix it without a trace at all; the error is in the report itself.

    somewhere in that' reports definition,you've got something like

    ...WHERE ClientID = (SELECT...

    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: After Insert Trigger won't fire - Same Trigger exists on 35 other tables working perfectly - Why won't THIS one fire?

    sturner (7/23/2013)


    Yeah, there is something sort-of fishy about a design that would incorporate that kind of [il]logic in a trigger. But without seeing more information about this entire design there...

    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: After Insert Trigger won't fire - Same Trigger exists on 35 other tables working perfectly - Why won't THIS one fire?

    i'd consider rewriting the trigger to support multiple rows by joining to the tables instead .

    something like this looks right to me:

    edit: Exactly what sturner was thinking. I'm too slow!,...

    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: After Insert Trigger won't fire - Same Trigger exists on 35 other tables working perfectly - Why won't THIS one fire?

    i think the issue is really that the trigger is not updating anything, right, and not that the trigger does not fire?

    my first guess would be that the inner condition...

    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: Delete From Scripting Help

    david.ostrander (7/23/2013)


    Hello –

    I currently have an SSIS package running and the first part of it deletes all data in (Table A) but saves the rows with the PIT 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: update script

    well, assuming this section is still in your original script

    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N' [product]]') AND type in (N'U'))

    note that it is looking for 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!

Viewing 15 posts - 3,061 through 3,075 (of 13,460 total)