Can i write blogs in MSDN related to SQL Server?

I am very passionate when it comes about SQL Server.
From the past 10 months i am writing blogs in SQL Server, and still i consider myself to be in a learning phase, which keeps me improving day by day.
You can see my blogs at: www.sqlservergeeks.com/blogs/piyush.bajaj.2007
So now i also want to contribute to MSDN with my knowledge, and i feel that it be my pleasure to write for Microsoft.
Thanks
Piyush

Hi Folks,
Just for an update on this topic: are the MSDN blogs still only for MS employees?
Thanks.
Hope this helps,
Guillaume Rouyre, MBA, MCP, MCTS |
No its not available for Non MS , but you know what you can write your blogs on Technet Wiki which is a portal given to public by SQL Server. We have competition every month where article written in various category is judjed by MS employees .Refer below
link
Technet Guru Competition
If you have a article add it in Technet Guru Competition for May 2014 month
Technet Guru Competition May 2014
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
My TechNet Wiki Articles

Similar Messages

  • How can i make iphone mobile website,  database in Sql Server 2005 ?

    how can i make iphone mobile website,  database in Sql Server 2005 ?
    Thanks & Regards
    Jamshed Ali
    Email id: [email protected]

    You need to be a little clearer in what you're asking.
    You can't make any web site in SQL Server - it's a database engine, not a website tool.
    What you can do is create web sites that pull data from a back-end SQL Server, but the SQL server doesn't handle the client connection at all (that's handled by a web server such as Apache, IIS, or similar).
    There are many ways to build such a site including .NET, PHP, Perl and more (although I don't know all the options for Windows servers because they're not as common outside of corporate/enterprise networks).
    In either case, given your choice of development language (HTML, plus one of the PHP/Perl/.NET/etc. options), plus your database (SQL Server) plus your web server (IIS, Apache, etc.) you can make any web site you like (or, at least, you're capable of developing).
    If you want to opimize that web site for iPhones then there are many references on how mobile browsing differs from the desktop. I'd recommend this book as a reference (and, yes, I understand the irony of linking to a paperback book for web design guidance ). Googling mobile web design (or iPhone web design) might yield more results.

  • Any one can provide me a free JDBC dirver for SQL Server 7.0

    I have searched it on microsoft web site, but I can only find it for SQL Server 2000, is anybody can provide me a free JDBC dirver for SQL Server 7.0?
    Thanks a lot!

    cheers chiliast,
    yeah aveconnect trial version did expire
    after 30 or something.. days.. and it did provide unlimited no of
    connections ..
    We found it to be really worth a try and even buy..
    I think that for commercial purposes and serious programing,
    its better to buy a driver, because all the better ones are
    evaluation versions :-( , and there are no many free drivers
    around.
    anyway if you really need a free driver,..
    there is an open source driver from the Free TDS..
    see
    http://www.freetds.org/
    It does have some limitations in functionality, but supports sql 7.
    hope it helps,
    Jer

  • How can I make sure that in RAM our sql server is not facing any mermory crunch issue?

    The SQL server process always show RAM is highly used while its a default behaviour of sql server.
    How can I make sure that in RAM our sql server is not facing any mermory crunch issue?
    Thanks

    The SQL server process always show RAM is highly used while its a default behaviour of sql server.
    How can I make sure that in RAM our sql server is not facing any mermory crunch issue?
    Thanks
    The best way to make sure you are not facing memory pressure is to use perfmon counters and monitor various memory counters
    For SQL Server 2005 - 2008 r2 use below counters
    SQLServer:Buffer Manager--Buffer Cache hit ratio(BCHR): IIf your BCHR is high 90 to 100 Then it points to fact that You don't have memory pressure. Keep in mind that suppose somebody runs a query which request large amount of pages in that
    case momentarily BCHR might come down to 60 or 70 may be less but that does not means it is a memory pressure it means your query requires large memory and will take it. After that query completes you will see BCHR risiing again
    SQLServer:Buffer Manager--Page Life Expectancy(PLE): PLE shows for how long page remain in buffer pool. The longer it stays the better it is. Its common misconception to take 300 as a baseline for PLE.   But it is not,I read it from
    Jonathan Kehayias book( troubleshooting SQL Server) that this value was baseline when SQL Server was of 2000 version and max RAM one could see was from 4-6 G. Now with 200G or RAM coming into picture this value is not correct. He also gave the formula( tentative)
    how to calculate it. Take the base counter value of 300 presented by most resources, and then determine a multiple of this value based on the configured buffer cache size, which is the 'max server memory' sp_ configure option in SQL Server, divided by 4 GB.
      So, for a server with 32 GB allocated to the buffer pool, the PLE value should be at least (32/4)*300 = 2400. So far this has done good to me so I would recommend you to use it.  
    SQLServer:Buffer Manager--CheckpointPages/sec: Checkpoint pages /sec counter is important to know about memory pressure because if buffer cache is low then lots of new pages needs to be brought into and flushed out from buffer pool, 
    due to load checkpoint's work will increase and will start flushing out dirty pages very frequently. If this counter is high then your SQL Server buffer pool is not able to cope up with requests coming and we need to increase it by increasing buffer pool memory
    or by increasing physical RAM and then making adequate changes in Buffer pool size. Technically this value should be low if you are looking at line graph in perfmon this value should always touch base for stable system.  
    SQLServer:Buffer Manager--Freepages: This value should not be less you always want to see high value for it.  
    SQLServer:Memory Manager--Memory Grants Pending: If you see
    memory grants pending in buffer pool your server is facing SQL Server memory crunch and increasing memory would be a good idea. For memory grants please read this article: 
    SQLServer:memory Manager--Target Server Memory: This is amount of memory SQL Server is trying to acquire.
    SQLServer:memory Manager--Total Server memory This is current memory SQL Server has acquired.
       8.  Free List Stalls/sec – Number of requests per second that had to wait for a free page
       9. Free Pages – Total number of pages on all free lists (free lists track all of the pages in the buffer pool that are not currently allocate to a data page, and are therefore available for usage immediately)
    NOTE: If you have NUMA system don't use PLE to monitor memory condition it wont give correct value
    From 2012 Onwards
    Memory management has become easy from 2012 onwards as
    Max server memory also allocated memory for requests which require memory >8KB
    SQLServer:Memory Manager:Free Memory (KB)
    SQLServer:Memory Manager:Target Server Memory (KB)
    SQLServer:Memory Manager:Total Server Memory (KB)
    For NUMA system its also wort monitoring each node.
    Object - SQLServer:Memory Node:Total Node Memory
      (KB)
    Object - SQLServer:Memory Node:Target Node Memory
      (KB)
    Object - SQLServer:Memory Node:Free Node Memory
      (KB)
    Ideally if target server memory is less than or equal to total server memory there wont be memory pressure if target is > total it does not always means its memory pressure
    BCHR would also give you good idea about memory pressure
    If memory grants pending is frequently non zero there is memory pressure
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • How can I load a .xlsx File into a SQL Server Table using a Foreach Loop Container in SSIS?

    I know I've REALLY struggled with this before. I just don't understand why this has to be soooooo difficult.
    I can very easily do a straight Data Pump of a .xlsX File into a SQL Server Table using a normal Excel Connection and a normal Excel Source...simply converting Unicode to DT_STR and then using an OLE DB Destination of the SQL Server Table.
    If I want to make the SSIS Package a little more flexible by allowing multiple .xlsX spreadsheets to be pumped in by using a Foreach Loop Container, the whole SSIS Package seems to go to hell in a hand basket. I simply do the following...
    Put the Data Flow Task within the Foreach Loop Container
    Add the Variable Mapping Variable User::FilePath that I defined as a Variable and a string within the FOreach Loop Container
    I change the Excel Connection and its Expression to be ExcelFilePath ==> @[User::FilePath]
    I then try and change the Excel Source and its Data Access Mode to Table Name or view name variable and provide the Variable Name User::FilePath
    And that's when I run into trouble...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [56]]:SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
    Error at Data Flow Task [Excel Source [56]]: Opening a rowset for "...(the EXACT Path and .xlsx File Name)...". Check that the object exists in the database. (And I know it's there!!!)
    I don't understand by adding a Foreach Loop Container to try and make this as efficient as possible has caused such an error unless I'm overlooking something. I have even tried delaying my validations and that doesn't seem to help.
    I have looked hard in Google and even YouTube to try and find a solution for this but for the life of me I cannot seem to find anything on pumping a .xlsX file into SQL Server using a Foreach Loop Container.
    Can ANYONE please help me out here? I'm at the end of my rope trying to get this to work. I think the last time I was in this quandry, trying to pump a .xlsX File into a SQL Server Table using a Foreach Loop Container in SSIS, I actually wrote a C# Script
    to write the contents of the .xlsX File into a .csv File and then Actually used the .csv File to pump the data into a SQL Server Table.
    Thanks for your review and am hoping and praying for a reply and solution.

    Hi ITBobbyP,
    If I understand correctly, you want to load data from multiple sheets in an .xlsx file into a SQL Server table.
    If in this scenario, please refer to the following tips:
    The Foreach Loop container should be configured as shown below:
    Enumerator: Foreach ADO.NET Schema Rowset Enumerator
    Connection String: The OLE DB Connection String for the excel file.
    Schema: Tables.
    In the Variable Mapping, map the variable to Sheet_Name, and change the Index from 0 to 2.
    The connection string for Excel Connection Manager is the original one, we needn’t make any change.
    Change Table Name or View name to the variable Sheet_Name.
    If you want to load data from multiple sheets in multiple .xlsx files into a SQL Server table, please refer to following thread:
    http://stackoverflow.com/questions/7411741/how-to-loop-through-excel-files-and-load-them-into-a-database-using-ssis-package
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Can't import office 2010/13 files into SQL Server. I'm out of ideas!

    Hi
    I have SQL Server 2012 installed on my Windows 8.1 Instance.  I want to be able to import and export data to Access 2013 files *accdb.  I have Office 64 bit installed on my machine.  I have searched a lot and can't find exactly what to do
    to fix this.  I have even done a clean install of SQL, but still no bananas.
    I have downloaded and installed Microsoft Access Database Engine 2010 but that didn't help.
    Any ideas?

    OK, now I know why I have never solved this problem.  When I try to install Microsoft Access
    Database Engine 2010 32 bit version, I get an error saying I cannot install the 32 bit version while running Office 2013 64 bit.  
    I found this blog http://knowledge.autodesk.com/support/autocad-civil-3d/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-install-64-bit-Microsoft-Database-Drivers-alongside-32-bit-Microsoft-Office.html
    which talks about the opposite problem, but not my problem.  Does anyone know of a work around to install the 32bit version of ADE with 64 bit Office?

  • Can I call a Java program from a SQL Server Trigger?

    Hello,
    I want to encrypt some data in a database column in SQL Server. Today I am using java code to encrypt the value and store it in the database using JDBC.
    Now I want to use a VB client to store the encrypted value in the SQL Server DB. Since the encryption is handled by a java class, can I write a trigger in SQL Server that while inserting the raw data, calls the java class for encrypting the value and then inserts the encrypted value into the column?
    In general, is it possible to call a java class from a SQL Server trigger?
    Thanks
    Bipin

    Here are 3 examples of code for insert, update and delete:
    CREATE TRIGGER [PLI_INSERT_TRIGGER] ON [dbo].[PLI]
    FOR INSERT
    AS
    Declare @cmd sysname, @code sysname, @list sysname
         Select @code = PLI_K_COD, @list = PLI_K_LISTINO from inserted
         Set @cmd = 'java mirrorDb.Copy PLI INSERT ' + @code + ' ' + @list
         EXEC master..xp_cmdshell @cmd
    CREATE TRIGGER [PLI_UPDATE_TRIGGER] ON [dbo].[PLI]
    FOR UPDATE
    AS
    Declare @cmd sysname, @code sysname, @list sysname
         Select @code = PLI_K_COD, @list = PLI_K_LISTINO from inserted
         Set @cmd = 'java mirrorDb.Copy PLI UPDATE ' + @code + ' ' + @list
         EXEC master..xp_cmdshell @cmd
    CREATE TRIGGER [PLI_DELETE_TRIGGER] ON [dbo].[PLI]
    FOR DELETE
    AS
    Declare @cmd sysname, @code sysname, @list sysname
         Select @code = PLI_K_COD, @list = PLI_K_LISTINO from deleted
         Set @cmd = 'java mirrorDb.Copy PLI DELETE ' + @code + ' ' + @list
         EXEC master..xp_cmdshell @cmd
    you must go "sql server entreprise manager" right click on the table you want to add triggers and select: all activities, manage triggers.
    You have 3 examples: for an insert, for an update and for a delete
    ON [dbo].[PLI] specify the table on which you want to setup trigger.
    FOR DELETE, INSERT, UPDATE specify the event.
    The Declare statement create the variables in which I want to put some values to pass to the java program, for example which table, which event, which key fields.
    the "Select @code = PLI_K_COD, @list = PLI_K_LISTINO from inserted" set the variables with the value of the columns of the table I am interested to read from my java program, for example the variable @code receive the value of the column pli_k_kod (is the key) of the table PLI.
    The "Set @cmd = 'java mirrorDb.Copy PLI DELETE ' + @code + ' ' + @list " prepared the variable @cmd with the java command followed by the package.classname and parameters.
    The EXEC launch the command to the operating system.
    Daniele

  • Query related to Sql Server

    SQL Server 2012 : We would require a developer license for SQL 2012 Server and there might be 1-2 people accessing the server through SQL Client. This is for non-production use.
    Do we need to buy a CAL license for this or just an additional edition of Developer license will do to access the Server.
    I see that in your licensing document it is mentioned that “One license is required for each person that accesses or uses the software”
    Please reply asap

    Check this 
    Licensing SQL Server for Non-production Use
    The SQL Server 2012 Developer Edition is a full-function version of the SQL Server software—with all the features and capabilities of the Enterprise edition—licensed under the Developer Tools model, which is a "per user" model.
    One license is required for each person that accesses or uses the software.
    When using SQL Server software for development, test or demonstration purposes, only the users are licensed and there is no need for a corresponding license for the actual server systems running SQL Server software in this case.
    As long as only licensed users have access to the software, customers can install as many copies of the software on any number of servers that are used exclusively for development, test or demonstration purposes. This
    is significant, because it allows customers to run the software on multiple devices (for testing purposes, for
    example) without having to license each non-production server system.  
    http://download.microsoft.com/download/7/3/C/73CAD4E0-D0B5-4BE5-AB49-D5B886A5AE00/SQL_Server_2012_Licensing_Quick_Reference_Guide_Mar2012.pdf
    However, You must confirm this with the Microsoft Licensing team if you need quick response on this.
    Check these as well
    http://www.microsoft.com/sql/howtobuy/licensing.mspx
    http://www.microsoft.com/en-in/contact.aspx
    http://blogs.technet.com/b/volume-licensing/archive/2014/03/10/licensing-how-to-when-do-i-need-a-client-access-license-cal.aspx
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • Error: Partition function can only be created in Enterprise edition of SQL Server

    By using the Generate Scripts option in SSMS, I've duplicated this DB seven times so far. I do this due to the 10 Gig limit on Sql Express 2012.  I was doing this again today. I generated the script, did a search/replace to provide a new DB name for
    DB number eight in the series, and then I ran the script to create the DB, causing the error message. I don't remember seeing this error in the past. It's possible I created the first edition of this DB at home, but back then I only had express edition as
    I seem to recall (although I did purchase Developer a few months ago).
    I don't even know what the Partition function does. I'll try to look that up tonight.
    SSMS did create the DB, I just hope the error message doesn't forebode any problems.
    USE [master]
    GO
    /****** Object: Database [Year2014_Aug_To_Dec] Script Date: 07/29/2014 03:55:19 PM ******/
    CREATE DATABASE [Year2014_Aug_To_Dec]
    CONTAINMENT = NONE
    ON PRIMARY
    ( NAME = N'Year2014_Aug_To_Dec', FILENAME = N'F:\FlatFilesDatabases\Year2014_Aug_To_Dec.mdf' , SIZE = 8832000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 204800KB )
    LOG ON
    ( NAME = N'Year2014_Aug_To_Dec_Log', FILENAME = N'F:\FlatFilesDatabases\Year2014_Aug_To_Dec_Log.ldf' , SIZE = 230400KB , MAXSIZE = 2048GB , FILEGROWTH = 204800KB )
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET COMPATIBILITY_LEVEL = 110
    GO
    IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
    begin
    EXEC [Year2014_Aug_To_Dec].[dbo].[sp_fulltext_database] @action = 'enable'
    end
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET ANSI_NULL_DEFAULT OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET ANSI_NULLS OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET ANSI_PADDING OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET ANSI_WARNINGS OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET ARITHABORT OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET AUTO_CLOSE ON
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET AUTO_CREATE_STATISTICS ON
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET AUTO_SHRINK OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET AUTO_UPDATE_STATISTICS ON
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET CURSOR_CLOSE_ON_COMMIT OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET CURSOR_DEFAULT GLOBAL
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET CONCAT_NULL_YIELDS_NULL OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET NUMERIC_ROUNDABORT OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET QUOTED_IDENTIFIER OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET RECURSIVE_TRIGGERS OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET DISABLE_BROKER
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET DATE_CORRELATION_OPTIMIZATION OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET TRUSTWORTHY OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET ALLOW_SNAPSHOT_ISOLATION OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET PARAMETERIZATION SIMPLE
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET READ_COMMITTED_SNAPSHOT OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET HONOR_BROKER_PRIORITY OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET RECOVERY SIMPLE
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET MULTI_USER
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET PAGE_VERIFY CHECKSUM
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET DB_CHAINING OFF
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET TARGET_RECOVERY_TIME = 0 SECONDS
    GO
    USE [Year2014_Aug_To_Dec]
    GO
    /****** Object: User [NT SERVICE\MSSQL$SQLEXPRESS] Script Date: 07/29/2014 03:55:20 PM ******/
    CREATE USER [NT SERVICE\MSSQL$SQLEXPRESS] FOR LOGIN [NT Service\MSSQL$SQLEXPRESS] WITH DEFAULT_SCHEMA=[NT SERVICE\MSSQL$SQLEXPRESS]
    GO
    /****** Object: User [NT Authority\Authenticated Users] Script Date: 07/29/2014 03:55:20 PM ******/
    CREATE USER [NT Authority\Authenticated Users] FOR LOGIN [NT AUTHORITY\Authenticated Users] WITH DEFAULT_SCHEMA=[NT Authority\Authenticated Users]
    GO
    /****** Object: User [BUILTIN\USERS] Script Date: 07/29/2014 03:55:20 PM ******/
    CREATE USER [BUILTIN\USERS] FOR LOGIN [BUILTIN\Users]
    GO
    /****** Object: Schema [NT Authority\Authenticated Users] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE SCHEMA [NT Authority\Authenticated Users]
    GO
    /****** Object: Schema [NT SERVICE\MSSQL$SQLEXPRESS] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE SCHEMA [NT SERVICE\MSSQL$SQLEXPRESS]
    GO
    /****** Object: FullTextCatalog [Catalog1] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE FULLTEXT CATALOG [Catalog1]WITH ACCENT_SENSITIVITY = ON
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_06A2E7C5] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_06A2E7C5](varbinary(128)) AS RANGE LEFT FOR VALUES (0x00390039003200380035, 0x006E006E0033003000320034)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_11A1FB2A] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_11A1FB2A](varbinary(128)) AS RANGE LEFT FOR VALUES (0x006100730073006F006300690061007400650073, 0x006E006E003200320032003700350037003300310030003400300035)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_171D3F63] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_171D3F63](varbinary(128)) AS RANGE LEFT FOR VALUES (0x00610072006900650078006900650074, 0x006E006E003200390035003200330033003400310030)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_1FA6CD15] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_1FA6CD15](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0063006F00720070006F0072006100740069006F006E, 0x006E006E0033003500340031003800390031)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_25DC6753] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_25DC6753](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0061007000700072006F007600650064, 0x006E006E00320033003200380035)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_2B429CF3] Script Date: 07/29/2014 03:55:21 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_2B429CF3](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0069006E006500730068006F006D)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_2D3F28A7] Script Date: 07/29/2014 03:55:22 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_2D3F28A7](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0062006F0078, 0x006E006E003200390034003900320033003000350033)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_32ED1505] Script Date: 07/29/2014 03:55:22 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_32ED1505](varbinary(128)) AS RANGE LEFT FOR VALUES (0x006100690064, 0x006E006E00330036)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_3E6129B6] Script Date: 07/29/2014 03:55:22 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_3E6129B6](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0036003600340038, 0x006C00610074006F0074, 0x006E006E00360031003800380038)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_3FC721DF] Script Date: 07/29/2014 03:55:22 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_3FC721DF](varbinary(128)) AS RANGE LEFT FOR VALUES (0x006300680075006E006B, 0x006E006E0034003300330031006400360031)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_4695B1AD] Script Date: 07/29/2014 03:55:22 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_4695B1AD](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0061006D006F0075006E0074, 0x006E006E003200370064003200330032)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_475E2206] Script Date: 07/29/2014 03:55:23 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_475E2206](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0061007200610079006B)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_52082FB0] Script Date: 07/29/2014 03:55:23 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_52082FB0](varbinary(128)) AS RANGE LEFT FOR VALUES (0x00640065007400610069006C, 0x006E006E003300300038003400320032)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_53473803] Script Date: 07/29/2014 03:55:23 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_53473803](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0061006F00730069, 0x006E006E003200350032003900340031)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_6A54BA8D] Script Date: 07/29/2014 03:55:23 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_6A54BA8D](varbinary(128)) AS RANGE LEFT FOR VALUES (0x00620061006E006B, 0x006E006E003300310064003000370032)
    GO
    /****** Object: PartitionFunction [ifts_comp_fragment_partition_function_7D7C9D9A] Script Date: 07/29/2014 03:55:23 PM ******/
    CREATE PARTITION FUNCTION [ifts_comp_fragment_partition_function_7D7C9D9A](varbinary(128)) AS RANGE LEFT FOR VALUES (0x0063006100720072006900650072, 0x006E006E00330032003700330033)
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_06A2E7C5] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_06A2E7C5] AS PARTITION [ifts_comp_fragment_partition_function_06A2E7C5] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_11A1FB2A] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_11A1FB2A] AS PARTITION [ifts_comp_fragment_partition_function_11A1FB2A] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_171D3F63] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_171D3F63] AS PARTITION [ifts_comp_fragment_partition_function_171D3F63] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_1FA6CD15] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_1FA6CD15] AS PARTITION [ifts_comp_fragment_partition_function_1FA6CD15] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_25DC6753] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_25DC6753] AS PARTITION [ifts_comp_fragment_partition_function_25DC6753] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_2B429CF3] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_2B429CF3] AS PARTITION [ifts_comp_fragment_partition_function_2B429CF3] TO ([PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_2D3F28A7] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_2D3F28A7] AS PARTITION [ifts_comp_fragment_partition_function_2D3F28A7] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_32ED1505] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_32ED1505] AS PARTITION [ifts_comp_fragment_partition_function_32ED1505] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_3E6129B6] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_3E6129B6] AS PARTITION [ifts_comp_fragment_partition_function_3E6129B6] TO ([PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_3FC721DF] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_3FC721DF] AS PARTITION [ifts_comp_fragment_partition_function_3FC721DF] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_4695B1AD] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_4695B1AD] AS PARTITION [ifts_comp_fragment_partition_function_4695B1AD] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_475E2206] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_475E2206] AS PARTITION [ifts_comp_fragment_partition_function_475E2206] TO ([PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_52082FB0] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_52082FB0] AS PARTITION [ifts_comp_fragment_partition_function_52082FB0] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_53473803] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_53473803] AS PARTITION [ifts_comp_fragment_partition_function_53473803] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_6A54BA8D] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_6A54BA8D] AS PARTITION [ifts_comp_fragment_partition_function_6A54BA8D] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: PartitionScheme [ifts_comp_fragment_data_space_7D7C9D9A] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE PARTITION SCHEME [ifts_comp_fragment_data_space_7D7C9D9A] AS PARTITION [ifts_comp_fragment_partition_function_7D7C9D9A] TO ([PRIMARY], [PRIMARY], [PRIMARY])
    GO
    /****** Object: StoredProcedure [dbo].[Files_RecordCountLastThreeDays_ByFolder] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROC [dbo].[Files_RecordCountLastThreeDays_ByFolder]
    @ListOfFolders varchar(max)
    AS
    -- This query pulls only those folders DID have at least one success (a new file added)
    With FoldersWithHits AS(
    SELECT COUNT(*) AS NUMFILESADDED, Value as Folder
    FROM funcSplit('|', @ListOfFolders) As Folders
    inner join Files on CHARINDEX(Folders.Value, Files.AGGREGATEPATH) = 1
    WHERE DateAdded > DATEADD(DD, -4, GETDATE())
    Group By Value
    Select * from FoldersWithHits
    Union All
    -- To get a list of those folders that did NOT have any new files added,
    -- resuse the first query - use the above list of successes to do an exclusion
    select 0 as NumFilesAdded, Folders.VAlue as Folder
    From funcSplit('|', @ListOfFolders) As Folders
    Left Join FoldersWithHits on FoldersWithHits.Folder = Folders.Value
    Where FoldersWithHits.folder is null
    GO
    /****** Object: StoredProcedure [dbo].[FILES_SP_FINDTHISMOVEDFILE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE Proc [dbo].[FILES_SP_FINDTHISMOVEDFILE]
    @NameOfFile varchar(2000),
    @NameOfZipFile varchar(2000),
    @FileSize int
    As
    -- Here find the zipfile by passing in the name of the zipfile as @NameOfZipFile
    Select AggregatePath, 'Found ZipFile By Name' as TypeOfHit From dbo.Files where NameOfFile = @NameOfZipFile
    UNION
    Select AggregatePath, 'Found ZipFile By Name' as TypeOfHit From dbo.FilesNewLocations where NameOfFile = @NameOfZipFile
    UNION
    -- Here find the file itself (not just the zipfile) by finding two names: the filename and zipFilename.
    Select AggregatePath, 'Found Filename' as TypeOfHit From dbo.FilesNewLocations where Len(NameOfZipFile) > 0 AND NameOfFile = @NameOfFile And NameOfZipFile = @NameOfZipFile
    union
    Select AggregatePath, 'Found Filename' as TypeOfHit From dbo.FilesNewLocations where Len(NameOfZipFile) > 0 AND NameOfFile = @NameOfFile And NameOfZipFile = @NameOfZipFile
    union
    -- Here find the file by size
    Select AGGREGATEPATH, 'Found By Size' as TypeOfHit From dbo.Files where FileSize = @FileSize ANd NameOfFile = @NameOfFile
    UNION
    Select AGGREGATEPATH, 'Found By Size' as TypeOfHit From dbo.FilesNewLocations where FileSize = @FileSize ANd NameOfFile = @NameOfFile
    Grant Execute ON dbo.Files_SP_FindThisMovedFile To [BuiltIn\Users]
    CREATE NONCLUSTERED INDEX idx_FilesNewLocations_CreationDate ON Files (CreationDate)
    CREATE NONCLUSTERED INDEX idx_FilesNewLocations_FileSize ON Files (FileSize)
    CREATE NONCLUSTERED INDEX idx_FilesNewLocations_NameOfFile ON Files (NameOfFile)
    CREATE NONCLUSTERED INDEX idx_FilesNewLocations_NameOfZipFile ON Files (NameOfZipFile)
    CREATE NONCLUSTERED INDEX idx_FilesNewLocations_AggregatePath ON Files (AggregatePath)
    GO
    /****** Object: StoredProcedure [dbo].[FILES_SP_GETEPOCALIPSETEXT] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[FILES_SP_GETEPOCALIPSETEXT]
    @AGGREGATEPATH VARCHAR(700)
    AS
    SET NOCOUNT ON
    SELECT F.EPOCALIPSETEXT FROM FILES AS F
    WHERE F.AGGREGATEPATH = @AGGREGATEPATH
    GO
    /****** Object: StoredProcedure [dbo].[FILES_SP_INSERTFILE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[FILES_SP_INSERTFILE]
    @AGGREGATEPATH VARCHAR(4000),
    @CREATIONDATE DATETIME,
    @EPOCALIPSETEXT VARCHAR(MAX),
    @FILEID INT OUTPUT,
    @PC VARCHAR(2000),
    @FILESIZE INT,
    @NAMEOFFILE VARCHAR(2000),
    @ZIPPED BIT,
    @NAMEOFZIPFILE VARCHAR(2000)
    AS
    SET NOCOUNT ON
    DECLARE @DATEADDED SMALLDATETIME
    SELECT @DATEADDED = CONVERT(VARCHAR(12), GETDATE(), 101)
    INSERT INTO DBO.FILES (DATEADDED, AGGREGATEPATH, CREATIONDATE,EPOCALIPSETEXT, PC, FILESIZE, NAMEOFFILE, ZIPPED, NAMEOFZIPFILE)
    VALUES(@DATEADDED, @AGGREGATEPATH,@CREATIONDATE,@EPOCALIPSETEXT, @PC, @FILESIZE, @NAMEOFFILE, @ZIPPED, @NAMEOFZIPFILE)
    SELECT @FILEID=SCOPE_IDENTITY()
    GO
    /****** Object: StoredProcedure [dbo].[FILES_SP_ISDUPFILE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[FILES_SP_ISDUPFILE]
    @AGGREGATEPATH VARCHAR(2000)
    AS
    SET NOCOUNT ON
    SELECT FILEID FROM DBO.FILES WHERE AGGREGATEPATH= @AGGREGATEPATH
    GO
    /****** Object: StoredProcedure [dbo].[FILES_SP_RECORDCOUNTLASTSEVENDAYS] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROC [dbo].[FILES_SP_RECORDCOUNTLASTSEVENDAYS]
    AS
    SELECT PC, COUNT(*) AS NUMFILESADDED, CONVERT(VARCHAR(12),CONVERT(SMALLDATETIME, DATEADDED, 101), 101) AS DATEADDED FROM FILES
    WHERE DATEADDED > DATEADD(DD, -9, GETDATE())
    GROUP BY PC, CONVERT(SMALLDATETIME, DATEADDED, 101)
    ORDER BY PC, CONVERT(SMALLDATETIME, DATEADDED, 101) DESC
    GO
    /****** Object: StoredProcedure [dbo].[FILESNEWLOCATIONS_SP_INSERTFILE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[FILESNEWLOCATIONS_SP_INSERTFILE]
    @AGGREGATEPATH VARCHAR(4000),
    @CREATIONDATE DATETIME,
    @FILESIZE INT,
    @NAMEOFFILE VARCHAR(2000),
    @NAMEOFZIPFILE VARCHAR(2000)
    AS
    SET NOCOUNT ON
    INSERT INTO DBO.FILESNEWLOCATIONS (AGGREGATEPATH, CREATIONDATE,FILESIZE, NAMEOFFILE, NAMEOFZIPFILE)
    VALUES(@AGGREGATEPATH,@CREATIONDATE,@FILESIZE, @NAMEOFFILE, @NAMEOFZIPFILE)
    GRANT EXECUTE ON DBO.FILESNEWLOCATIONS_SP_INSERTFILE TO [BUILTIN\USERS]
    GO
    /****** Object: StoredProcedure [dbo].[FILESNEWLOCATIONS_SP_ISDUPNEWLOCATION] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[FILESNEWLOCATIONS_SP_ISDUPNEWLOCATION]
    @AGGREGATEPATH VARCHAR(2000)
    AS
    SET NOCOUNT ON
    SELECT COUNT(*) FROM DBO.FILESNEWLOCATIONS WHERE AGGREGATEPATH= @AGGREGATEPATH
    GO
    /****** Object: StoredProcedure [dbo].[FOLDERS_SP_DELETEALLFOLDERS] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[FOLDERS_SP_DELETEALLFOLDERS]
    AS
    SET NOCOUNT ON
    DELETE FROM FOLDERS
    GO
    /****** Object: StoredProcedure [dbo].[FOLDERS_SP_INSERTFOLDER] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROC [dbo].[FOLDERS_SP_INSERTFOLDER]
    @THEPATH VARCHAR(4000),
    @FRIENDLYNAME VARCHAR(4000)
    AS
    INSERT INTO FOLDERS ([PATH], FRIENDLYNAME) VALUES (@THEPATH, @FRIENDLYNAME)
    GO
    /****** Object: StoredProcedure [dbo].[MISC_SP_SETDBSTARTDATEANDENDDATE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[MISC_SP_SETDBSTARTDATEANDENDDATE]
    @STARTDATE DATETIME,
    @ENDDATE DATETIME
    AS
    BEGIN
    DECLARE @HASDATE TINYINT
    SELECT @HASDATE = COUNT(*) FROM MISC WHERE KIND LIKE 'STARTDATE'
    IF @HASDATE > 0
    BEGIN
    UPDATE DBO.MISC
    SET DATECOL =
    CASE KIND
    WHEN 'STARTDATE' THEN @STARTDATE
    WHEN 'ENDDATE' THEN @ENDDATE
    END
    END
    ELSE
    BEGIN
    INSERT INTO DBO.MISC(KIND, DATECOL) VALUES('STARTDATE', @STARTDATE)
    INSERT INTO DBO.MISC(KIND, DATECOL) VALUES('ENDDATE', @ENDDATE)
    END
    END
    GO
    /****** Object: StoredProcedure [dbo].[PAGES_SP_FINDWORDFORSELECTEDFOLDERS] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[PAGES_SP_FINDWORDFORSELECTEDFOLDERS]
    @KEYWORD VARCHAR(500),
    @STARTDATE DATETIME,
    @ENDDATE DATETIME
    AS
    SET NOCOUNT ON
    SELECT TOP 5000 * FROM
    SELECT P.PAGENO AS PGNO,FD.FRIENDLYNAME AS FOLDER, F.CREATIONDATE, 'PAGE' AS [TYPE], F.AGGREGATEPATH AS FULLPATH FROM
    CONTAINSTABLE(PAGES, OCRTEXT, @KEYWORD) AS FULLTEXTTABLE
    INNER JOIN PAGES AS P ON P.PAGEID = FULLTEXTTABLE.[KEY]
    INNER JOIN FILES AS F ON F.FILEID = P.FILEID
    INNER JOIN FOLDERS AS FD ON CHARINDEX(FD.PATH + '\', F.AGGREGATEPATH) = 1
    WHERE F.CREATIONDATE BETWEEN @STARTDATE AND @ENDDATE
    UNION ALL
    SELECT NULL AS PGNO, FD.FRIENDLYNAME AS FOLDER, F.CREATIONDATE, 'FILE' AS [TYPE], F.AGGREGATEPATH AS FULLPATH FROM
    CONTAINSTABLE(FILES, EPOCALIPSETEXT, @KEYWORD) AS FULLTEXTTABLE
    INNER JOIN FILES AS F ON F.FILEID = FULLTEXTTABLE.[KEY]
    INNER JOIN FOLDERS AS FD ON CHARINDEX(FD.PATH + '\', F.AGGREGATEPATH) = 1
    WHERE F.CREATIONDATE BETWEEN @STARTDATE AND @ENDDATE
    ) THERESULTS
    GO
    /****** Object: StoredProcedure [dbo].[PAGES_SP_FINDWORDFORSELECTEDFOLDERS_V2] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[PAGES_SP_FINDWORDFORSELECTEDFOLDERS_V2]
    @KEYWORD VARCHAR(500),
    @STARTDATE DATETIME,
    @ENDDATE DATETIME
    AS
    SET NOCOUNT ON
    SELECT TOP 5000 * FROM
    SELECT P.PAGENO AS PGNO,FD.FRIENDLYNAME AS FOLDER, F.CREATIONDATE, 'PAGE' AS [TYPE], F.AGGREGATEPATH AS FULLPATH, F.FILESIZE FROM
    CONTAINSTABLE(PAGES, OCRTEXT, @KEYWORD) AS FULLTEXTTABLE
    INNER JOIN PAGES AS P ON P.PAGEID = FULLTEXTTABLE.[KEY]
    INNER JOIN FILES AS F ON F.FILEID = P.FILEID
    INNER JOIN FOLDERS AS FD ON CHARINDEX(FD.PATH + '\', F.AGGREGATEPATH) = 1
    WHERE F.CREATIONDATE BETWEEN @STARTDATE AND @ENDDATE
    UNION ALL
    SELECT NULL AS PGNO, FD.FRIENDLYNAME AS FOLDER, F.CREATIONDATE, 'FILE' AS [TYPE], F.AGGREGATEPATH AS FULLPATH, F.FILESIZE
    FROM
    CONTAINSTABLE(FILES, EPOCALIPSETEXT, @KEYWORD) AS FULLTEXTTABLE
    INNER JOIN FILES AS F ON F.FILEID = FULLTEXTTABLE.[KEY]
    INNER JOIN FOLDERS AS FD ON CHARINDEX(FD.PATH + '\', F.AGGREGATEPATH) = 1
    WHERE F.CREATIONDATE BETWEEN @STARTDATE AND @ENDDATE
    ) THERESULTS
    GO
    /****** Object: StoredProcedure [dbo].[PAGES_SP_GETOCRTEXT] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[PAGES_SP_GETOCRTEXT]
    @PAGENO INT,
    @AGGREGATEPATH VARCHAR(700)
    AS
    SET NOCOUNT ON
    SELECT P.OCRTEXT FROM PAGES AS P
    INNER JOIN FILES AS F ON F.FILEID = P.FILEID
    WHERE F.AGGREGATEPATH = @AGGREGATEPATH AND P.PAGENO = @PAGENO
    GO
    /****** Object: StoredProcedure [dbo].[PAGES_SP_GETOCRTEXTFORALLPAGESOFTHISFILE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROC [dbo].[PAGES_SP_GETOCRTEXTFORALLPAGESOFTHISFILE]
    @AGGREGATEPATH VARCHAR(5000)
    AS
    SELECT PAGES.OCRTEXT FROM PAGES
    INNER JOIN FILES ON FILES.FILEID = PAGES.FILEID
    WHERE FILES.AGGREGATEPATH = @AGGREGATEPATH
    ORDER BY PAGENO
    GO
    /****** Object: StoredProcedure [dbo].[PAGES_SP_INSERTPAGE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[PAGES_SP_INSERTPAGE]
    @OCRTEXT VARCHAR(MAX),
    @FILEID INT,
    @PAGENO INT
    AS
    SET NOCOUNT ON
    INSERT INTO DBO.PAGES (OCRTEXT, FILEID, PAGENO) VALUES (@OCRTEXT, @FILEID, @PAGENO)
    GO
    /****** Object: StoredProcedure [dbo].[PAGES_SP_ISDUPPAGE] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[PAGES_SP_ISDUPPAGE]
    @FILEID INT,
    @PAGENO INT
    AS
    SET NOCOUNT ON
    SELECT PAGENO FROM DBO.PAGES WHERE FILEID = @FILEID AND PAGENO = @PAGENO
    GO
    /****** Object: StoredProcedure [dbo].[usp_RaiseError] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[usp_RaiseError]
    @CustomMessage nvarchar(4000) = ' '
    AS
    -- Exit out if there is no error information to retrieve.
    IF ERROR_NUMBER() IS NULL RETURN;
    DECLARE
    @strErrorMessage NVARCHAR(4000),
    @ErrorNumber INT,
    @Severity INT,
    @ErrorState INT,
    @Line INT,
    @ProcedureName NVARCHAR(200),
    @Msg nvarchar(max);
    -- Store all the error info in some temp variables (not sure why he does this)
    SELECT -- the SELECT keyword apparently means SET in this case.
    @ErrorNumber = ERROR_NUMBER(), -- SETs the value of the @-variable.
    @Severity = ERROR_SEVERITY(), -- SETs the value of the @-variable.
    @ErrorState = ERROR_STATE(), -- SETs the value of the @-variable.
    @Line = ERROR_LINE(), -- SETs the value of the @-variable.
    @ProcedureName = ISNULL(ERROR_PROCEDURE(), '-'),
    @Msg = Error_Message();
    -- Build the message string. The "N" means literal string, and each %d is
    -- a standin for a number, and we'll populate these standins later.
    SET @strErrorMessage = @CustomMessage + N'Error %d, Severity %d, State %d, Procedure %s, Line %d, '
    + 'Message: '+ @Msg;
    RAISERROR (-- This is the built-in RAISEERROR command. Requires 2 vals, then the standin-values
    @strErrorMessage, -- You must supply two values before you can populate the standins
    @Severity, -- first value, required.
    1, -- second value, required
    @ErrorNumber, -- populates a standin
    @Severity, -- populates a standin
    @ErrorState, -- populates a standin
    @ProcedureName, -- populates a standin
    @Line -- populates a standin
    GO
    /****** Object: StoredProcedure [dbo].[usp_RebuildIndexes] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE Procedure [dbo].[usp_RebuildIndexes]
    AS
    Declare @fetch_TableName NVARCHAR(256)
    DECLARE Cursor_Tables CURSOR FOR
    SELECT Name FROM sysobjects WHERE xtype ='U'
    OPEN Cursor_Tables
    While 1 = 1 -- Begin to Loop through all tables
    BEGIN
    FETCH NEXT FROM Cursor_Tables INTO @fetch_TableName -- fetches the next table
    if @@FETCH_STATUS <> 0 break
    print '---------' + @fetch_TableName
    Declare @fetch_indexName NVARCHAR(256) -- loops through al indexes of the current table
    DECLARE Cursor_Indexes CURSOR FOR -- Looking for indexes fragmented more than 15 percent.
    SELECT name as indexName
    FROM sys.dm_db_index_physical_stats (DB_ID(DB_Name()), OBJECT_ID(@fetch_TableName), NULL, NULL, NULL) AS a
    JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id = b.index_id
    Where Name is not null and avg_fragmentation_in_percent > 7
    OPEN Cursor_Indexes
    WHILE 1= 1 -- Begin to Loop through all Indexes
    BEGIN
    FETCH NEXT FROM [Cursor_Indexes] INTO @fetch_indexName
    if @@FETCH_STATUS <> 0 break
    Declare @SqL nvarchar(2000) = N'
    BEGIN TRY
    ALTER INDEX ' + @fetch_indexName + ' ON ' + DB_Name() + '.dbo.' + @fetch_TableName + ' Rebuild
    END TRY
    BEGIN CATCH
    Declare @err nvarchar(2000) = ERROR_MESSAGE();
    throw 51000, @err, 1
    END CATCH'
    Execute sp_executeSQL @sql
    End -- Ends looping through all indexes
    CLOSE [Cursor_Indexes]
    DEALLOCATE [Cursor_Indexes]
    End -- Ends looping through all tables
    CLOSE Cursor_Tables
    DEALLOCATE Cursor_Tables
    GO
    /****** Object: UserDefinedFunction [dbo].[funcSplit] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE function [dbo].[funcSplit](@splitChar varchar(1), @CSV nvarchar(max))
    Returns @Results Table (Value nvarchar(max))
    As
    Begin
    Declare @lastChar nvarchar(1) = substring(@CSV, len(@CSV), 1)
    -- Make sure the string ends in a comma. If not, append one.
    if @lastChar <> @splitChar set @CSV = @CSV + @splitChar
    Declare @posOfComma int = 0
    Declare @LastPosOfComma int = 0
    While 1 = 1
    Begin
    Set @posOfComma = CHARINDEX(@splitChar ,@CSV, @LastPosOfComma)
    if @posOfComma = 0 break
    Declare @Length int = @posOfComma - @LastPosOfComma
    if @Length > 0
    Begin
    Declare @Phrase nvarchar(max) = substring(@CSV, @LastPosOfComma, @Length)
    Insert Into @Results (Value) VALUES (@Phrase)
    end
    set @LastPosOfComma = @posOfComma +1
    if @LastPosOfComma > Len(@CSV) break
    END
    Return
    End
    GO
    /****** Object: Table [dbo].[FILES] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[FILES](
    [AGGREGATEPATH] [varchar](900) NOT NULL,
    [NAMEOFFILE] [varchar](300) NOT NULL,
    [NAMEOFZIPFILE] [varchar](300) NOT NULL,
    [FILEID] [int] IDENTITY(1,1) NOT NULL,
    [CREATIONDATE] [datetime] NOT NULL,
    [EPOCALIPSETEXT] [varchar](max) NOT NULL,
    [DATEADDED] [datetime] NOT NULL,
    [PC] [varchar](30) NOT NULL,
    [FILESIZE] [int] NOT NULL,
    [ZIPPED] [bit] NOT NULL,
    CONSTRAINT [PK_FILES] PRIMARY KEY CLUSTERED
    [FILEID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    CONSTRAINT [UQ_Files_AggregatePath] UNIQUE NONCLUSTERED
    [AGGREGATEPATH] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    CONSTRAINT [UQ_Files_FileID] UNIQUE NONCLUSTERED
    [FILEID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[FilesNewLocations] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[FilesNewLocations](
    [AggregatePath] [varchar](900) NOT NULL,
    [NameOfFile] [varchar](300) NOT NULL,
    [NameOfZipFile] [varchar](300) NOT NULL,
    [LocationID] [int] IDENTITY(1,1) NOT NULL,
    [CreationDate] [datetime] NOT NULL,
    [Filesize] [int] NOT NULL,
    CONSTRAINT [PK_FilesNewLocations] PRIMARY KEY CLUSTERED
    [LocationID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    CONSTRAINT [UQ_FilesNew_AggregatePath] UNIQUE NONCLUSTERED
    [AggregatePath] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[FOLDERS] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[FOLDERS](
    [FOLDERID] [int] IDENTITY(1,1) NOT NULL,
    [PATH] [varchar](900) NOT NULL,
    [FRIENDLYNAME] [nvarchar](500) NULL,
    CONSTRAINT [PK_Folders_Path] PRIMARY KEY CLUSTERED
    [PATH] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    CONSTRAINT [UQ_Folders_FolderID] UNIQUE NONCLUSTERED
    [FOLDERID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    /****** Object: Table [dbo].[MISC] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[MISC](
    [BOOLEANCOL] [bit] NULL,
    [KIND] [nvarchar](4000) NULL,
    [STRINGCOL] [nvarchar](4000) NULL,
    [DATECOL] [datetime] NULL,
    [INTEGERCOL] [int] NULL,
    [MISCELLANEOUSID] [int] IDENTITY(1,1) NOT NULL,
    CONSTRAINT [idx_Misc_MiscellaneousID] UNIQUE NONCLUSTERED
    [MISCELLANEOUSID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    /****** Object: Table [dbo].[PAGES] Script Date: 07/29/2014 03:55:24 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[PAGES](
    [OCRTEXT] [varchar](max) NULL,
    [FILEID] [int] NOT NULL,
    [PAGENO] [int] NOT NULL,
    [PAGEID] [int] IDENTITY(1,1) NOT NULL,
    CONSTRAINT [PK_PAGES] PRIMARY KEY CLUSTERED
    [PAGEID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    CONSTRAINT [UQ_FILEID_PAGENO] UNIQUE NONCLUSTERED
    [FILEID] ASC,
    [PAGENO] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [idx_Files_AggregatePath] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_AggregatePath] ON [dbo].[FILES]
    [AGGREGATEPATH] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [idx_Files_CreationDate] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_CreationDate] ON [dbo].[FILES]
    [CREATIONDATE] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [idx_Files_DateAdded] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_DateAdded] ON [dbo].[FILES]
    [DATEADDED] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [idx_Files_FileSize] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_FileSize] ON [dbo].[FILES]
    [FILESIZE] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [idx_Files_NameOfFile] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_NameOfFile] ON [dbo].[FILES]
    [NAMEOFFILE] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [idx_Files_NameOfZipFile] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_NameOfZipFile] ON [dbo].[FILES]
    [NAMEOFZIPFILE] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [idx_Files_PC] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_PC] ON [dbo].[FILES]
    [PC] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [idx_Files_Zipped] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Files_Zipped] ON [dbo].[FILES]
    [ZIPPED] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [idx_FilesNewLocations_AggregatePath] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_FilesNewLocations_AggregatePath] ON [dbo].[FilesNewLocations]
    [AggregatePath] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [idx_FilesNewLocations_CreationDate] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_FilesNewLocations_CreationDate] ON [dbo].[FilesNewLocations]
    [CreationDate] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [idx_FilesNewLocations_FileSize] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_FilesNewLocations_FileSize] ON [dbo].[FilesNewLocations]
    [Filesize] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [idx_FilesNewLocations_NameOfFile] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_FilesNewLocations_NameOfFile] ON [dbo].[FilesNewLocations]
    [NameOfFile] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    SET ANSI_PADDING ON
    GO
    /****** Object: Index [idx_FilesNewLocations_NameOfZipFile] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_FilesNewLocations_NameOfZipFile] ON [dbo].[FilesNewLocations]
    [NameOfZipFile] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    /****** Object: Index [idx_Pages_FileID] Script Date: 07/29/2014 03:55:24 PM ******/
    CREATE NONCLUSTERED INDEX [idx_Pages_FileID] ON [dbo].[PAGES]
    [FILEID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[FILES] ADD DEFAULT ('') FOR [NAMEOFZIPFILE]
    GO
    ALTER TABLE [dbo].[FILES] ADD DEFAULT ('') FOR [EPOCALIPSETEXT]
    GO
    ALTER TABLE [dbo].[FILES] ADD DEFAULT ((0)) FOR [ZIPPED]
    GO
    USE [master]
    GO
    ALTER DATABASE [Year2014_Aug_To_Dec] SET READ_WRITE
    GO

    8A partition function is used when you partition a table. Partitioned tables is a feature that is available only in Enterprise and Developer Edition.
    I went through the script, and there are a number of partition functions and partition schemes, but they are not used anywhere, so you should be able to ignore the error.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Can two Instances of Planning share the same SQl Server Instance?

    Hi
    Can anyone clarify me on the below
    Is it possible to have our DEV and TEST instances of planning (on different host servers) point to different tables in the same instance of SQL Server 2005. I know that the apllication databases can be directed to different table names but what about the core tables:
    FSDHAADMS
    FSDHBIP
    FSDHSS
    FSDHPLANAPP
    FSDHPLANSYS
    Thanks in advance.

    I think it will work. As long as you create separate SQL databases for the planning system files for dev and prod on the sql server. If your planning web for dev is deployed on server x, and planning web for prod is on server y, when you run config utility on server x you would point to the SQL database u created for dev. Repeat on prod when u run the config utility just point to the planning system database you created for prod.
    haven't done this myself but sounds possible.

  • In Excel 2013, can you create a powerview connected to a SQL server and then upload this to Sharepoint to 2013?

    Creating a powerview in sharepoint browser can be tedious, but it is a lot more convenient in the desktop Excel 2013. 
    However, when you upload the excel document (where data source is SQL server) to sharepoint, there are two problems:
    1. The powerview is shown as a worksheet in the excel file in sharepoint
    2. You dont get the same features as a powerview - most importantly Export to PowerPoint.
    Has anyone come across this?  Does this mean if you want to create powerview which are to be shown in full screen and also to be exported to powerpoint must always be directly created in Sharepoint browser?
    Pubudu

    Hi,
    There is no method to get around this. According
    http://office.microsoft.com/en-in/excel-help/power-view-explore-visualize-and-present-your-data-HA102835634.aspx,
    Both versions of Power View need Silverlight installed on the machine.
    You can’t open a Power View RDLX file in Excel, or open an Excel XLSX file with Power View sheets in Power View in SharePoint. You also can’t copy charts or other visualizations from the RDLX file into the Excel workbook.
    You can save Excel XLSX files with Power View sheets to SharePoint Server, either on premises or in Office 365, and open those files in SharePoint. Read more about
    Power View in Excel in SharePoint Server 2013 or in SharePoint Online in Office 365.
    In addition, you can try to submit the suggestions from the following link:
    http://connect.microsoft.com/
    It is a public place where we can post our feedback. :-)
    Thanks.
    Tracy Cai
    TechNet Community Support

  • How can I Use a Stored Procedure from Microsoft SQL Server?

    Hi All,
    Would like to use stored procedure as my data service in Visual Composer.
    Our version is VC7.0 SP20.
    Is stored procedure feasible? What is the system that i need to create  in Enterprise Portal? Currently i have BI JDBC System which only allows me to search for tables from SQL Server.
    Much appreciate your help.
    Thanks & Regards,
    Sarah

    Hi Skif,
    Referring to my post: JDBC System Connection VS BI JDBC System Connection
    I do not even able to view list of stored procedure. I need help too..maybe you can show me how do you set the connection? What are the mandatory connection properties? I have filled up:
    - Connection URL
    - Driver class name
    - User Administration: User, Admin (I did user mapping too)
    The error message that i got is:
    com.sap.guimachine.portalconnector.commandhandler.CommandException: Failed to connect to backend system. Check your system definition and user privileges.#
    I had assigned full control to the DB user, and map my portal user to that DB user.
    Many Thanks,
    Sarah

  • How can i Migrate a database from DB2 to SQL Server 2008r2.

    Hi Gurus,
    Kindly help me letting me know the process for migrating the database from DB2 to SQL Server.
    1) Is there any way to migrate a database from DB2 to SqlServer. (My assumption is we can not migrate database, if wrong correct me gurus).
    2) Or we can only transfer data from that DB2 database to SQL Server (Using SSIS packages).
    Please help me knowing the process to migrate the data from DB2 server to MSSQL server. Even am reading the documents available in the web.
    Thanks in advance.. :)

    Microsoft provide a migration assistant for DB2 to SQL Server:
    http://www.microsoft.com/en-us/download/details.aspx?id=45296
    SQL Server Migration Assistant (SSMA) is a free supported tool from Microsoft that simplifies database migration process from DB2 to SQL Server and Azure SQL DB. SSMA automates all aspects of migration including migration assessment analysis, schema and
    SQL statement conversion and data migration. 
    Hope that helps

  • How can I group student scores into quintile using SQL Server 2008

    Can anyone help me to group student scores into quintile. I think there is a feature in SQL Server 2012, but still we are have not upgrade to it as we are using 2008R2. I tried Ntile(5) but it not generating the desired result. I need below Quintile column
    Student Score Quintile
    Student1 20 1
    Student2 20 1
    Student3 30 2
    Student4 30 2
    Student5 40 2
    Student6 40 2
    Student7 50 3
    Student8 50 3
    Student9 60 3
    Student10 70 4
    Student11 70 4
    Student12 80 4
    Student13 80 4
    Student14 90 5

    Please try to get ranking for below data
    HI , I need a dynamic SQL which would handle few hundred records and scores may vary..Sometime it may be small test marks ranging from 5 to 25 sometimes it may be out of 100. 
    I tried for larger data set. It
    failed. It is not at all showing Rank 3.Since it not falling in the comparison Below are the 99 records.
    Student
    Name  -> Score
    Student
    1 to 5 -> 4
    Student
    7 to 26 -> 5
    Student
    27 to 71 -> 6
    Student
    72 to 98 -> 7
    Student
    99 -> 9

  • Can 2008 reporting services read data from 2012 sql server

    Will 2008 SSRS be able to retrieve data / speak
    to 2012 SQL Server database?

    I will try and see if it throws error. Check below similar thread.
    https://social.technet.microsoft.com/Forums/en-US/067406f5-bd65-40eb-b333-3449adeefade/connect-to-sql-server-2012-databases-from-ssrs-2008-r2?forum=sqlreportingservices
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

Maybe you are looking for

  • How to find out who is using the shared library?

    Is there a way to find out who is listening to my music on my shared library and what they are listening to?

  • HP UFT (QTP) Can't Identify Delphi Objects

    We're using Delphi 2005 (version 9) with orpheous. When we use the Object Spy in HP UFT, a generic name is shown instead of the actual delphi name. For example, our Report Screen would be shown as "DelphiWindow" and additional screens will be shown a

  • Auditing in Oracle 9i

    i want to audit the whole database activity even want to store old and new values.

  • For a 3.33v input, DAQ & MAX Test panels read 018v. What is missing in set up?

    Hi All: I am resurrecting a Labview setup that has not been used for a few years. The goal is to measure strain. Software is:         Labview 6.0  DAQ V6.8.0f9  MAX 2.0.3.6. Hardware is:  PCI-MIO-16E-1  SCXI-1000 Chassis  SCXI-1121 Module  SCXI-1320

  • Freezing phone and non working keyboard

    I just got my first Iphone, its the 3GS. Everything is good with it except that every once in awhile, certain parts of the screen (specifically when using the keyboard) stop working. I woud try and type a certain letter and it wont work, but the othe