Forum Replies Created

Viewing 15 posts - 8,311 through 8,325 (of 8,731 total)

  • RE: Convert years

    I'm sure this article will help you.

    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs[/url]

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: sql server checking equality of tables

    What about using the query that Sean gave you for each database using and except between them?

    select so.name as TableName, sc.name as ColumnName, t.name as DataType,

    --need to divide by...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Group or sum date column (ATTLOG)

    Hi,

    You should help us to help you by delivering ddl and sample data in a consumable format. Because you're relatively new, I did it for you this time.

    Here's a possible...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Cursor runs for a long time

    Eugene Elutin


    I don't think that Luis example will run (WHERE IsSuperUser AND...)

    I forgot to complete the condition, it's corrected now.

    kapil_kk


    how to fetch one by one row using WHILE instead...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Cursor runs for a long time

    For what I understood, you're trying to have Users and PortalUsers for all the employees.

    This should do the trick. However, you might feel more confident using the OUTPUT clause.

    Be aware...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Cursor runs for a long time

    You need to get rid of that cursor. We could help you but you need to provide the code for the stored procedure.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivot Query

    Maybe you can do something like this:

    ;WITH BaseData AS (

    SELECT

    observ_value,

    prod_id_code1,

    create_timestamp,

    modify_timestamp,

    ROW_NUMBER() OVER (PARTITION BY person_id, obs_id ORDER BY...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Query Help

    Please test the solution, I might have made a mistake.

    declare @Temp table(state varchar(50),county varchar(50), city varchar(50),Action varchar(50), ActDateTime DateTime)

    insert into @Temp(State,County,City,Action, ActDateTime)

    select 'Texas','Harris','Houston','Census Taken','11/12/2010 00:00:00' Union all

    select 'Texas','Harris','Houston','Census...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Struggling to create a VIEW in TSQL using code that works fine as a query :o(

    For a simple solution, use a Calendar Table. There are many solutions but here is one that might help you with other queries. http://www.sqlservercentral.com/scripts/Date/68389/

    With that, you can simplify your query...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Automated backup plan

    I'm not an expert in this area (I'm just learning) but an advice I've read says that you shouldn't have a backup plan. You should have a recovery plan:-D.

    You need...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Multiple Rows of Data To Single Row With One ID

    edgar58 (10/16/2012)


    Hi,

    I've explored using Pivot and Case. All help is appreciated.

    Thanks!

    Have you explored using Case (Cross Tabs) with ROW_NUMBER with PARTITION BY Acct_ID?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivot a table

    You should take a look at this article

    http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    Most in here would say you want to unpivot the table 😀

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Critical issue - need help please

    Create a unique constraint on the PO number

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Critical issue - need help please

    Hi, welcome to SQL Server Central.

    Unfortunately, you didn't give enough details for someone to help you out.

    You need provide code or at least the actions that are followed by the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Need the output in excel

    One rule you should follow is not to use code you don't understand. If you need to support it and you don't know what it's doing, you'll be in trouble.

    Read...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 8,311 through 8,325 (of 8,731 total)