Friday, March 30, 2012
Install QA only ?
user to run query by themselves, is it necessary for us to
install "Client Connectivity" on that machine as well?
Thanks
This is a duplicate post. It's been answered in another area.
"Paul" <anonymous@.discussions.microsoft.com> wrote in message
news:01d601c528e5$f105d400$a401280a@.phx.gbl...
> If we want someone to use Query Analyzer only - allow end
> user to run query by themselves, is it necessary for us to
> install "Client Connectivity" on that machine as well?
> Thanks
>
|||Dear Paul,
You suggest to remove the userid from Public database role
as follow:
+++++++++++++++++++++++
If you remove the public role permissions to what it
should have (ZERO), and limit the access users have in the
databases, they won't be able to do anymore with EM than
QA.
+++++++++++++++++++++++
However, from the newsgroup, a lot of people suggest that
we should not remove any user from the Public Role. Is it
OK for me to do so ?
Besides, the user belongs to the db_datareader role only,
is there still any problem ?
Since we are not using Reporting Service, is there any
other way to meet the need ?
Thanks
>--Original Message--
>This is a duplicate post. It's been answered in another
area.
>"Paul" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:01d601c528e5$f105d400$a401280a@.phx.gbl...
end[vbcol=seagreen]
to
>
>.
>
Install QA only ?
user to run query by themselves, is it necessary for us to
install "Client Connectivity" on that machine as well?
ThanksThis is a duplicate post. It's been answered in another area.
"Paul" <anonymous@.discussions.microsoft.com> wrote in message
news:01d601c528e5$f105d400$a401280a@.phx.gbl...
> If we want someone to use Query Analyzer only - allow end
> user to run query by themselves, is it necessary for us to
> install "Client Connectivity" on that machine as well?
> Thanks
>|||Dear Paul,
You suggest to remove the userid from Public database role
as follow:
+++++++++++++++++++++++
If you remove the public role permissions to what it
should have (ZERO), and limit the access users have in the
databases, they won't be able to do anymore with EM than
QA.
+++++++++++++++++++++++
However, from the newsgroup, a lot of people suggest that
we should not remove any user from the Public Role. Is it
OK for me to do so ?
Besides, the user belongs to the db_datareader role only,
is there still any problem ?
Since we are not using Reporting Service, is there any
other way to meet the need ?
Thanks
>--Original Message--
>This is a duplicate post. It's been answered in another
area.
>"Paul" <anonymous@.discussions.microsoft.com> wrote in
message
>news:01d601c528e5$f105d400$a401280a@.phx.gbl...
end[vbcol=seagreen]
to[vbcol=seagreen]
>
>.
>
Install QA only ?
user to run query by themselves, is it necessary for us to
install "Client Connectivity" on that machine as well?
ThanksThis is a duplicate post. It's been answered in another area.
"Paul" <anonymous@.discussions.microsoft.com> wrote in message
news:01d601c528e5$f105d400$a401280a@.phx.gbl...
> If we want someone to use Query Analyzer only - allow end
> user to run query by themselves, is it necessary for us to
> install "Client Connectivity" on that machine as well?
> Thanks
>|||Dear Paul,
You suggest to remove the userid from Public database role
as follow:
+++++++++++++++++++++++
If you remove the public role permissions to what it
should have (ZERO), and limit the access users have in the
databases, they won't be able to do anymore with EM than
QA.
+++++++++++++++++++++++
However, from the newsgroup, a lot of people suggest that
we should not remove any user from the Public Role. Is it
OK for me to do so ?
Besides, the user belongs to the db_datareader role only,
is there still any problem ?
Since we are not using Reporting Service, is there any
other way to meet the need ?
Thanks
>--Original Message--
>This is a duplicate post. It's been answered in another
area.
>"Paul" <anonymous@.discussions.microsoft.com> wrote in
message
>news:01d601c528e5$f105d400$a401280a@.phx.gbl...
>> If we want someone to use Query Analyzer only - allow
end
>> user to run query by themselves, is it necessary for us
to
>> install "Client Connectivity" on that machine as well?
>> Thanks
>
>.
>sql
Monday, March 12, 2012
InSQL 7.1 - count how many times a tag equals 1 over a specified time period query....
Thanks
Gary
Would you please provide some sample data and an example of expected results?
|||SELECT at.TagName,'month'=month(datetime),
'YEAR'=YEAR(DATETIME),
TAGVALUE =1,
FREQ = COUNT(*)
FROM AnalogTag at, v_AnalogHistory ah
WHERE DateTime >= "2007/07/01 00:00"
AND DateTime <= "2007/07/31 00:00"
AND ah.TagName in ('PV249_STEP_NO')
AND ah.Value = 1
AND ah.TagName = at.TagName
AND wwRetrievalMode = 'DELTA'
GROUP BY at.TagName, month(DATETIME), YEAR(DATETIME)
I think I did it, using the above. I need to test a little more.
the value of the tag increments from 1 to 64, my purpose is to count the cycles of the tag.
Thanks
Gary|||
It looks like you have it correct for TagValue = 1; if you are looking to get it for all 64 different values of the tag, it would be something like:
Code Snippet
SELECT at.TagName,
'month'=month(datetime),
'YEAR'=YEAR(DATETIME),
-- TAGVALUE =1,
ah.value as TAGVALUE,
FREQ = COUNT(*)
FROM AnalogTag at, v_AnalogHistory ah
WHERE DateTime >= "2007/07/01 00:00"
AND DateTime <= "2007/07/31 00:00"
AND ah.TagName in ('PV249_STEP_NO')
-- AND ah.Value = 1
AND ah.TagName = at.TagName
AND wwRetrievalMode = 'DELTA'
GROUP BY at.TagName, ah.value, month(DATETIME), YEAR(DATETIME)
Friday, March 9, 2012
Inserts taking longer time
I have SQL Server 2005 installed on my machine and I am firing following query to insert 1500 records into a simple table having just on column.
Declare @.i int
Set @.i=0
While (@.i<1500)
Begin
Insert into test2 values (@.i)
Set @.i=@.i+1
End
Here goes the table definition,
CREATE TABLE [dbo].[test2](
[int] NULL
) ON [PRIMARY]
Now the problem with this is that on one of my server this query is taking just 500ms to run while on my production and other test server this query is taking more than 25 seconds.
Same is the problem with updates. I have checked the configurations of both the servers and found them to be the same. Also there are no indexes defined on either of the tables. I was wondering what can be the possible reason for this to happen. If any of u people has any pointers regarding this, will be really useful
Thanks in advance,
Mitesh
Although this can′t be the possible cause, which recovery models are you using on the databases ?
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Hey Jens,
Thanks for the pointer but we are using the Full Recovery model on both of my database. I think there is some problem with the server configuration as I have tried this Insert on multiple databases of my server (where the time taken is more) and have got the same output
|||
You machine is probably caching disk writes so the commits are not actually hardening.Servers are usually configured not to do that so your data is not at risk.
You should wrap your loop with a BEGIN TRAN and COMMIT TRAN.
Declare @.i int
Set @.i=0
Begin Tran
While (@.i<1500)
Begin
Insert into test2 values (@.i)
Set @.i=@.i+1
End
Commit Tran
Hi Mitesh,
I am having a very similar problem:
* I have a crappy testing machine (P3 at 0.5 GHz on Windows NT Server) with SQL 7,
* I have a testing environment running on a Virtual Machine on a pretty descent laptop (Laptop = Celeron @. 1.59 GHz on Windows XP - sorry, low budget -). The Virtual Machine runs Windows 2003 with SQL 2005 Express, with 400 MBytes assigned in RAM.
* The database I work with is created running an SQL script. It has about 15 tables, and as a whole is a quite normalized database.
* I have this application that I did, that updates the database through ODBC.
Now here is the interesting data:
* On my SQL 7, it takes between 2 to 3 seconds to update the database (we are talking about 50 to 100 insert statements) the first time I click on the "save" button. After that is just a matter of a little bit less than a second to update the database every time I click on the "save" button.
* However, on my SQL 2005 environment, it takes about 1 minute. The amount of time does not change much the next time I click "save".
Notes aside:
* Both are empty databases. They only have the table structure.
* The tables are quite normalized. It is ok, it is not a database that it is intended to grow beyond 100 Mbytes.
* "De-normalization" is not an option.
* I changed the size of the database log file from 1 Mbyte to 20 to see if my problem were excesive "check points"... but the behaviour was just the same.
I learned to live with it, after all, Windows XP does not support VM's. In fact, I was rather impressed by the Celeron chip.
But the fact that caught my attention is that, after time went by and I continued using my Virtual Machine, the time got reduced as my database grew up in size. After about 100 "save" operations, It now takes around 10 seconds to save. This suggests me that there is something going on with the indexes...
It is ok, after all, it is just a testing environment.
Hope it helps!!!
Tark Ik
PS: This posting has been posted "AS IS"
|||Hey Peter,Thanks a Ton for your reply. There would have been no way in the world through which i could have figured this out

Wednesday, March 7, 2012
inserting xml data
Is there any way to insert the output of xml_auto into a table
for eg:
select * from categories for xml auto
i need the output of the abouve query to be inserted into another table
the destination table has one column,thomson (saintthomson@.yahoo.com) writes:
> Is there any way to insert the output of xml_auto into a table
> for eg:
> select * from categories for xml auto
> i need the output of the abouve query to be inserted into another table
> the destination table has one column,
I think the only way you can do this in SQL 2000 is to use OPENQUERY:
INSERT tbl (col)
SELECT * FROM OPENQUERY (LOOPBACK,
'SELECT * FROM categories FROM XML AUTO')
Here LOOPBACK is a linked server back to your own, and here is a real
funny thing: you must set it up to use MSDASQL, that is the OLE DB over
ODBC provider! If you use SQLOLEDB which is the recommended provider,
you will get binary data back.
But when I did a quick test, the result was not entirely acceptable, since
the XML string was split up over six rows.
In the next version of SQL Server, SQL 2005, currency in beta, there
are significant enhancements in XML support, including a specific xml
datatype, and you can do this easily.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||xmlbulkload no good?
Friday, February 24, 2012
Inserting Text
Could someone help me, please?
How do I insert text, something like a header, before the result of the query presents itself?
I want the text to appear before the result. Not like an alias, that I know how to do.
Thanks.
SELECT 'This is my Header Message'
SELECT colList FROM MyTable
OR
SELECT
'This is My Header Message',
Col1,
Col2,
etc
FROM MyTable
Inserting Specific Value in Query Result
USERNAME. Seems pretty simple to me, however I am a novice writing SQL
statements.
My knowledge is very limited, so when responding please do not assume I
know basic code.
I have taken on this task in an emergency situation.
Thanks in advance for your help and please let me know if further
information is needed.DK13 (DericK@.sklarcorp.com) writes:
> I have a table where I need to insert a unique USERID based on the
> USERNAME. Seems pretty simple to me, however I am a novice writing SQL
> statements.
> My knowledge is very limited, so when responding please do not assume I
> know basic code.
> I have taken on this task in an emergency situation.
If it's an emergencty I am puzzled by the fact that you did not provide
more information. The standard recommendation for assistance is that
you post:
o CREATE TABLE statement(s) for the tables involved.
o INSERT statements with sample data.
o The desired result given the sample.
This permits anyone who wants to answer your question to easily
copy-and-paste into a query and developer a tested solution.
I realise that you if don't know basic code, this may go over your
head. But you should at least be able to produce some sample input,
and the output from it. "A unique USERID based on the USERNAME" is
quite ambiguous. And supposedly there is a requirement that these
user id follows some pattern. It would also be interesting to know
how these usernames look like. Furthermore, it is also unclear whether
you want the userid added to the query result, or a column added
to the table. (Your subject lines says the former, but the latter
makes more sense.)
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||OK, let's see if this helps.
The query I ran:
select* from sysdba.HISTORY where USERNAME = ('Cruz, Jane')
The result set looks like this(I've left out several columns):
USERID USERNAME ORIGINALDATE
<NULL> Cruz, Jane 2/6/2006 12:00:05 AM
<NULL> Cruz, Jane 2/6/2006 11:25:00 PM
Now from this result I would like to Insert a userid, such as
'U6UJ9A00003J' where the USERID above = "<NULL>". I have several users
that I need to do this for.
Let me know if this is more useful info|||DK13 (DericK@.sklarcorp.com) writes:
> OK, let's see if this helps.
> The query I ran:
> select* from sysdba.HISTORY where USERNAME = ('Cruz, Jane')
> The result set looks like this(I've left out several columns):
> USERID USERNAME ORIGINALDATE
><NULL> Cruz, Jane 2/6/2006 12:00:05 AM
><NULL> Cruz, Jane 2/6/2006 11:25:00 PM
> Now from this result I would like to Insert a userid, such as
> 'U6UJ9A00003J' where the USERID above = "<NULL>". I have several users
> that I need to do this for.
> Let me know if this is more useful info
You could do:
UPDATE tbl
SET USERID = dbo.createuseridfromname(USERNAME)
WHERE USERID IS NULL
All that remains is to write the user-defined function. Unfortunately,
I cannot do that, because I don't know the rules.
Or are the user ids in fact already defined in a table somewhere?
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thank you, I did some other research and found the same function to be
helpful, much appreciated!!
Inserting Serial No Column in result of a query
Hello Friends
My problem is
Suppose Query is - Select * from tbl_Employee
TBL_EMPLOYEE HAS ONLY TWO COLUMNS NAME,POST
I need that an extra column get inserted in result through query showing serial Number with each row.So that query result look like this.
Serial Name Post
1 XYZ QER
2 SDF OPO
3 WER IPO
If any body knows please post the solution its urgent.
Where is the serial number supposed to come from?Jason
|||http://www.aspfaq.com/show.asp?id=2427
|||
Serial Number is supposed to be generated through query only.
|||Using the #temp table option described in the article will achieve that for you.
CREATE TABLE
#temp
(
Rank INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
firstName VARCHAR(50),
lastName VARCHAR(50)
)
INSERT INTO
#temp
(
firstName,
lastName
)
SELECT
firstName,
lastName
FROM
people
ORDER BY
lastName,
firstName
SELECT
*
FROM
#temp
ORDER BY
Rank
DROP TABLE #temp
|||I take it no one bothered reading the link I posted..?
![Confused [8-)]](http://pics.10026.com/?src=/emoticons/emotion-43.gif)
|||Yes I did. I just recommended the #temp table approach in it. Thething I didn't like about the way it was done in the article, however,is that it does not create the #temp table first. For performancereasons any #temp table should be explicitly created, not created by aSELECT INTO.
|||What performance reasons?
That may have been true in previous versions of SQL Server (some lockswere placed on tempdb during temp table creation), but it's not anissue in SQL Server 2000.
|||There are a few reasons to my understanding:
the SELECT INTO method will always require a stored procedure recompilation; the explicit CREATE TABLE will not necessarily
|||Regarding recompilation, I don't think SELECT INTO necessarily causes it. I see no difference in behavior between thefollowing three sprocs, monitoring the SQL Compilations/sec and SQLRe-Compilations/sec counters and tracing the SP:Recompile event (on anotherwise dead server):
create proc xxx
as
select 1 as somecol
into #blah
GO
create proc yyy
as
create table #blah(somecol int)
insert #blah values (1)
GO
create proc zzz
as
declare @.blah table(somecol int)
insert @.blah values (1)
GO
I ran each of these numerous times and saw no recompiles with any ofthem. I'm not aware of whether or not SELECT INTO is more likelyto recompile in certain cases, but merely using the syntax does notcause re-compilation.
|||Yes, I meant log shipping. And since my use of SELECT INTO oncecaused our DBA to have to work through the night I have stayed far awayfrom it. The recovery model on the database might very well havechanged since then.
Thanks for your insight. Hopefully the original poster now has what they need. :-)
Inserting row and scope_identity()
SET NoCount ON
INSERT INTO ...
VALUES ...
SELECT scope_identity()
SET NoCount OFF
, can I trust that the id I get back is for the row that I just inserted, or
can it be incorrect because of other "simultaneous" inserts? I need it for
an ASP page.
Thanks,
Marcus[posted and mailed, vnligen svara i nys]
Marcus (lumbus@.ludd.luth.se) writes:
> With a query such as,
> SET NoCount ON
> INSERT INTO ...
> VALUES ...
> SELECT scope_identity()
> SET NoCount OFF
> , can I trust that the id I get back is for the row that I just
> inserted, or can it be incorrect because of other "simultaneous"
> inserts? I need it for an ASP page.
800 grader, du kan lita p mej, du kan lita p mej.
Yes, you can trust it. scope_identity is local to your process - in
fact local to the scope (procedure, batch etc) you are in.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Tack s mycket - Thank you. ;)
Marcus
"Erland Sommarskog" <sommar@.algonet.se> wrote in message
news:Xns94DC29958E0AYazorman@.127.0.0.1...
> [posted and mailed, vnligen svara i nys]
> Marcus (lumbus@.ludd.luth.se) writes:
> > With a query such as,
> > SET NoCount ON
> > INSERT INTO ...
> > VALUES ...
> > SELECT scope_identity()
> > SET NoCount OFF
> > , can I trust that the id I get back is for the row that I just
> > inserted, or can it be incorrect because of other "simultaneous"
> > inserts? I need it for an ASP page.
> 800 grader, du kan lita p mej, du kan lita p mej.
> Yes, you can trust it. scope_identity is local to your process - in
> fact local to the scope (procedure, batch etc) you are in.
> --
> Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||Tack s mycket - Thank you. ;)
Marcus
"Erland Sommarskog" <sommar@.algonet.se> wrote in message
news:Xns94DC29958E0AYazorman@.127.0.0.1...
> [posted and mailed, vnligen svara i nys]
> Marcus (lumbus@.ludd.luth.se) writes:
> > With a query such as,
> > SET NoCount ON
> > INSERT INTO ...
> > VALUES ...
> > SELECT scope_identity()
> > SET NoCount OFF
> > , can I trust that the id I get back is for the row that I just
> > inserted, or can it be incorrect because of other "simultaneous"
> > inserts? I need it for an ASP page.
> 800 grader, du kan lita p mej, du kan lita p mej.
> Yes, you can trust it. scope_identity is local to your process - in
> fact local to the scope (procedure, batch etc) you are in.
> --
> Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp
Inserting row and scope_identity()
SET NoCount ON
INSERT INTO ...
VALUES ...
SELECT scope_identity()
SET NoCount OFF
, can I trust that the id I get back is for the row that I just inserted, or
can it be incorrect because of other "simultaneous" inserts? I need it for
an ASP page.
Thanks,
Marcus[posted and mailed, vnligen svara i nys]
Marcus (lumbus@.ludd.luth.se) writes:
> With a query such as,
> SET NoCount ON
> INSERT INTO ...
> VALUES ...
> SELECT scope_identity()
> SET NoCount OFF
> , can I trust that the id I get back is for the row that I just
> inserted, or can it be incorrect because of other "simultaneous"
> inserts? I need it for an ASP page.
800 grader, du kan lita p mej, du kan lita p mej.
Yes, you can trust it. scope_identity is local to your process - in
fact local to the scope (procedure, batch etc) you are in.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Sunday, February 19, 2012
Inserting records
I am trying to do a simple insert of records that are "new" to the source
table with the following query, but I'm not getting the expected results.
There should only be 5 new records inserted into the table yet I get 59
INSERT INTO dbo.WorkOrderMailCellXRef
SELECT DISTINCT a.emMailType,woMailTypeTemplate = Null,a.emSapieoTemplateID
FROM WorkOrderEmailsSentARchive a, WorkOrderMailCellXRef b
WHERE
( a.emMailType <> b.woMailTypeArchive
and a.emSapieoTemplateID <> b.wotemplateid)
Thank you in advance!"Patrice" <Patrice@.discussions.microsoft.com> wrote in message
news:DBC88ECA-0F28-40EB-9DF0-72A12C5AD87A@.microsoft.com...
> Hello,
> I am trying to do a simple insert of records that are "new" to the source
> table with the following query, but I'm not getting the expected results.
> There should only be 5 new records inserted into the table yet I get 59
>
> INSERT INTO dbo.WorkOrderMailCellXRef
> SELECT DISTINCT a.emMailType,woMailTypeTemplate =
> Null,a.emSapieoTemplateID
> FROM WorkOrderEmailsSentARchive a, WorkOrderMailCellXRef b
> WHERE
> ( a.emMailType <> b.woMailTypeArchive
> and a.emSapieoTemplateID <> b.wotemplateid)
Not sure exactly what you're doing, but maybe an example of using <> as the
join condition in the WHERE clause will help. We'll populate 2 tables with
4 rows of two colors each, then run an INNER JOIN using <> like you did
above. Even though there are only 8 total rows in both tables, the results
is 11 rows because of the <> :
CREATE TABLE #a (color1 VARCHAR(16),
color2 VARCHAR(16))
CREATE TABLE #b (color1 VARCHAR(16),
color2 VARCHAR(16))
INSERT INTO #a (color1, color2)
SELECT 'blue', 'red'
UNION SELECT 'blue', 'green'
UNION SELECT 'black', 'yellow'
UNION SELECT 'blue', 'blue'
INSERT INTO #b (color1, color2)
SELECT 'blue', 'green'
UNION SELECT 'red', 'white'
UNION SELECT 'yellow', 'purple'
UNION SELECT 'black', 'blue'
SELECT DISTINCT a.color1, a.color2, b.color1, b.color2
FROM #a a, #b b
WHERE (a.color1 <> b.color1
AND a.color2 <> b.color2)
DROP TABLE #a
DROP TABLE #b
If you can describe what you're doing with DDL, sample data, and expected
result it would be helpful.|||Maybe you meant to do something like this?
INSERT INTO dbo.WorkOrderMailCellXRef
SELECT DISTINCT a.emMailType,woMailTypeTemplate = Null,a.emSapieoTemplateID
FROM WorkOrderEmailsSentARchive a
WHERE not exists
(
select 1 from WorkOrderMailCellXRef b
where a.emMailType = b.woMailTypeArchive
and a.emSapieoTemplateID = b.wotemplateid
)
"Patrice" <Patrice@.discussions.microsoft.com> wrote in message
news:DBC88ECA-0F28-40EB-9DF0-72A12C5AD87A@.microsoft.com...
> Hello,
> I am trying to do a simple insert of records that are "new" to the source
> table with the following query, but I'm not getting the expected results.
> There should only be 5 new records inserted into the table yet I get 59
>
> INSERT INTO dbo.WorkOrderMailCellXRef
> SELECT DISTINCT a.emMailType,woMailTypeTemplate =
Null,a.emSapieoTemplateID
> FROM WorkOrderEmailsSentARchive a, WorkOrderMailCellXRef b
> WHERE
> ( a.emMailType <> b.woMailTypeArchive
> and a.emSapieoTemplateID <> b.wotemplateid)
>
> Thank you in advance!
>
inserting one query before another
new item(pk) into a table in one query, and then inserting an item(fk)
in another table that relates to the other item just created in the
first. The problem is that in order for the second query to work, the
first has to exist in the first table before it will work. Is there a
way of running the first query first and then the next. Here is what I
have:
<cfquery name="q_insert" datasource="#dsn#">
INSERT INTO eccn
(eccn_num,
eccn_brief_descrip,
eccn_full_descrip,
eccn_reason_controlled)
VALUES('1D001',
'TEST',
'TEST INPUT AND SEARCH',
'TESTING THE INPUT AND SEARCH PERFORMANCE')
</cfquery>
<cfquery name="q_insert2" datasource="#dsn#">
INSERT INTO eccN_interrelationship
(eccn_num,
related_eccn_num)
VALUES('1D001',
'1B001')
</cfqueryYou can run both at once.