Forum Replies Created

Viewing 15 posts - 31 through 45 (of 359 total)

  • Reply To: How to Retrieve a Substring From a Larger String of Varying Length

    if your using SQL Svr 2016 or greater there is a built in spit string function

     

    STRING_SPLIT ( string , separator )

    declare @str varchar(500)
    set @str ='0107602_000002008823_20150206_1_449589981255609050_20150206__20.26'


    select row_number() over...

    ***The first step is always the hardest *******

  • Reply To: Collation issue

    Collation is stored at DB level so when you restore your DB into the new server the collation will remain the same. You could look at altering the collation after...

    ***The first step is always the hardest *******

  • Reply To: Retry logic for deadlock in while loop

    what are you using the why loop for, what conditions? could you not re-write your query using merge instead of having separate insert and update statements?

     

     

    ***The first step is always the hardest *******

  • Reply To: Pattern Matching using PATINDEX

    you could look at incorporating isnumeric

     

    declare @a varchar(100) = 'GUDR150305R02'
    IF isnumeric(substring('GUDR150305R02',1,1))=0
    Print 'T'
    Else
    Print 'F'

    declare @a varchar(100) = 'GUDR150305R02'
    select substring('GUDR150305R02',5,6)
    IF isnumeric(substring('GUDR150305R02',5,6))=1
    Print 'T'
    Else
    Print 'F'

    ***The first step is always the hardest *******

  • Reply To: Sp_help for Oracle?

    oracle has equivalent information_schema

    Select * from all_tables

    select * from all_views

    Select * from all_tab_columns

    ***The first step is always the hardest *******

  • Reply To: Stored Procedures

    so you cant create a temp table but whoever created this SP can? politics

    why not just convert the SP into a select and run your query before you drop the...

    ***The first step is always the hardest *******

  • Reply To: Stored Procedures

    can you share you SP with us?

    i guess your using bulk insert to read from the txt file and insert into a temp table?

    what do you want use the data...

    ***The first step is always the hardest *******

  • Reply To: Stored Procedures

    Have you created or are you creating the stored proc?

    Why are you not allowed to use a temp table?

    what do you want to do with the results of the query?

    If...

    ***The first step is always the hardest *******

  • Reply To: insert and update

    I find Merge statements are very efficient for upserts (insert,update,delete) operations. could you share with us your execution plan? actual not estimated.

     

     

    ***The first step is always the hardest *******

  • Reply To: ISNULL vs COALESCE

    nice subject, I use coalesce more than often and its always been very useful

     

     

    ***The first step is always the hardest *******

  • Reply To: Writing dynamic SQL to return columns to unpivot

    Try using  information_schema.columns instead of  sys objects

     

    select * from INFORMATION_SCHEMA.COLUMNS

    where  COLUMN_NAME in ('COLA','COLB','COLC')

    ***The first step is always the hardest *******

  • Reply To: Is it possible to keep the SQL catalogues in place after deleting the data from

    why do you want to delete the data but keep the schema? a database without data is just a useless empty box

    ***The first step is always the hardest *******

  • Reply To: I need help to build a query with wildcard and strings.

    When you say you want to return all the 100's are you sating only return a row if the first 3 values are 100?

    so if the data looked like this

    100123

    100124

    101111

    199111

    200111

    would...

    ***The first step is always the hardest *******

  • Reply To: Hit fatal error server is terminating - what do I do next

    if this SQL server is part of a vendor application, i would speak with the vendor before applying any patch. Just to ensure you are covered with your support contract...

    ***The first step is always the hardest *******

  • RE: Database in recovery mode not comming online

    If this is a production database you may want to re consider changing your recovery model to Full and create a DR plan

    ***The first step is always the hardest *******

Viewing 15 posts - 31 through 45 (of 359 total)