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]

Similar Messages

  • Can you replicate databases from SQL Server 2014 Enterprise Edition to SQL Server 2014 Standard edition?

    Hello,
    Can you replicate databases from SQL Server 2014 Enterprise Edition to SQL Server 2014 Standard edition? 
    Thanks. 

    Yes, you can replicate from Enterprise edition to Standard edition.  The only caveat is Peer-to-Peer Replication requires all nodes to be Enterprise Edition.
    Brandon Williams (blog |
    linkedin)

  • ASP Web Forms Error: Session state can only be used when enableSessionState is set to true

    Hello,
    I am developing a custom application page for a custom Web Forms I am creating, which I plan on using for custom task form into SharePoint 2010 Foundation.
    Currently, I am trying to test it in Debug Mode using Visual Studio 2010 but when I am trying to use Sessions I get the error:
    Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration
    I've already done this on trying to fix:
    On my page
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestForm.aspx.cs" Inherits="TestForm" EnableSessionState="True" %>
    And on my web.config
    <pages enableSessionState="true">..<httpModules>
    <remove name="Session" />
      <add name="Session" type="System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </httpModules>
    Note: I am getting an error when I try to add <module> into web.config
    ASP .NET State Service is currently running.
    And the part where it keeps error is when in PageLoad, I try to set a List object something like this:
    List<object> myobject
    get
    if (Session["object"] == null)
    Session["object"] = new List<object>();
    return Session["object"] as List<object>;
    set
    Session["object"] = value;
    protected void Page_Load(object sender, EventArgs e)
    myobject= new List<object>();
    BUT the error still persists! I also try to restart IIS but still the error still happens.
    I am running out of ideas so can you help me out?
    Thank you!

    Could be your skype intercepting your requests at 80 port, in Skype options uncheck
    Or Your IE has connection checked for Proxy when there is no proxy
    Or your fiddler could intercept and act as proxy, uncheck it!
    Solves the above problem, It solved mine!
    HydTechie
    HydPhani

  • Error : Array constants can only be used in initializers

    Hello All,
    I am using tableview model and declared two-dimensional array.
    Getting error Array constants can only be used in initializers in the line retVal<i>[j] =  {  {  createBy,desc,dispName }  };
    String[][] retVal;
    retVal = new String[20][20]
    //Fetching IResorce propeties here
    int resourceCounter = 0;
    for (int i = 0; i < list.size(); i++) {
       for (int j = 0; j < i; j++) {
          IResource ir = list.get(i);
          createBy = ir.getCreatedBy();
          desc = ir.getDescription();
            dispName = ir.getDisplayName();
         retVal<i>[j] =  {  {  createBy,desc,dispName }  };
         resourceCounter++;
    return retVal;
    Please help me out.
    Thanks
    Risha                              }

    I created ArrayList 
    static public String[] colnames =
                   "News Title",
                   "Short Description",
                   "Published",
                   "Valid To",
                   "Read Count",
                   "Users Details",
                   "Reply" };
         public ArrayList createData() {
               ArrayList rowArrList = new ArrayList();
              ArrayList tableArrList = new ArrayList();
              String createBy = null;
              String desc = null;
              String dispName = null;
              String lastMod = null;
              String name = null;
              String resType = null;
              try {
                   com.sapportals.portal.security.usermanagement.IUser user = null;
                   user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
                   IResourceContext resourceContext = new ResourceContext(user);
                   String path = "/documents/Australia/News";
                   RID rid = RID.getRID(path);
                   com.sapportals.wcm.repository.IResource res =
                        ResourceFactory.getInstance().getResource(rid, resourceContext);
                   IProperty prop = null;
                   String propValue = null;
                   PropertyName propName = null;
                   if (res != null) {
                        if (res.isCollection()) {
                             ICollection collection = (ICollection) res;
                             IResourceList list = collection.getChildren();
                             int resourceCounter = 0;
                             for (int i = 0; i < list.size(); i++) {                              
    //                              for (int j = 0; j < i; j++) {
                                       IResource ir = list.get(i);
                                       createBy = ir.getCreatedBy();
                                       desc = ir.getDescription();
                                       dispName = ir.getDisplayName();
                                       lastMod = ir.getLastModifiedBy();
                                       name = ir.getName();
                                       resType = ir.getResourceType();
                                       rowArrList.add(createBy);
                                       rowArrList.add(desc);
                                       rowArrList.add(dispName);
                                       rowArrList.add(lastMod);
                                       rowArrList.add(name);
                                       rowArrList.add(resType);
                                       tableArrList.add(i,rowArrList);
                                  //}//Inside for loop
                             }//First for loop
                        }//Inside If
              } catch (ResourceException e) {
                   // TODO Auto-generated catch block
                   response.write("Error " + e.getMessage());
              } catch (UserManagementException ex) {
                   ex.printStackTrace();
                   response.write("Error " + ex.getMessage());
              return tableArrList;
          * Constructor.
         public TableViewBean() {
              ArrayList tabArr = createData();
              String[][] data = (String[][])tabArr.toArray();          
              model = new DefaultTableViewModel(data, colnames);
    Edited by: Risha on May 26, 2011 8:52 AM

  • Creating Enhencement-Point  - Object can only be created in SAP package

    Hi Guys,
    I am creating an enhencement point in Z program in Z package. I am getting following message.
    " Object can only be created in SAP package "
    Please help.

    Hi Mini
    Enhancement points are like hooks where you can attach your own piece of code and coding in an enhancement point is no different than a normal coding , just that it is a point in the standard program into which you can give your own custom logic.
    There are 2 types of enhancements given by SAP:
    1. Explicit enhancement points: Go to program RIAUFMVK . You can see ENHANCEMENT-POINT at many places. These are all explicit enhancement points and you can easily implement these points . Simply press shift+F4 and then go to the point which you want to implement. Right click on  it and follow the path Enhancement implementation->create. Give the name of the implementation and the assign it to a package(shoud not be a Z package).
    Once it is created you can start your coding as you normally do.
    2. Implicit enhancement points are not very stable and should be the last resort after you have explored all the user exits , BAdIs and explicit points. In order to find out the implicit enhacement points , press shift+F4  then goto menu option Edit->Enhancement Operations->show implicit enhancement options. This will bring up all the points that you can enhance. This will appear as a line with arrows. To implement this you have to follow the same procedure as for explicit enhacement points.
    So enhacement point works like the other codes . Just that you should know which  one to implement and where. As far as possible avoid implicit enhacements as they are not very stable at present and even if you are going for it keep a  back-up of your code always.
    Hope this helps you. lemme know if you have any other issues.
    Cheers
    shivika
    Message was edited by:
            Shivika Bhorchi

  • Cannot submit app update - "Error The submission can only contain one appx or one appxbundle."

    I'm trying to submit my app update to the store and I get the following error:
    Error
    The submission can only contain one appx or one appxbundle.
    So I thought I should maybe utilize the "Delete" option to allow me to submit an updated appx or appxbundle (since these are the only file types that App Studio allows us to build). However, when I do, I get the
    following message:
    Can't delete this package
    You must have at least one 8.1 package in your submission.
    ... So I'm basically stuck. Can't delete to upload a new one. Can't upload a new one because there's one already there. It would be nice if you could automatically sunset the old appx/appxbundle package in favor of the new
    one.
    Update: Solved! Solution below.

    Since this is still an issue, shouldn't it be escalated for a fix so that the page works on any modern browser?
    I see two independent problems here:
    - Hitting Delete should work, not bash the user with a "You must have at least one 8.1 package in your submission." message (i.e. allow the developer to delete and then add a new file, if so desired). After all, when making the initial submission
    we are in the same situation (no file yet), so it can't be that bad, as long as this is checked for at a later stage.
    - Show that Replace button which seems to be hiding! If it is a Silverlight issue, why require Silverlight in the first place?
    P.S.: I am experiencing this with IE (no Replace button, Windows 8.1 x64 and latest updates).

  • Dep Error:AA687-You can only post in new year after closing the previous year.

    Hi Experts,
    I need solution on error while posting dep. we have new co cd started operative from Jan -14 . So while doing dep posting run we are getting error "AA687-You can only post in new year after closing the previous year".
    I searched and got that Note 144441 need to implement.
    Let me know whether is it fine to go ahead or Is there any alternative solution.
    Also i want to know what need to to be done after implementing this note.
    please reply , its bit urgent.
    Regards
    Atul

    Hi Deepanshu,
    Also the FI period is also closed 2013 so in this case do i need to open the same , correct? for running dep posting along with OAAQ opening for AA.
    Or the note implementation will take care all. instead of running dep , opening closed period.
    pls suggest.
    Regards
    Atul

  • Error when creating a FDM application on SQL Server 2005

    Hi,
    we are getting this error when creating a FDM application on SQL Server 2005
    Error: EPMCSS-07003: Failed to validate identity. Invalid identity . Check identity.[SET_ROLES_LIST]
    We are using Windows System Integration although we have also tested with sa user.
    Any ideas?
    Thanks

    Based on the error message it appears to be having a Shared Services issue. Verify that the "ADMIN" account is being used for the HSS connection and that you are using "ADMIN" to create the application and see if the same error is returned.

  • How to Create a Temporary Table with SQL Server

    I know you can create a temporary table in SQL Server 2000, but not quite sure how to do it in CFMX 7, i.e., does the SQL go inside a <CFQUERY dbtype="query"> tag?
    I'm pulling the main set of records from an Oracle server (1st data source), but it does not contain employee names, only employee IDs.  Since I need to show the employee name along with the Emp ID, I'm then pulling a list of "current" employee names from a SQL Server (2nd data source), which is the main database on our CF server.
    I've got a QofQ that works fine, except it only matches EmpIDs that exist in both result sets.  Employees who are no longer employed, don't match, and don't display.  Since I can't do a LEFT OUTER JOIN with a QofQ, what I need to do is get the records from the Oracle server into the SQL Server.  Preferably in a temporary table.
    I was hoping if I could get those Oracle records written to a temp table on the main SQL Server, in same database as the Employee Name table, I could then write a normal <CFQUERY> that uses a LEFT OUTER JOIN.
    I think I could probably write a Stored Procedure that would execute the SQL to create the temporary table, but am trying to avoid having to write the SP, and do it the simplest way.
    This query will be a program that can be run hundreds of times per day, with a form that allows users to select date ranges, locations, and other options.  That starts the queries, which creates the report.  So I just need the temp table to exist only until all the SQL has run, and the <CFOUTPUT> has generated a report.
    If the premise is right, I just need some help with the syntax for creating a SQL Server temp table, when you want to write records to it from an external data source.  I'm trying the following, but getting an error:
    <CFQUERY name="ITE_Temp" datasource="SkynetSQL">
    CREATE TABLE #MyTemp
    (   INSERT INTO #MyTemp
    ITE2.TrueFile char (7) NOT NULL,
    ITE2.CountOfEmployee int NULL,
    ITE2.DTL_SUBTOT decimal NULL,
    ITE2.EMPTYPE char (3) NULL,
    ITE2.ARPT_CD char (3) NULL
    </CFQUERY>
    So I actually created a permanent table on the SQL Server, and wrote the below SQL, which does work, and does write the records to table.  I can then write another CFQUERY with a LEFT OUTER JOIN, and get all the records, including those that don't have matching employee name:
    <CFQUERY datasource="SkynetSQL">
    <CFLOOP index="i" from="1" to = "#ITE2.RecordCount#">
    INSERT INTO ITE_Temp
       (FullFile,
       EmployeeCount,
       DTL_Amount,
       EmployeeType,
       station)
    VALUES  ('#ITE2.TrueFile[i]#',
       #ITE2.CountOfEmployee[i]#,
       #ITE2.DTL_SUBTOT[i]#,
       '#ITE2.EMPTYPE[i]#',
       '#ITE2.ARPT_CD[i]#')
    </CFLOOP>
    </CFQUERY>
    But, I hate to have to create a table and physically write to it.  For one, it seems slower, and doing it in temp would be in memory, and probably much faster, correct?  Is there some way to code the above, so that it does something similar, but in a TEMPORARY TABLE?   If I can figure out how to do this, I can pull data from multiple data sources and servers, and using SQL Server temp tables, work with the data as if it was all on the same SQL Server, and do some cool reports.
    Everything I've done for the past few years, has all been from data from a single source, whether SQL Server, or another server.  Now I need to start writing reports where data can come from 3 or 4 different servers, and be able to do joins (inner and outer).  Thanks for any advice/help.  Much appreciated.
    Gary

    While waiting to hear back, I was able to write the query results from an outside Oracle server, to a table on the local SQL Server, and do the LEFT OUTER JOIN required for the final query and report to work.  That was with this syntax:
    <CFQUERY name="AddTableRecords" datasource="MyTable">
    TRUNCATE TABLE ITE_Temp
    <CFOUTPUT query="ITE2">
    INSERT INTO ITE_Temp
    (FullFile,EmployeeCount,DTL_Amount,EmployeeType,station)
    VALUES
    ('#TrueFile#', #CountOfEmployee#, #DTL_SUBTOT#, '#EMPTYPE#', '#ARPT_CD#')
    </CFOUTPUT>
    </CFQUERY>
    However, I was not able to write to a temporary table AND read the results. I got the syntax to run to write the above results to a temporary table.  But when I tried to read and output the results from the temp table, I got an error.  Also, it wouldn't take the single "#" (local) only the global "##" table var, using this syntax.  Note that if I didn't have the DROP TABLE in the beginning, the 2nd time you run this query, you get an error telling you the table already exists.
    <CFQUERY name="ITE_Temp2" datasource="MyTable">
    DROP TABLE ##MyTemp2
    CREATE TABLE ##MyTemp2
    FullFile char (7) NOT NULL,
    EmployeeCount int NULL,
    DTL_Amount decimal NULL,
    EmployeeType char (3) NULL,
    station char (3) NULL
    <CFOUTPUT query="ITE2">
    INSERT INTO ##MyTemp2 VALUES
    '#ITE2.TrueFile#',
    #ITE2.CountOfEmployee#,
    #ITE2.DTL_SUBTOT#,
    '#ITE2.EMPTYPE#',
    '#ITE2.ARPT_CD#'
    </CFOUTPUT>
    </CFQUERY>
    So even though the above works, I could use some help in reading/writing the output.  I've tried several things similar to below, but they don't work.  It't telling me ITE_Temp2 does not exist.  It's not easy to find good examples of creating temporary tables in SQL Server.
    <CFQUERY name="QueryTest2" datasource="SkynetSQL">
    SELECT *
    FROM ITE_Temp2
    </CFQUERY>
    <CFOUTPUT query="ITE_Temp2">
    Output from Temp Table<br>
    <p>FullFile: #FullFile#, EmployeeCount: #EmployeeCount#</p>
    </CFOUTPUT>
    Thanks for any help/advice.
    Gary.

  • ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near

    Hi,
    I am currently receiving the following error in BI Answers when I run a query against a Microsoft SQL 2005 Server.
    View Display Error
    Odbc driver returned an error (SQLExecDirectW).
      Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: 60 code: 8180 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
    SQL Issued: SELECT 0 s_0, "SD&A_Dashboard_Test"."BORIS_ALIAS_ETMS_Users"."Id" s_1, "SD&A_Dashboard_Test"."BORIS_ALIAS_ETMS_Users"."UserName" s_2 FROM "SD&A_Dashboard_Test" WHERE ("BORIS_ALIAS_ETMS_Users"."UserName" = 'trowe') FETCH FIRST 65001 ROWS ONLY 
    I am able to connect successfully to the Data Source and run a query against the database using the NQCMD command line tool so believe I have configured the DataDirect 7.0.1 drivers correctly, also I am able to view the Table Data in the RPD Physical Layer in the BI Administration Tool. So don't understand why I am getting this error.
    I have also activated the nquery.log but that doesn't really give me any further information.
    [2015-04-28T16:37:22.000+00:00] [OracleBIServerComponent] [TRACE:4] [USER-34] [] [ecid: 4a9e440f990ba0a4:-1995d2c5:14d00d3ef04:-8000-00000000000001c6,0:1:1:5] [tid: 5f] [requestid: 6f11000b] [sessionid: 6f110000] [username: borisdev] -------------------- Query Status: [nQSError: 16002] Cannot obtain number of columns for the query result. [[
    [nQSError: 16001] ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'..
    [nQSError: 16001] ODBC error state: 60 code: 8180 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Statement(s) could not be prepared..
    [nQSError: 43119] Query Failed:
    I was wondering if anyone could shed any light on what could possibly be causing the [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'.. error ? And also provide any suggestions on how I can troubleshoot this issue further as I am now completely out of ideas of what to do next having tried numerous things i.e. setting  IDENTIFIER_QUOTE_CHAR = '' in DBFeatures.INI which I found in similar posts on the subject all to no avail
    Regards,
    Tom Rowe

    Hi Rajagopal,
    Thanks for your reply after doing some further investigations this morning I found and corrected the problem...
    The DataDirect Driver does not like double quotes in the query for some reason, testing  using the BI Answers generated SQL with the nqcmd tool below...
    With double quotes “” it fails immediately
    Give SQL Statement: select T18706."Id" as c1, T18706."UserName" as c2 from "ETMS_Users" T18706 where ( T18706."UserName" = 'trowe' )
    select T18706."Id" as c1, T18706."UserName" as c2 from "ETMS_Users" T18706 where ( T18706."UserName" = 'trowe' )
    [102][State: S1000] [DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near 'Id'.
    Statement execute failed
    With double quotes removed for just the columns I now get the Error near ‘ETMS_Users’ which still had the double quotes
    Give SQL Statement: select T18706.Id as c1, T18706.UserName as c2 from "ETMS_Users" T18706 where ( T18706.UserName = 'trowe' )
    select T18706.Id as c1, T18706.UserName as c2 from "ETMS_Users" T18706 where ( T18706.UserName = 'trowe' )
    [102][State: S1000] [DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near 'ETMS_Users'.
    Statement execute failed
    With all double quotes removed it works !
    Give SQL Statement: select T18706.Id as c1, T18706.UserName as c2 from ETMS_Users T18706 where ( T18706.UserName = 'trowe' )
    select T18706.Id as c1, T18706.UserName as c2 from ETMS_Users T18706 where ( T18706.UserName = 'trowe' )
    c1           c2
    42499        trowe
    Row count: 1
    Give SQL Statement:
    The solution to fix the problem is...
    In the BI Admin Tool Physical Layer Database, Properties Features tab is to delete the double quote in the Value column for IDENTIFIER_QUOTE_CHAR, setting this in the DBFeatures.INI file does not resolve the problem possibly it did in earlier versions of the product.
    Regards,
    Tom Rowe

  • 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

  • Creating a connection to MS SQL Server 2000...

    Hi ,
    Using the :
    1)Oracle SQL Developer 1.1.3 and 1.2.1 ,
    2)MS SQL Server 2000 - both db and agent are running ,
    I cannot create a connection to MS SQL Server (error: "Failure - Network Error IO Exception : Connection refused : connect").
    Both software - and Oracle DB , as well- have been installed on the same server(Win XP) and i have deactivated the firewall , without the desired result....
    Also the server is standalone and does have a static IP Address....
    What can I do ...????
    Thanks....
    Sim

    I have also downloaded and installed the SQL Developer 1.5.0.53.
    When i declare the same settings to SQL SERVER DB - as in the other SQL Developer versions(1.1.3 and 1.2.1)- I get a different error message..:
    "Failure - Cannot connect to SQL Server on localhost" - whereas in the other versions i get[i] "Failure - Network Error IO Exception : Connection refused : connect".
    When i declare another host name (one that does not exist , for example "localhost1") then the error message is :"Failure : Unknown host name localhost1".
    So ,the above tests may show that the error seems to be in the port setting....however , i cannot verify it since the port setting is 1433 - the one i declare in the connection.
    Do you have an idea....????
    I would be grateful if somebody could provide some 'light'.....!!!!
    Sim

  • 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.

  • How to create user defined metrics for SQL Server target?

    The customer is not able to create a user defined metrics for SQL Server target.
    This is very important for him to use this product.
    He is asking how to create user defined metrics?
    I sent him Note 304952.1 How to Create a User-Defined SQL Metric in EM 10g Grid Control
    But it would work for an Oracle DB, but his target is SQL Server DB
    Not able to find the "User-Defined Metrics" link from Database home page.
    How to create user defined metrics for SQL Server target?

    http://download-uk.oracle.com/docs/cd/B14099_19/manage.1012/b16241/Monitoring.htm

  • SQL Server Agent - [165] ODBC Error: 0, Named Pipes Provider: Could not open a connection to SQL Server [2]. [SQLSTATE 08001]

    Hi,
    I keep receiving the error below in the SQL Server Agent Error Log;
    [165] ODBC Error: 0, Named Pipes Provider: Could not open a connection to SQL Server [2]. [SQLSTATE 08001]
    It is occurring approximately 20 times an hour and i cannot link it to any job failures. All jobs on the same SQL instance are working.
    The server is a clustered server and there are no errors occuring in the SQL Server error log at the same time. I have attempted to trace using profiler looking for errors and warnings but anything that does occur doesn't seem to correspond to the reported
    times of the errors within the sql agent error log.
    Please could someone point me where to look next?
    Many thanks.

    Please may I add that this is on a SQL Server 2008 R2 Enterprise edition patched to 10.50.1600.
    Nah, that server is not patched at all, because 10.50.1600 is the RTM version. Find Service Pack 2 and install at the next maintenance window, after having performed tests according to your local policy.
    It is not going to resolve your particular problem though.
    It seems like you have a job that attempts to a connect to s server that is down or non-existing. The job may be configured to return success also on failures. I would check if there are jobs that target other servers.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Playbook doesn't recognize that I am coonected to my Z30

    I have added the BlackBerry Bridge feature and it shows both on my phone and PlayBook that I am connected. I can even remotely use my phone and make changes to things on my PlayBook. What the PlayBook doesn't recognize is.... when I go to BlackBerry

  • I can not connect my apple display, please help

    I have a ibook G4 and a Mac mini G4 equal, long time ago that I am a mac user and the truth I am more than happy, there's nothing better. The point is that a few days ago I gave an "Apple 15" Cinema Display ADC studio monitor "and so far I have not b

  • Add jsf2 Custom Component from 3rdparty .jar file

    Hi, everyone. I've got 3rdparty custom component as jar library. It's laid in my classpath. But I can't use it in my custom.taglib.xml. here is taglib: <?xml version="1.0" encoding="UTF-8"?> <facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee" x

  • Colour and difference query

    Hi I was wondering what the differences, if any, are between the Macbook Pro and the Powerbook? I live in the U.K so is this just a different name given to the same versions for UK and USA. If they are different, how? and what do they do differently

  • Help me in this query

    My Dear if I have table like emp table in scott plus new column month_sal And I write qery like this select ename,avg(sal) from emp where month_sal=2 group by ename no Problem up to now I need Improve this query to be like this select ename,avg(sal)