Transact SQL :: Sentence Banned If Any Illegal Keyword Found
Nov 13, 2015
I have a illegal keyword table name as "Illegal_keyword_Master" where near about 2000 illegal keyword are stored... Now I have a big Sentence(bunch of words)...
If any illegal is keywords is found from "Illegal_keyword_Master" table in that sentence then the sentence is "banned" otherwise the sentence is "OK"....
View 11 Replies
ADVERTISEMENT
Jun 17, 2015
CREATE TABLE BILL_DETAIL
([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
[x_billable_yn] int, [x_bill_rate] int, [COST_TYPE] varchar(19) )
INSERT INTO BILL_DETAIL
([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE])
[code]...
how to get records using stuff keyword as above i want to query using where condition with where objid=1 and should frame output as Parking, Toll only 1 input parameter need to given.
View 20 Replies
View Related
Mar 22, 2006
I have two tables CarType & Cars. Table CarType has a column CarTypeId which is the primary key (int, identity). Table Cars includes a column CarTypeId (int) which is a foreign key into the CarType table.Now I am trying to build a list of all those CarTypeId entries (from the CarType table) for which there are no Cars (i.e. there is no corresponding entry in the Cars table).I read that there is an SQL "MINUS" keyword that you can use like this:
SELECT CarTypeId FROM CarTypeMINUSSELECT CarTypeId FROM Cars..So if CarType contains records with the keys {1, 2, 3, 4, 5} and Cars contains records with the foreign keys {2, 4} (using set notation), your result should be the set {1, 3, 5}. (Note: I have tried alternate versions of this where I selected the DISTINCT CarTypeId entries from Cars, and where I sorted them; results same in both cases).I tried it in SQL Server 2005 Express. The result is just {1, 2, 3, 4, 5}.
Is the MINUS capability supported by SQL Server? I know that there are all sorts of different SQL dialects & implementations and that SQL has evolved & transmutated over the years; perhaps they opted to leave this out of SQL Server..
Here's a reference to the website where I initially found out about MINUS: [URL] ....
View 19 Replies
View Related
Apr 30, 2015
I am getting error "Incorrect syntax near the keyword 'Select'." while running the below query.
DECLARE @DATEPROCESS DATETIME;
SET @DATEPROCESS = CAST(DATEADD(D, -((DATEPART(WEEKDAY, GETDATE()) + 1 + @@DATEFIRST) % 7), GETDATE()) AS DATE)
insert into tempjoin([PART], [SPLRNAME], [SHIPDAYS], [SPRICE]) values
(Select distinct
RC. CAT_PART AS PART,
RC. CAT_SUPPLIER AS SUPPLIER,
FFC.[Ships Within Days] AS SHIPDAYS,
ffc.[Sell Price] AS SPRICE
[code]....
View 4 Replies
View Related
Jul 20, 2015
So I was looking at the code for the proc created by Ola's script and noticed a number of variable declarations happening early on (like at line 10) but these variable declarations do not have the DECLARE keyword prefacing the variable identifier.
Then, a couple lines lower, a new batch of variables are declared, but this time with the DECLARE keyword. I was under the impression that you always needed the DECLARE. Is it a scope thing? Like related to the fact the first set of variables are before the stored proc's begin statement?
USE [master]
GO
/****** Object: StoredProcedure [dbo].[DatabaseBackup] Script Date: 7/20/2015 2:23:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[DatabaseBackup]
[Code] ....
View 3 Replies
View Related
Sep 1, 2015
I have a storeprocedure( sp_nthWorkingday) which return a calender date.
eg :
calendardate
9/9/2015
I wrote a dts script for displaying this date.Below is the code.
Function Main()
dim myConn
dim myRecordset
dim iRowCount
[code]....
But I am getting an error on execution.Error : item cannot be found in the collection to the requested name or ordinal
View 2 Replies
View Related
Nov 19, 2015
I am wanting to create a query so that I can combine each of the found duplicates into one entry.
An example of this is:
Name |ID |Tag |Address |carNum
-------------------------------------------------------
Bob Barker |2054| 52377 |235 Some road |9874
Bill Gates |5630| 69471 |014 Washington Rd. |3700
Bob Barker |2054| 97011 |235 Some road |9874
Bob Barker |2054| 40019 |235 Some road |9874
Steve Jobs |8501| 73051 |100 Infinity St. |4901
John Doe |7149| 86740 |7105 Bull Rd. |9282
Bill Gates |5630| 55970 |014 Washington Rd. |3700
Tim Boons |6370| 60701 |852 Mnt. Creek Rd. |7059
In the example above, Bob Barker and Bill gates are both in the database more than once so I would like the output to be the following:
Bob Barker |2054|52377/97011/40019|235 Some road |9874
Bill Gates |5630|69471/55970 |014 Washington Rd.|3700
Steve Jobs |8501|73051 |100 Infinity St. |4901
John Doe |7149|86740 |7105 Bull Rd. |9282
Tim Boons |6370|60701 |852 Mnt. Creek Rd. |7059
Notice how Bob Barker & Bill Gates appends the tag row (the duplicated data) into one row instead of having multiple rows. This is because I do not want to have to check the previous ID and see if it matches the current id and append to the data.
View 2 Replies
View Related
Apr 13, 2000
Hi
Has anyone come across SQL Server giving errors like A row on 'page 52995' was accessed that has illegal length of 0 in database? I believe that it is due to some data on the page has been corrupted. Is there a way to prevent such problem? Can daily backup be able identify such problem?
View 1 Replies
View Related
Jun 10, 2008
I have a user who registered with the name "#1baseballer" in my asp.net membership database. Now when I try to manage his account using my administration utility I receive "Object reference not set to an instance of an object error". Is this because of his chosen user name and can I fix this in my code?
View 2 Replies
View Related
Dec 4, 2006
i'm trying to figure out a way to replace a handful of "Illegal" characters in our SQL tables. We are using Project Server and some of these characters are causing errors or other issues in OLAP Cube.
I'm trying to figure out a way to change the following characters to an underscore ( _ ) :
illegal characters are: / ( ) . , ' : - &
Can I just create a SQL query that loops through a column to replace all of these characters at once? or do I have to replace one character at a time?! I tested replacing one at a time and it works with the REPLACE function.
I'm not all that familiar with MSSQL, I've spent past few years working with MySQL instead.
how can my query loop? or would using CASE help me out?
thanks. any feedback is much appreciated. If you need to know more, let me know.
regards
View 2 Replies
View Related
Mar 24, 2004
Hi
We are using a microsoft small bussiness server. One of our workstations get an mgrntw illegal operation error sometimes when doing an invoice in pastel premier. Does anyone know what can cause this problem and how can I fix it? The server run on windows 2000 and the workstations all use windows 98SE. This problem does not happen everyday. I formatted that computer, hoping the problem will go away but after 3 weeks it suddenly appeared again. I am not sure what version our mgrntw.exe is.
Thanx
Sonja
View 1 Replies
View Related
Jul 26, 2006
Environment: Server Windows 2003 SP1, VS 2005
I ran into this problem trying to deploy an SSIS package to a development server. I tested by creating a simple SSIS package on the server itself. Two blocks an OLE DB Source block and an OLE DB Destination block. Two tables in the same database, one the source, the other the destination. Connection manager test connection works fine.
Package will execute from the IDE (locally on the development server), source block will read the table subcessfully, but when the destination block executes it fails and will stay yellow in the status screen. during the execution SQLDumper.exe is triggered. Analyzing the dump tells me:
(2b40.2938): Illegal instruction - code c000001d (first/second chance not available)
eax=04008010 ebx=00000004 ecx=00000010 edx=00000000 esi=00000940 edi=00000000
eip=7c82ed54 esp=0422f598 ebp=0422f608 iopl=0 nv up ei ng nz ac po cy
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000297
An illegal instruction was hit.
This error exists when the destination block is either an OLE DB Destinaltion or a SQL Server Destination block and the SSIS application is executing locally.
Strangely enough if I run this same SSIS application from my development laptop it works fine against either my local datbase instance (on the laptop) or against the development server (App running on laptop, DB on development server).
I have scanned the forums and search engines for this type of error, so any assistance would be appreciated.
Thanks...
View 4 Replies
View Related
Feb 6, 2007
Hi There,
I am trying to populate a table in Oracle Db using SSIS. For some reason, I get this error..
illegal variable name/number
This is what I have....
Public Overrides Sub PreExecute()
oracleCmd = New OracleCommand("INSERT INTO Temp(ID) VALUES(@KEY)", oracleConn)
oracleParam = New OracleParameter("@KEY", OracleType.Number)
oracleCmd.Parameters.Add(oracleParam)
End Sub
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
'With oracleCmd
.Parameters("@KEY").Value = CType(Row.KEY, OracleClient.OracleNumber)
.ExecuteNonQuery()
End With
End Sub
==
Row.Key returns a row from the oracel table which has one column of type numeric..
Can somebody please help me?
Thanks a lot!!
View 1 Replies
View Related
Jul 26, 2006
hi!
I am getting some junk characters while executing sql task(which is a stored proceedure) when i execute the same sql environment it is fine.
User::ArchiveDir {? )ArchiveVoucherLog_6-26-2006
What is problem in here?
Any help
Thanks,
Jasmine
} String
View 1 Replies
View Related
Feb 16, 2004
Hi, I need to make a query that, according to the value of a field, returns an specified value.
ie:
TABLE:
Col1
1
0
I need to make a query like:
SELECT (????) FROM TABLE
and if Col1=1 returns 'Assigned' and if Col2=0 it returns 'Unassigned'
So the result from the query for the data above is:
Assigned
Unassigned
Thankx
View 3 Replies
View Related
May 28, 2008
Hello forum. I address you in order to help me for create a little sentence.
the problem is as:
I have a table "STAMPING" that save data as:
TIMESTAMP------------USER_ID-----TERMINAL_ID----CHIP_ID
19/05/1982 15:30:31 1 1 1
19/05/1982 15:31:29 1 1 1
19/05/1982 15:31:55 1 1 1
19/05/1982 16:25:46 1 1 1
19/05/1982 16:26:23 1 1 1
19/05/1982 16:26:34 1 1 1
19/05/1982 22:23:56 1 1 1
19/05/1982 22:24:23 1 1 1
and I would need to filter them as-->
TIMESTAMP------------USER_ID-----TERMINAL_ID----CHIP_ID
19/05/1982 15:30:31 1 1 1
19/05/1982 15:31:29 1 1 1
19/05/1982 15:31:55 1 1 1
19/05/1982 16:25:46 1 1 1
19/05/1982 16:26:23 1 1 1
19/05/1982 16:26:34 1 1 1
19/05/1982 22:23:56 1 1 1
19/05/1982 22:24:23 1 1 1
20/05/1982 06:10:29 1 1 1
20/05/1982 06:11:51 1 1 1
TIMESTAMP------------USER_ID-----TERMINAL_ID----CHIP_ID
19/05/1982 15:30:31 1 1 1 <<<----
less (difference) --> 00:56:03
19/05/1982 16:26:34 1 1 1 <<<----
19/05/1982 22:24:23 1 1 1 <<<----
less (difference) --> 07:45:00(+/-)
20/05/1982 06:11:51 1 1 1 <<<----
So, I need to delete the "timestamps" the an user has done, which the difference between one stamping and the following one is less than 2 minutes for the inputs for entrances and I need to remove it when the "stampings" which the difference between an one stamping and the previous one is less than 2 minutes for exits.
Can you help me please?
I will appreciate a lot your help.
View 12 Replies
View Related
Aug 26, 2015
I'm trying to execute a simple VBS file from the Executable command line in the Execute Process Task Editor.
My line is this : cscript.exe "c:convertcsvssisXlsToCsv.vbs"
SSIS keeps saying there are illegal characters here. I've Googled and looked about 20 articles and I can't resolve it.
I have a ForEach that loops through Excel files and changes them to CSV files using code i found. This script takes an original Excel file and transfers it to a new CSV file in a new directory.
So in DOS at the CMD line I would type : XlsTocsv.vbs originalfile.xls newfile.csv
I have the original file and new file in the Arguments line so I'm assuming that after the script executes it will look at the filepaths in the loop and loop through them so I want it do to this when it runs:
XlsTocsv.vbs [User::@ExcelFile] [User::@CSVFile]
I just can't get it to execute and I keep getting illegal characters.
View 5 Replies
View Related
Mar 20, 2003
CNUECOD is primary key in VTA020SAP2 table
TIA
Violation of PRIMARY KEY constraint 'PK_VTA020SAP2'. Cannot insert duplicate key in object 'VTA020SAP2'.
The statement has been terminated.
INSERT INTO VTA020SAP2 SELECT VTA020SAP1.*, NULL as xCLIPRO, NULL AS xPAIS, NULL AS xCONFREI, NULL AS xCONCPER,
NULL AS xMONEDA, NULL AS xFAX, NULL AS xTIPEXP, NULL AS xCASILLA, NULL AS xDIAENTR, NULL AS xPUNVEN,
NULL AS xCIUDAD, NULL AS xREGION, NULL AS xCONDIC, NULL AS xINSPAG, NULL AS xCUMPLE,
NULL AS xPERVIS, NULL AS ESTADO FROM dbo.VTA020SAP1
INNER JOIN VTA020
ON VTA020SAP1.CNRCLI = VTA020.CNRCLI
AND VTA020SAP1.CNRCLI IN (SELECT MAX(VTA020SAP1.CNRCLI) FROM VTA020SAP1
GROUP BY VTA020SAP1.CNUECOD)
AND (not EXISTS
(SELECT VTA020SAP2.* FROM dbo.VTA020SAP2
INNER JOIN VTA020SAP1 ON VTA020SAP1.CNUECOD = VTA020SAP2.CNUECOD
WHERE dbo.VTA020SAP2.CNUECOD = dbo.VTA020SAP1.CNUECOD))
View 14 Replies
View Related
Oct 21, 2003
If I want to change the value of a special bit in a column, how to wirte the SQL sentence in sqlserver.
I mean in a column, the value is 'test', then how to change the 's' to 'e' or any other value by just one SQL sentence.
Thanks.
View 3 Replies
View Related
Jun 23, 2004
Hello !!
I'm using the sentence NOLOCK for selects, but I have many sentences, Is there any way to set a parameter in the DBMS, to use NOLOCK parameter by default ???? I mean, I don't like to lock any table for selects.
Is It possible ???? How to do It (step by step) ?
Thanks !!
View 13 Replies
View Related
Jul 18, 2006
Set @mSQL = 'SELECT Max([AccountID] + [ItemID] + [StorehouseID] + [BINID] + [LotItemID] + Convert(varchar(10),[BalDate],111)) AS [KEY],
AccountID, ItemID, StorehouseID, BINID, LotItemID INTO [xIV_tblStockSumLastDate' + ']
FROM IV_tblIVMaster
WHERE (BalDate<= 'Exec(@mSQL + '''' + @mtxtDate + '''' + ')
GROUP BY ItemID, AccountID, StorehouseID, BINID, LotItemID')
View 13 Replies
View Related
Jul 18, 2007
Hi, all friends. I'm using SQL-SERVER 2000.I have a table like this:NIF Name----------------------------------------A-1234 Company1B-123-B1 Company2C-4568 Company4D-453-DF Company5I want delete the symbol "-" in the row "NIF". eg. A-1234 change toA1234, D-453-DF to D453DFSo how can I write the sentence . Should I use the Stored Procedure?Thank you very much!!Simon
View 2 Replies
View Related
Aug 29, 2004
i have insert/update SQL sentence, but sometimes there are empty values because there not required in the database so sometimes the sql sentence look this way:
INSERT INTO EquipmentAndPlace (EquipmentID,EquipmentEmdaNo,EquipmentPlace,EquipmentIDForRecognize, EquipmentRemarks,EquipmentLastChecked) VALUES ('3','','2','1','','12/1')
with empty values, but then it doent update in the dataBase-only if all the values appear-
what the solution of it?
Thanks
View 4 Replies
View Related
Feb 17, 2006
I have two tables. A table called users (content speaks by it self) and a table called groups.
Since i want every user to be able to be a member of several groups and, of course, a group to have several users i have made a junction table called jt.
The junction table contains userId's and groupId's according to the user-group bindings. The primary key(identity) in the junction table is a int named jtId.
Now i want to take out all posts from the junctiontable and the corrresponding userName (s) from the users-table and the corresponding groupName from the groups-table.
Can somebody please help me to make a SQL command that will di that for me. I have tried with INNER JOIN and several SELECTS in the same command.
Thanks in advance, Greetings from Esben
View 4 Replies
View Related
Nov 23, 2007
Hello,
I would like to know how can I change a "not in" clause with the same results in a SQL sentence in order to improve the performance of my SQL sentence.
I am working with SQL Server 2005
Thanks,
jmota
View 6 Replies
View Related
Feb 5, 2008
Hi,
I want to add a parameter to the following SQL-sequence. ActivityGroup is the table and I want to select the current activityGroupID in place of XXXXX. Do I need to put this in a stored procedure?
select * from ActivityGroup where cpgActivityGroupID = XXXXX and cgpRegistredFrom > getDate() and cgpRegistredTo < getDate()";
Thanks in advance!
View 5 Replies
View Related
Jun 4, 2006
Hi,
I have a project in which I have about 20,000 records in sql database table.
What I would like to do is generate a query that lists all the unique words in a particular field acros the entire table so as to generate a glossary of words.
if we had a table that looked like
ID Description
001 This is the first record
002 This is the second record
003 This is not the first record
and the query was run on the description field, then the result I would like to see is
This
is
the
first
second
not
I hope this makes sense. Any help is appreciated.
View 3 Replies
View Related
Mar 1, 2005
Hi All,
I want to give the users the ability to highlight words in sentences on the page in different colors.
Please see link below for an example(watch out for URL wrapping):
http://64.233.161.104/search?q=cache:fKHSRIxERbUJ:www.codeguru.com/columns/DotNet/article.php/c6603/+XML+serialization+in+.net&hl=en
My MASTER table that contains text is very simple:
TEXT_ID INT
TEXT varchar
I was thinking of something like creating another table to keep track of selection criteria:
USER_NAME varchar // keeps track of which user made the selection
TEXT_ID INT // points to the text id in the MASTER table
START_POS INT // start position of the selection
END_POS INT // end position of the selection
COLOR INT // color of the selection
The thing I don't like about this method, is if user(s) have many words higlighted in the sentences, this table may get very large.
I also thought of maybe combining START_POS, END_POS & COLOR into comma delimited entries:
EX: 1:5:240, 25:30:125 // START_POS:END_POS:COLOR
The thing I don't like about this method, the parsing calculations may take a while to execute.
My goal is to stream as much text data as possible and make it as fast as possible. How does Google or any one else do it?
P.S. Having a copy of a MASTER table with HTML tags in TEXT field is not an option.
Thanks,
Vlad
View 1 Replies
View Related
Jul 22, 2000
I have to parse a sentence into separate words. This has to be done in a Stored Proc.
If the sentence is: "The sun is rising". Then I want to store the words "The" "sun" "is" "rising" into 4 separate variables. (The separator is a space).
Has someone already written something like this before? I do not want to re-invent the wheel.
Thankx.
KP
View 1 Replies
View Related
Jul 16, 2014
CREATE TABLE [dbo].[instructions](
[site_no] [int] NOT NULL,
[instructions] [text] NULL
)
Select top 3 * from instructions
Output
Site_no Instructions
20 Request PIN#510 then proceed
21 Request PIN#987 if wrong request name
22 Request PIN#688 allowed to use only numbers
All text instructions start with “Request PIN#XXX” also after that the text are different for every site_no
I need insert in all site_no rows and after the “Request PIN#XXX” the text “and codeword” keeping the current rest of text
How can I set e REPLACE CAST sentence using something LIKE PIN%%%%
To get these type of results
site_no instructions
----------- ----------------------------------------------------
20 Request PIN#510 and codeword then proceed
21 Request PIN#987 and codeword if wrong request name
22 Request PIN#688 and codeword allowed to use only numbers
View 4 Replies
View Related
Apr 28, 2006
the talbe row like this:
ID Name Scoe 11 Tome 20 12 Jack 30 11 Tome 40 12 Jack 10 13 John 10
My query command like this:
Select T1.Id,T1.Name,T2.mathfrom st T1right join(Select Id as Id2,Sum(Math) as Math from St group by id) T2on T1.id=t2.id2where t1.id = t2.id2
While the reuslt is :
Id Name Score
11 Tom 60
11 Tom 60
12 Jake 40
12 Jack 40
13 John 10
I am wonder :the T1 gives a table with six rows, the T2 gives a table with three rows, and I use RIGHT JOIN to connect the two table,the result should be a table with only three rows.I tried INNER JOIN, the result is same.
but why ? please help me !
View 1 Replies
View Related
Sep 8, 2014
Is it possible to pass entire where sentence to a store procedure?From app, I'll generate a where sentence like below:
where orderID = '123' and orderCidy='London'
I created a store procedure like below but got an error said that An expression of non-boolean type specified in a context where a condition is expected, near 'END'
CREATE PROCEDURE getorder
@mywhere VARCHAR(100)
AS
BEGIN
SET NOCOUNT ON;
select * from order @mywhere
END
View 8 Replies
View Related
Jul 20, 2005
Hi everyone!I am working with Delphi v7 and MS SQLServer.I am trying to insert data in a table with a SQL sentence. Some of thefields of my table are type char or varchar, and they can have nullvalues.What do i have to write in the SQL sentence to insert a null value inthose fields?I tried with '', an empty String, but it doesnt work, the tablesstores an empty String (logical :-)).In the SQLServer GUI you have to press CTRL + 0 to insert a NULLvalue, but how can i tell this to the SQLServer through a SQLSentence?Well, thank you very much.
View 2 Replies
View Related