Pattern Extraction Table Value Function

Aug 9, 2007


I need a table value function for extracting strings matching a particular pattern from a long string.

e.g. I have a table called cs_Posts, it has a column called FormattedBody, this value can be something like:




Code Snippet<p>this is the 1st photo <a href="http://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPGhttp://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPG">http://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPG</A< A>>" border="0" alt="" /></a></p>
<p>this is the 2nd photo<a href="http://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPGhttp://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPG">http://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPG</A< A>>" border="0" alt="" /></a></p>





When this long string is input, the table value function should 2 rows:
http://jvcwebdev:81/cs/blogs/hllee/DSC00884.JPG
http://jvcwebdev:81/cs/blogs/hllee/scene%20photos/DSC00859.JPG

Any idea?

View 4 Replies


ADVERTISEMENT

Reporting Services :: Exporting SSRS Reports To PDF With Background Pattern - Pattern Not Visible?

May 8, 2015

I tried creating one simple bar chart report in SSRS, with background fill with pattern "UpwardDiagonal", the stripes on the column when viewed insider report viewer control is quite prominently visible, whereas when exporting the same report to PDF the lines are very thin and dense and hence makes it very difficult to differentiate between one column with pattern inside and one without. I have even tried various other pattern like "LightUpwardDiagonal" and "WideUpwardDiagonal" but all have same result when exported to PDF.why?

View 2 Replies View Related

Looking For Table Design Pattern For Different Value Types

Jan 3, 2007

Hi,

I need to store a list of parameters in a database. Each parameter has a name, description, comment and a value. Easy so far.

However the values are of different types. Each individual parameter has a value which may be of type int, decimal, string, boolean, custom type etc.

Which table design pattern is most appropriate?
We have a heated in-house discussion and I need supporting arguments.


Options explored so far:

1) (De-)serializing the value to a string-type.
2) Adding a column for each type, using only one column at a time.
3) Adding extra value-tables, one table for each type.
The disadvantages for each option are obvious and the basis for our discussion.

Your help in this matter will be appreciated.
Regards, Tonn

View 5 Replies View Related

In-Line Table-Valued Function: How To Get The Result Out From The Function?

Dec 9, 2007

Hi all,

I executed the following sql script successfuuly:

shcInLineTableFN.sql:

USE pubs

GO

CREATE FUNCTION dbo.AuthorsForState(@cState char(2))

RETURNS TABLE

AS

RETURN (SELECT * FROM Authors WHERE state = @cState)

GO

And the "dbo.AuthorsForState" is in the Table-valued Functions, Programmabilty, pubs Database.

I tried to get the result out of the "dbo.AuthorsForState" by executing the following sql script:

shcInlineTableFNresult.sql:

USE pubs

GO

SELECT * FROM shcInLineTableFN

GO


I got the following error message:

Msg 208, Level 16, State 1, Line 1

Invalid object name 'shcInLineTableFN'.


Please help and advise me how to fix the syntax

"SELECT * FROM shcInLineTableFN"
and get the right table shown in the output.

Thanks in advance,
Scott Chang

View 8 Replies View Related

DDL Extraction

Sep 28, 2006

Does anyone know how to pull DDL create statements out of a SQL Server 2005 EE database for existing objects? I'm mainly concerned with indexes and constraints. If possible I can create the statements myself if I can get all of the information out of the databse.

Thanks in advance

View 3 Replies View Related

SAP Extraction

Jan 2, 2008

Does SSIS support SAP extraction by out of box.

View 5 Replies View Related

OLE Object Extraction

Mar 31, 2006

Hi,

I have virtually no ms access skills as am an Oracle dba.

I need to extract OLE Object data which are images from an Access 2000 mdb file for an import I am writing, can anyone point me in the direction of either some software that will do this or any scripts I can write to do this.

When I open the table the field reads "Long Binary Data"

Many thanks

Robert

View 3 Replies View Related

Data Extraction

Nov 12, 2007

Hi guys!

How can I extract data from a SQL server 2000 to TEXT Files. On which the data length that I have is different from the new format.

sample: database1: employee_ID = 10
database2: ID_employee = 8

May I know what query can I execute to provide an 8 length for the incoming database?

Thanks! Hope u'll help me!

View 5 Replies View Related

Data Extraction

Nov 13, 2007

Guys can you help me to extract my database data to text files using different format:

sample
ClientId9ClientNo12

How can I extract ClientNo with a length of 12 to ClientID with a length of 9 to text files.

View 3 Replies View Related

Term Extraction

May 12, 2006

I've just started using the SSIS and i would like to know if it's possible to change or update the dictionary of the term extraction tool. That's important to me because i may have to look for words that don't exist in the defaut english dictionary of the tool.

Thanks.

View 3 Replies View Related

SQL Connection And Data Extraction Help

Jan 31, 2008

Hi,
 I am new to the whole concept of ASP.NET and codebehind (i am using c# and i am also new to that) i currently trying to get my codebehind to connect to a SQL Server express 2005 database on page load however i am getting this error thrown back at me when i run the aspx page on my localhost,
Cannot open database "db_revival" requested by the login. The login failed.Login failed for user '12042HOPEASPNET'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open database "db_revival" requested by the login. The login failed.Login failed for user '12042HOPEASPNET'.Source Error:




Line 18: {
Line 19: SqlConnection conn = new SqlConnection(@"Data Source=12042HOPESQLEXPRESS;Initial Catalog=db_revival;Integrated Security=True");
Line 20: conn.Open();
Line 21:
Line 22: }
Source File: g:Level HRevivalDefault.aspx.cs    Line: 20
i believe it has something to do with the conn.Open() funtion or the connection string it's self the acutal full code is here,
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data.Sql;public partial class _Default : System.Web.UI.Page
{protected void Page_Load(object sender, EventArgs e)
{SqlConnection conn = new SqlConnection(@"Data Source=12042HOPESQLEXPRESS;Initial Catalog=db_revival;Integrated Security=True");
conn.Open();
 
}
secondly once i get the connection working i want t be able to check a user email and password against those in a table to allow the log in, through my experience with PHP i would of done this by putting what the user entered into a variable and then checking the variables against an sql query, how do i go about this with aspx and C# my textfield is called uname and my passsword is call pword.  Any help of example code would be greatly appreciated.
 
Many Thanks
 S_ainley87

View 6 Replies View Related

Extraction Of Data On Conditions

Sep 24, 2014

I have a table having code
code
12345678
21345678
45789612
12345678
21345678
21345678
12347586

I want result on the basis of first 2 digit the repeatation of code is count as 1.
code1 code2 count
12 34 2
21 34 1
45 78 1

View 2 Replies View Related

Excel Extraction Issue

Oct 26, 2006

I have a spreadsheet that's designed to look like a form. Does anyone know how I would create a SSIS package to extract specific cell values?



TIA

View 1 Replies View Related

Term Extraction -&&> Keep Order?

Nov 29, 2007

Hello,

when I extract nouns from a text with the Term Extraction Transformation, the destination indeed keeps the correct nouns but they are in a random order.

Is it possible to keep the order of these nouns and maybe already keep double occurrences?


Kind regards, _Rodney_

View 5 Replies View Related

Term Extraction Frequency Per Row

Sep 15, 2006

Is there a way to perform term extraction on each row in a table, and have the term extraction denote the frequency of the term on a per row basis rather than a per table basis?

Otherwise, is there a way I can take extracted terms and apply a sql function that returns the occurance of that term in each row?

Example: Row 1 = 2 hits, row 3 = 5 hits, etc.

View 4 Replies View Related

Brute-Force Substring Extraction

Aug 28, 2007

In my product description field, I need to extract the data that looks like
19-3-19 or 0-0-7. Sometimes that pattern is in the data, sometimes not.
I only want those that contain the pattern, of course, but I have no other method of determining whether or not the pattern will be in the description.
I thought I'd found a method that worked, until I encountered descriptions
that had a '-' in it prior to the pattern.

Here's what I have so far, it works for all but the last one.

CREATE TABLE #TMPPROD (
PROD_DESC VARCHAR(60)
)
INSERT INTO #TMPPROD
SELECT '22-4-12 15%SCU'
UNION ALL
SELECT '14-4-8 W/F'
UNION ALL
SELECT 'UFLEXX 17-3-17 2%FE'
UNION ALL
SELECT 'FERT-PEST 19-19-19'

SELECT PROD_DESC, SUBSTRING(PROD_DESC,CHARINDEX('-', PROD_DESC)-CASE WHEN PATINDEX('[0-9]', SUBSTRING(PROD_DESC, CHARINDEX('-', PROD_DESC) - 2,1))<>0 THEN 2
WHEN PATINDEX('[0-9]', SUBSTRING(PROD_DESC, CHARINDEX('-', PROD_DESC) - 1,1))<>0 THEN 1
ELSE 0 END, CHARINDEX('-', SUBSTRING(PROD_DESC,
CHARINDEX('-',PROD_DESC)+1,2))+CASE WHEN PATINDEX('[0-9]', SUBSTRING(PROD_DESC, CHARINDEX('-', PROD_DESC) - 2,1))<>0 THEN 2
WHEN PATINDEX('[0-9]', SUBSTRING(PROD_DESC, CHARINDEX('-', PROD_DESC) - 1,1))<>0 THEN 1
ELSE 0 END+2+CASE WHEN PATINDEX('[0-9]', SUBSTRING(PROD_DESC, CHARINDEX('-', PROD_DESC) +1,2))<>0 THEN 2
WHEN PATINDEX('[0-9]', SUBSTRING(PROD_DESC, CHARINDEX('-', PROD_DESC) - 1,1))<>0 THEN 1
ELSE 0 END) AS 'ANALYSIS'
FROM #TMPPROD
WHERE PROD_DESC LIKE '%-[0-9]%-[0-9]%'

DROP TABLE #TMPPROD


Any pointers on what to try next, or have I severely over-complicated the process - as I am wont to do.

Thanks
Mark

View 14 Replies View Related

Simple Data Extraction From 2 Tables

Mar 22, 2007

So these are a couple different interpretations I've made of a statement that needs to return students name's with the OSOS field in the attendcode code column of the attendance table on todays date with an attendance.aperiod column equal to 4.


This first one returns no results at all when I should get about 7 rows or so.....

Select Student.name,
attendance.studentid,
attendance.attenddate,
attendance.aperiod,
attendance.attendcode
from Attendance, Student
where AttendDate >= DateAdd(Day, DateDiff(Day, 0, GetDate()), 0)
And AttendDate < DateAdd(Day, DateDiff(Day, 0, GetDate()), 0) + 1
And aperiod = '4'
And AttendCode = 'OSOS'
AND student.name = Attendance.studentid

This one is returning all of the names in the database 6 times each.

Select Student.name,
attendance.studentid,
attendance.attenddate,
attendance.aperiod,
attendance.attendcode
from Attendance, Student
where AttendDate >= DateAdd(Day, DateDiff(Day, 0, GetDate()), 0)
And AttendDate < DateAdd(Day, DateDiff(Day, 0, GetDate()), 0) + 1
And aperiod = '4'
And AttendCode = 'OSOS' order by name

I think something is messed up with my WHERE control but I cant figure it out... Any help is greatly appreciated!

View 4 Replies View Related

Auto Data Extraction Through ODBC

Apr 12, 2007

Hi,

Could you please help me to find easiest way to schedule daily auto data extraction time in SQL Server Express 2005 Edition (I need to put time to load data every day).



Thanks

Amir



View 7 Replies View Related

Conditionally Extraction Of Data From A View

Mar 19, 2007

Hi all,
I am really new to SSIS, so may be this is a really simple question, but I couldnt find an answer yet.
I need to build a package that
1) counts the rows from a view
2) if rowcount >0 extracts the data into a file

I tryed to do this using a Row Count Transformation in the data flow, but after putting the count in a variable I am not able to perform the "conditional" phase two.
I mean that I want to check the value of the variable, but cannot figure out how to conditionally execute the flat file extraction.

Using Row Count, I have to build 2 data flow tasks.
Is there a way to do this in a single data flow?
May be using an Execute SQL Task instead of row count?

Any suggestions will ge greately appreciated
IgorB

View 6 Replies View Related

Transact SQL :: Delimited Data Extraction

Jul 29, 2015

I have a database that has a table with a lot of delimited data. I need to extract some of this data, preferably into a sql view, that I can name the fields. The data looks like this:

|7700|6|0|work center|24|8|XLT

What I need is:

field name 1= 7700  field name 2= 6   field name 3= 0 field name 4= work center  field name 5=24, ETC

I'm not sure how to count the delimiter | and get the data between | & |. Or maybe that isn't the way to do this.

Here is a sample of what I did in Crystal Reports but I need a view to make this usable. 

Split ({usrc1.application_data}, "|") [22]  This gives me the data between delimiters 22 & 23.

View 5 Replies View Related

SQL Pattern Matching

Mar 20, 2008

Hi everyone. I'm developing a web search engine using asp and SQL Server 2000. I need to return records that matches with a string entered by users. In example, suppose my database to have this structure and it's filled like this:

ID NAME KEYWORDS
--- ------- -----------
AA025 NAME1 attached, atic, common, business, hotels
AA026 NAME2 headache, medicin, aspirins, heat, health
AA027 NAME3 at, services, music, electronics

suppose that user enters 'at'. By now, i'm using this pattern '%<input_text>%'. So in this example, pattern would be '%at%'. As i remarked in the fields above, the three fields matches, and that's not what i'm looking for. I want that the result of that query be just the last field, with 'AA027' ID.
Thanks in advance guys.
Cheers.

View 14 Replies View Related

70-441 Exam Pattern

Jan 30, 2008



hi can any one help me to get the pattern of 70-441 exam.
i need information total number of question in the exam..
and will there be any simulation as 70-431 exam.

View 3 Replies View Related

Schema Extraction For Multiple Interdependent Databases

Jul 23, 2005

I'm looking for a tool that can extract only the schema from a databasein a form that can be used to generate that schema in another emptydatabase. This is to facilitate our disaster recovery processes wherewe need the objects only, not the data, and need to replicate this toour disaster recovery site over the WAN. There are plenty of toolsthat can handle a single database, but does anyone know of any toolsthat could handle multiple databases where many of the objects (storedprocs and views) are dependent on objects in other of the databases(tables). This is a home-grown ETL suite so making changes to the codeto remove these dependencies would take way too much effort. I amlooking for something that can either extract the schema for all 3databases and handle the object creation ordering to account for thedependencies (a simple method would be to extract by object type acrossall databases, e.g. tables for all dbs before views before procs), or abackup/restore tool that allows you to restore the objects only withoutdata. Worst case we could write something to generate the DDL or useSQL DMO, but ideally we would prefer to purchase a (relativelyinexpensive) tool to do it.Thanks,Simon

View 3 Replies View Related

SQL Express Server Fails To Install During Extraction

Feb 17, 2008



I've tried downloading SQL Server Express several times and installing. Every time it fails during extraction. I have a Vista machine with .NET Framework 3.0 already installed. I'm using MS Expression Web, MS Access, and have also downloaded and installed MS Visual Web Developer 2008 Express Edition. Why can't I even get SQL Server Express to extract from the downloaded file?

View 5 Replies View Related

Problem With Extraction Of A Report In Xml Format Using XSLT

Nov 1, 2007

Hi guys,


I have a simple report created with rs2005. I want to get the output exported (using the export options of rs2005) in a specific xml format, so I am using xslt transformation to get it proper.

My problem is that, when I'm doing this using my own machine (SQL Server 2005 32bit installed) everything works OK. BUT when I want to try it on a server that we are supposed to use it gives me a real bad error. On the server, if I have the report without using xslt, it gets exported OK but not in the correct format. I have tested the report on a 32 and on a 64 bit server, I have used either SP1 and SP2 but still can't get through. The error message appearring while I try to export in xml is "Server Error in '/Reports' Application. The XSLT path is invalid. It refers to an external resource, uses invalid syntax, or the XSLT was not found in the catalog."


Has anyone seen something like this before ?


Your help would be much appreciated.

Thanx in advance

View 5 Replies View Related

Design Pattern Question

Sep 15, 2005

Say I have an object that can be created by some users and not others.  And, I have a method something like - function createObject(userId as Integer, objectName as String).  The method calls a stored procedure using the two input arguments as parameters.Now, what I am wondering is this; I am obviously going to check in my SP to ensure that the user has the rights to create the new object before inserting the new record, and there will be an output parameter to send the new record ID back to the method, but do Ia) have a separate output parameter to report on the success of the creation (e.g. @Err Int OUTPUT)b) use the existing output (used to send the new record ID back) and send an error code (e.g. if newRecordId = -9999)c) somehow try to cause a failure of the SP that can be caught in a try/catch blockThanks in advance,Martin

View 1 Replies View Related

Unicode And Pattern Matching

Mar 30, 2015

I've been trying to find and filter out data that can cause FOR XML to fail with the error:FOR XML could not serialize the data for node ?? because it contains a character (0x0006) which is not allowed in XML.I thought it would be simple, just identify the rows that don't match the XML spec URL...

However, the following doesn't work.
select fieldname
from tablename
where fieldname
like N'%[^'+nchar(0x9)+nchar(0xA)+nchar(0xD)+nchar(0x20)+N'-'+nchar(0xD7FF)+N']%'

Not only does this fail to find the offending rows, when I checked by inverted it by taking out the "^" it still returns no rows.When I reduced 0xD7FF down to 0xFF it returns data, but I cannot add the other range back in without all rows not matching.I've experimented with values and found 0x02E9 was the highest I could go without all values vanishing. Even then, numbers lower than that caused a large variation in the number of rows returned.My Field is NVarchar(100) in SQL_Latin1_General_CP1_CI_AS.

View 1 Replies View Related

[Fwd: Reverse Pattern Matching]

Jul 23, 2005

View 2 Replies View Related

Fill Pattern In Columns

Aug 22, 2007



We have a collection of charts, some of which we use the gray scale for the palette (users only have B&W printers). We need to use the same patterns in other charts for consistency. The only option I see in Edit Chart Value-->Appearance-->Series Style-->Fill is Gradient. Is there any way to pick a fill pattern?

The pattern is the diagonal lines slanting down from left to right. It is the third column in the gray scale, so I have tried to add a dummy column as the first column, so that my column would have this pattern. However, the chart allows for space width wise for the first column, so there is a blank space on the chart. I have the Data Output checked to No.

Any other ideas, I would appreciate it!

View 2 Replies View Related

Nth Pattern Position Of The String

Mar 12, 2008



Hi,

How can i find the 2nd comma position of a string, if i have multiple commas in my field. I need SQL Statement

Ex:

F1
Andy,David,Martin,
Sam,Dan,Philip,

I need the position should be

F1 F2
Andy,David,Martin, 11
Sam,Dan,Philip, 8

Thanks,
Mears

View 8 Replies View Related

CONTAINS With Variable Search Pattern?

Jun 7, 2007

I have two simple tables:


CREATE TABLE summaries ( summaryId int identity, summary varchar)CREATE TABLE phrasesToSearchFor ( phrase varchar)


I want to do this:

SELECT summaryFROM summariesWHERE CONTAINS(summary, <any of the values in phrasesToSearchFor>)

I've tried every weird permutation of the query I can think of, but can't find a way to make it work. Can anybody help?

Bonus Question:

I've got a function dbo.getPhraseToSearchFor(userId) that returns a phrase depending on the value of userId. I want to get a result table of (userId, summary) where for every user, I use dbo.getPhraseToSearchFor(userId) to figure out what to search the full-text catalog for. The docs say you can use a scalar function anywhere a scalar value is expected, but apparently that doesn't apply in this case -- you can't do CONTAINS(summary, dbo.getPhraseToSearchFor(23))

View 1 Replies View Related

LIKE Pattern Searching Using CONTAINS Or FREETEXT

May 15, 2007

Hi,



We are using FULLTEXT searching for searching the title column in SQL 2005 table.

We are aware that using CONTAINS we cannot search middle of the string like the way we do using LIKE '%text%'.



Is there any alternative way of acheiving this functionality using FULLTEXT search or any other ways of doing this keeping in mind performance.



Any feedback on this is greatly appreciated.



thanks and regards,

Krishna.

View 3 Replies View Related

Transact SQL :: Getting A Sequence Pattern?

Apr 30, 2015

I need a simple tSQL code that will produce an array sequence values that has gap with 2 or more consecutive values, which can vary - so 2 or 3 or 4 between sequence of number.  For example, I want it to return a series with a  gap or space of 2-  So it should return 1, 2, 5, 6, 9, 10.. or a gap of 3 -  1,2 ,6,7,11,12.. etc I  know a single gap is quite simple using a recursive cte, but I haven't been able to find how to get this kind of result.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved