Forum Replies Created

Viewing 15 posts - 1,351 through 1,365 (of 13,878 total)

  • Reply To: Add a column with default value

    Here is some code which demonstrates this. Notice that I have changed your constraint name to follow the convention DF_[tablename]_[columnname], because constraint names must be unique (within schema).


  • Reply To: Updating a table from another table or a query.

    chaunnahrailey@gmail.com wrote:

    UPDATE tbl_salesactivity_new sn INNER JOIN arh ar ON sn.shipment = ar.shipment_i AND ar.ardelay > '0' SET sn.delay = 'Yes'

    That is almost correct. Just need to shuffle things round a...


  • Reply To: Cumulative count distinct for a period of 3 months

    If you provide your sample data in a more accessible form, like this, you will probably get more responses:

    DROP TABLE IF EXISTS #Transaction;

    CREATE TABLE #Transaction(Transaction_Id INT, Date_Transaction...

  • Reply To: Create Multiple XML Files using SSIS

    This question is strikingly similar to this one.

    Perhaps the responses you received there were not to your liking? You did not even have the courtesy to respond to the...


  • Reply To: Designing a table

    Johnson330 wrote:

    I need to create one table to accommodate this scenario to record the courses each worker did in each job every year.

    Whoever asked you to do this needs to...


  • Reply To: SSIS - Oracle to SQL 2019 Standard error "Unexpected Termination"

    This possibly means that there is a 32-bit version of the driver installed on the server but not a 64-bit version.


  • Reply To: NOT and NULL

    I suggest you get out of the habit of writing = NULL. Instead, write IS NULL. NOT is very useful, do not discard it!


  • Reply To: How to export SQL database tables into multiple XML Files?

    Jobs90312 wrote:

    Or is there any other better way to perform this task?

    Thanks

    Presumably BACKUP/RESTORE is not an option.

    For the volumes of data you are talking about, I'd probably use a pipe-delimited...


  • Reply To: explicite alternative to FORMAT() concerning DATE

    Zidar wrote:

    My goal was to help present dates in form "YYMM". Existing functions such as Convert and Format apparently are tricky to use to achieve requested format.

    FORMAT is not 'tricky',...


  • Reply To: export contents of find to csv

    It seems that you're not trying the suggestions here with any great application.

    Instead, you appear to be waiting for someone here to write the solution for you. Unless you can...


  • Reply To: Unable to drop a user

    Use something like this to generate the statements for changing DB ownership to sa

    USE master;
    GO

    SELECT name
    ,SQL = CONCAT('ALTER AUTHORIZATION ON DATABASE::',...

  • Reply To: Importing XML into SQL Tables using SSIS package

    Yikes, a WHILE loop. No wonder it's slow.

    The following query should do the UPDATE in a single hit. But please test it thoroughly before running it anywhere important.


  • Reply To: Select @XML.nodes with Name spaces Help Please error msg 2209 XQuery nodes

    To answer your other question, CROSS APPLY is one way:

    DROP TABLE IF EXISTS #SomeXML;

    CREATE TABLE #SomeXML
    (
    Col1 VARCHAR(50) NOT NULL
    ,Col2 VARCHAR(50)...

  • Reply To: Select @XML.nodes with Name spaces Help Please error msg 2209 XQuery nodes

    hagar333 wrote:

    Hi Phil ,

    First thank you for your reply and yes it works thankyou..... you are a champion!!

    Phil  what is the best way to apply this logic to a sql...


  • Reply To: Importing XML into SQL Tables using SSIS package

    Updating the column by matching on UniqueId should not take such a long time. Can you show us your UPDATE query? Approximately how many rows of data need to be...


  • Viewing 15 posts - 1,351 through 1,365 (of 13,878 total)