Forum Replies Created

Viewing 15 posts - 10,186 through 10,200 (of 13,460 total)

  • RE: Convert DATETIME to TIMESTAMP

    ahh, SQL and oracle TIMESTAMPS are not the same thing.

    in Oracle, the TIMESTAMP data type is a very granular datetime field.

    SQL> SELECT CAST(date1 AS TIMESTAMP) "Date" FROM t;

    Date

    -----------------------------------------------------

    20-JUN-03 04.55.14.000000 PM

    26-JUN-03...

    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: Mark similar records in a table with millions of records

    stating the obvious, do a backup, test this on a development server, ask questions, confirm it is close to what you are after.

    --update the whole table

    UPDATE transactions

    SET matchingid =...

    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: Mark similar records in a table with millions of records

    mano you are not taking advantage of the power of SQL's set based operations;

    you could do your update, to all millions of records, in a single statement....even better, it would...

    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: To display database records b/w 100 -200

    as long as you know how the data will be ordered, row_number() function is probably the best solution:

    SELECT * FROM

    (

    SELECT row_number() over (ORDER BY YourColumn) As RW,

    * from YourTable

    )...

    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: Find Max Field Length Multiple Tables and Multiple Fields

    here you go Roger; a project like this has to use the metadata to determine which columns to query, so using a cursor in this case is fine;

    the logic 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!

  • RE: Size of MDF and LDF Files

    could it be you do not have a regular backup schedule in place in that location, and that is causing your unnecessary growth?

    the ldf is the log file. if your...

    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: @@identity bring back wrong number

    if there is a trigger on your destination table, @@identity could return the identity from that other table instead of the one you inserted; that's why you need 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: Create user

    it's a tricky problem; if you give me a username and password, I can use any application i can get my grubby fingers on to connect with.

    the easiest solution 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!

  • RE: How to loop through fields rather than records...

    I think the key is the expected output; if you can accept a single column with a string which contains the values, or do you still have to have up...

    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: Is it Possible to renumber a Identity Column?

    a key question is are their foreign keys tied to the current identitiy?

    if there are, it makes it a lot harder, since you'd have to update those child foreign keys...

    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: Cannot add or update Activity record because Account Owner does not exist.

    i'm thinking some overnight import/update process is failing; there's no "Activity record" or "Account Owner" as far as SQL is concerned; it really jumps out to me that some unattended...

    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: Cannot add or update Activity record because Account Owner does not exist.

    looks like a business rule error in your application, not anything from SQL itself; I'd guess you have an app that is writing to the error log, instead of sya,...

    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: check constraints how can I make use of these

    i've seen this requirement before:

    check out the Check Constraint example i made here, aptly named "ThereCanBeOnlyOne"

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

    it uses a check constraint to make sure zero or one of the columns has...

    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: Where cannot we use "default"

    a default sets the value of the column, so common sense would make you think of columns that cannot have the same value more than once.

    i'd test it to 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: Identity column maxed out

    Joe-420121 (12/21/2009)


    The following procedure is OK?

    1. Create Table [backup12212009] with BIGINT Indentity

    2. using SSIS export data from old table to [backup12212009]

    3. Delete old table

    4. Rename backup12212009

    Can do as above?

    if 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!

Viewing 15 posts - 10,186 through 10,200 (of 13,460 total)