Forum Replies Created

Viewing 15 posts - 7,651 through 7,665 (of 13,460 total)

  • RE: T-SQL statement parsing and moving data across databases on same server

    this is a tough requirement,a nd will undoubtedly require multiple passes of SQLs and lots of code; there is no way you can do this in a simple, easy...

    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: Handling truncated leading spaces in Reporting Services

    an HTML report ignores whitespace...so to handle that, you'd probably want to .Replace " ", "& n b s p ; " or with CHAR(160) which is a space 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: How to modify a table outside of the current transaction ? ( with rollback and using linked server )

    mutobo (5/5/2011)


    Hi

    I have read somewhere that is is possible to define a loopback linked server ( pointing to the same source db )

    and use in auditing scenarios to modify data...

    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 are the rules for CAST or CONVERT, and INT vs BIGINT?

    SQL stays in a single datatype when you are doing the math;

    so when you do this portion of your formula:

    8*1024*1024*1024, which are all integers, SQL assumes/shortcuts a decision that INT...

    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 value with lookup on every row

    Sean Lange (5/5/2011)


    Lowell you beat me to the punch again. 😛

    I'm hitting a lot of low hanging fruit today! I'll leave complicated PIVOTS and recursive CTE's to you, ok?

    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 value with lookup on every row

    not sure, i'm not comfortable with teh UPDATE from a subselect, so i'd use this update statement instead:

    UPDATE ADDRESS

    SET ADDRESS_STATE_ID = s.STATE_ID

    FROM zipcode z

    ...

    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: Yet Another Decimal Value Question

    DECIMAL (5,1) means 5 significant digits: 9999.9 is the max amount...so any value larger than that size will result in an arithmatic overflow error.

    i typically always use the same decimal...

    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: Yet Another Decimal Value Question

    it's integer division;

    sql shortcuts and says integer / integer = integer, s 3 / 2 = 1 for example, and not 1.5, so you lose decimal places.

    chnage it 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: Login faield for user 'sa'

    change it again. if you typed in the password in a config file, it's in clear text in that file and a security risk of the highest order.

    create 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: Can't create a view inside and IF block?

    why can't you just issue an ALTER VIEW command? don't you already know it exists, or is this script a create/recreate in case of an empty database?

    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: Deny drop tables but permit drop procedures

    Leonard see this post from yesterday, where someone posted the same question:

    http://www.sqlservercentral.com/Forums/Topic1103306-146-1.aspx#bm1103313

    To prevent the DROP of objects,where the user normally might have permissions to do so, you'll have to use...

    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 write this query

    just add additional columns from the original table to teh query:

    SELECT

    TheDate,

    RUN_TIME,

    USERS_COUNT,

    CONNECTION_COUNT

    FROM

    (SELECT

    DATEADD(dd, DATEDIFF(dd,0,RUN_TIME), 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: Copying text -> Datefield

    i think this is clsoer to what you are trying to do:

    IF you can find a date in the description, set the [Date] field to that value:

    UPDATE [Intermediate invoices]

    SET [Date]...

    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 write this query

    doh; it should be more like GSquared; remove the USERS_COUNT, CONNECTION from the PARTITION statement.

    SELECT

    TheDate,

    USERS_COUNT,

    CONNECTION_COUNT

    FROM

    (SELECT

    DATEADD(dd,...

    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: Copying text -> Datefield

    I've tried updating the first one while using the below query :

    INSERT INTO [Intermediate invoices] (Date)

    Select distinct convert(datetime,[Description 7],105) from [Intermediate invoices]

    you said trying to UPDATE, but your command is...

    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,651 through 7,665 (of 13,460 total)