Forum Replies Created

Viewing 15 posts - 2,086 through 2,100 (of 13,460 total)

  • RE: CASE Statement with NUll, converting to (2) decimals

    your case statement was 99% there:

    you got caught with syntax, minor tweak to get ove rthe "IS" error:

    CASE --nothing goes here when formula is used in a WHEN a.exposure_amt

    ...

    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: Creating a trace to log values updates by job

    profiler/trace/extended events tell you what commands were executed, but not what data changed.

    an audit can tell you that a value changed.

    the best way to handle it is of course 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: forgot rules syntax

    i think you want a constraint like this:

    this is what you want to prevent in the future: anything that is NOT numbers

    select p.Pext,* from person_test2 p where p.Pext like...

    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: What is the full form of mdf, ldf and ndf ???

    Ronnie Jones (1/16/2015)


    I'm thinking more along the lines of:

    .mdf = master data file

    .ldf = log data file

    .ndf = "next" data file

    🙂 Crazy I know...

    ya'll missed the southern naming influece here....

    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: forgot rules syntax

    oh i missed combination of NUMBERS.

    rules are being deprecated, you should just create a check constriant.

    I know you said you can't add constraints, but technically a rule is a kind...

    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: forgot rules syntax

    tcronin 95651 (1/16/2015)


    I have a 3rd party app and db where I can not add constraints or change the data type. They have a phone extension field defines 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: Creating Linked Server Failed

    to use "be made with the logins security context", the user must be a user on the domain.

    if the user was a SQL user, an anonymous connection is made, which...

    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: T-SQL for thousands of HTML emails: best way(s) to store/reference image?

    it would be more efficient to refer to an image that exists on the internet.

    the size of the email is reduced, and also the throughput to your email server.

    I know...

    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: user permission issue

    to grant permissions to other users, your user also needs the db_securityadmin priviledge

    scroll down to "Permissions" on this page, and it's got the gory details:

    http://msdn.microsoft.com/en-us/library/ms188371.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: How to ignore "String or binary data would be truncated"

    halifaxdal (1/16/2015)


    no way i know of to ignore errors, you have to explicitly use LEFT functions in the SELECT or something to work around this issue.

    based on your table, only...

    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: Help Needed in Calculating Average

    looks pretty straight forward to me:

    select

    AVG(RSCORE) AS ScoreAvg,

    AVG(RAmount) As AmtAvg,

    AVG(Rvisit) AS VistAvg,

    SUM(TotalAmt) AS TotalAmount

    ...

    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 ignore "String or binary data would be truncated"

    halifaxdal (1/16/2015)


    Hello, I have a script to be used to backup a specific table in a weekly basis, here is the approach what I take, if you have a better...

    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: Looping through Cursor and executing Stored Procedure. Stored procedure runs only once for one record

    your cursor is not designed correctly.

    it gets the first record, does nothing, gets the next record, processes it, and then hits the END.

    the last statement before END must be 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: How to get a better error message back?

    as far as i know, this is a limitation in SQL for the try catch; you can only catch one error, regardless of the number of errors actually thrown.

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3476a931-3db7-4017-9fbe-e082f2de2cb0/sql-server-trycatch-inner-exception-message-conundrum?forum=transactsql


    ....Yes, this...

    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: Create a script to search for a missing word or a phrase

    i can't help with the nolock, but i bought a plugin for SSMS called SQL Enlight, which does check scripts for semi colons,fully qualified schema names, aliases and more; this...

    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 - 2,086 through 2,100 (of 13,460 total)