Preparing Demo database for sales purpose

  • Hi Gurus,

    Could you please tell me how to prepare a demo database for sales team? I have to write a generic script which sales guys would run it before they go for demo.

    Thanks,

    Nagarjun.

  • What kind of database will it be? If you are simply looking for any database, perhaps Adventure Works might serve you well.

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • I want to update all datecolumns or shift dates to recent so that it would appear as fresh data. I want to have generic query which does this for me.

    Thanks,

    Nagarjun.

  • bommaka.nagarjun (5/11/2012)


    I want to update all datecolumns or shift dates to recent so that it would appear as fresh data. I want to have generic query which does this for me.

    Thanks,

    Nagarjun.

    Please provide the DDL and sample data along with the expected result

    This would be really helpful in solving the issue

    Have a look at the link in my signature to know how to do it


    Kingston Dhasian

    How to post data/code on a forum to get the best help - Jeff Moden
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Without knowing your database and the data stored within, not much we can do to help you. You need to understand we can't see what you see from here.

    I'm pretty sure you don't want to post you entire database and sample data here, so the only suggestion I can make is take one of your key tables, obfusicate it some, along with some sample data, post the CREATE TABLE and INSERT INTO statements here, along with the the expected results based on the sample data. With that, we should be able to help you by providing you with some sample code that you could then modify for your use.

  • CREATE TABLE [dbo].[faxes] (

    [ID] int NOT NULL,

    [Fax_Date] datetime NULL,

    [Audit_ID] int NULL)

    ON [PRIMARY];

    GO

    Insert into faxes values (1,'6/5/2012',1000)

    Insert into faxes values (2,'6/25/2011',1000)

    Insert into faxes values (3,'8/15/2010',1000)

    Insert into faxes values (4,'9/25/2009',1000)

    Insert into faxes values (5,'10/5/2010',1000)

    Insert into faxes values (6,'7/25/2008',1000)

    Insert into faxes values (7,'6/25/2011',1000)

    Insert into faxes values (8,'9/15/2010',1000)

    Insert into faxes values (9,'6/5/2009',1000)

    Insert into faxes values (10,'2/25/2012',1000)

    I am giving sample table with sample data So that i could use the same logic for other tables. Since I use faxes table for my application, when sales people go for demo all the dates have to be shifted to recent dates so that data would appear as fresh. My original table would have millions of records.

  • bommaka.nagarjun (5/11/2012)


    CREATE TABLE [dbo].[faxes] (

    [ID] int NOT NULL,

    [Fax_Date] datetime NULL,

    [Audit_ID] int NULL)

    ON [PRIMARY];

    GO

    Insert into faxes values (1,'6/5/2012',1000)

    Insert into faxes values (2,'6/25/2011',1000)

    Insert into faxes values (3,'8/15/2010',1000)

    Insert into faxes values (4,'9/25/2009',1000)

    Insert into faxes values (5,'10/5/2010',1000)

    Insert into faxes values (6,'7/25/2008',1000)

    Insert into faxes values (7,'6/25/2011',1000)

    Insert into faxes values (8,'9/15/2010',1000)

    Insert into faxes values (9,'6/5/2009',1000)

    Insert into faxes values (10,'2/25/2012',1000)

    I am giving sample table with sample data So that i could use the same logic for other tables. Since I use faxes table for my application, when sales people go for demo all the dates have to be shifted to recent dates so that data would appear as fresh. My original table would have millions of records.

    Based on the above sample data, what would you like to see as the result of the update to the data?

    Need to show us not just tell us. I have no idea what you mean by making the data appear fresh. One persons idea of fresh data may be different from someone elses.

  • I mean to say all the dates that are there in the date filed should be shifted by some number of days but should not be greater than current date.

  • bommaka.nagarjun (5/11/2012)


    I mean to say all the dates that are there in the date filed should be shifted by some number of days but should not be greater than current date.

    Okay, I can show you how to shift the dates.

    update dbo.faxes set

    Fax_Date = dateadd(dd, 1, Fax_Date);

    There, shifted the date by a day. The rest is up to you.

  • bommaka.nagarjun (5/11/2012)


    I mean to say all the dates that are there in the date filed should be shifted by some number of days but should not be greater than current date.

    Made a slight change to the code.

    update dbo.faxes set

    Fax_Date = dateadd(dd, 1, Fax_Date)

    where

    Fax_Date < getdate();

    There, shifted the date by a day. The rest is up to you.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply