|
Hi,
I'm appending data to a table with the INSERT INTO command. I am also operating on the same table with recordset commands .MoveFirst and .Find
What I am noticing is that my INSERT commands are not immediately recognized until I close the table...
Is there a way to make my INSERT commands stick right away?
I'm working in VBA/Access through a user form and two tables that support it. I'm probably talking above the specifics, but this is what appears to be happening in my problem.
Thanks,
Johnny
|
|
|
|
|
addendum:
I am doing the INSERT INTO tbl_Defects followed by the .MoveFirst and .Find commands (in that order.)
What seems to be failing is the .Find (the INSERT INTO didn't refresh the table???)
Thanks.
|
|
|
|
|
john john mackey wrote: What seems to be failing is the .Find (the INSERT INTO didn't refresh the table???)
What is probably not refreshed is the recordset...
|
|
|
|
|
I have a column called AUDIT_EVENT_DATE that is a DATETIME stamp for when an event occurred. I'm trying to put a query together that lets me see only the records for events that occurred between 18:30 and 18:45 for the last two months.
select to_char(audit_event_date,'DD-MON-YYYY HH24:MI:SS') from transaction_audit
where trunc(audit_event_date) > to_date('01-OCT-2007','DD-MON-YYYY')
and audit_event_date between to_date('18:30:00','HH24:MI:SS') and to_date('18:45:00','HH24:MI:SS')
order by audit_event_date The above only supplies me with audit records dated on November the 1st. I think that's because of a truncation thing that is happening. Wouldn't it be nice if there was a handy function called TIME_only, and then I could do this instead
select to_char(audit_event_date,'DD-MON-YYYY HH24:MI:SS') from transaction_audit
where trunc(audit_event_date) > to_date('01-OCT-2007','DD-MON-YYYY')
and time_only(audit_event_date) between time_only(to_date('18:29:59','HH24:MI:SS')) and time_only(to_date('19:00:00','HH24:MI:SS'))
order by audit_event_date
Anybody have any ideas of how to do this? Thanks.
|
|
|
|
|
Hi Chris. How about:
to_char(audit_event_date, 'HH24:MI:SS') between '18:29:59'
and '19:00:00' Also (if I remember my Oracle SQL correctly) you can use "trunc(date) to remove the time component from datetime fields.
Regards
Andy
|
|
|
|
|
Thanks Andy. I couldn't see the forest for the trees. That worked perfect for me.
|
|
|
|
|
Hello All,
I am looking for a little assistance with a problem I am having. We have been adding new users to our database as needed without issue; the problem begins when I have to assign permissions to all of the stored procedures in a db for that user. I know the command to give the user Execute permissions but I have to do it procedure by procedure.
Isn't there a simpler way of scripting this to grant execute permissions to all of the procedures?
Any help would be greatly appreciated.
F.Fowler
|
|
|
|
|
Try:
select 'grant execute on ' + name + ' to username' from sysobjects where xtype = 'P'
order by name Then run the resulting script (substituting the names of your users).
|
|
|
|
|
Hello Andy,
I have no idea what I am doing wrong but I keep getting the error
"Msg 207, Level 16, State 1, Line 1
Invalid column name 'CTTest'."
I just entered the command you have listed as such:
select 'grant execute on ' + CTTest + ' to ACM\ttomaselli' from sysobjects where xtype = 'P' order by name"
and the error pops up. I am certain this is what I need but why does it think that CTTest is a column when it is actually the database?
F
|
|
|
|
|
you have to use name
select 'GRANT EXECUTE ON ' + name + ' TO Bob' from sysobjects where xtype = 'P' order by name
|
|
|
|
|
Got it now.
|
|
|
|
|
Thank you all for your help!
Made it easy.
F
|
|
|
|
|
hi i all i have the following two Queries, i want to know the Difference Count Between these two Queries,by combining the query and display a difference.
SELECT COUNT(DISTINCT PROPERTY_KEY) PROPERTY_KEY
FROM sde.VW_Toi_Deeds_Vuyiswa
WHERE FUNCTION_KEY like '%GEOSS%'
GO .
SELECT COUNT(*) AS [UNITS IN PRO-V]
FROM SDE.PROPERTY
WHERE FUNC_KEY LIKE 'GEOSS%' .
THANKS
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://www.Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
This should illustrate the difference.
CREATE TABLE #foo (<br />
foo_id TINYINT )<br />
<br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (1) <br />
INSERT INTO [#foo] VALUES (2) <br />
INSERT INTO [#foo] VALUES (2) <br />
INSERT INTO [#foo] VALUES (2) <br />
INSERT INTO [#foo] VALUES (2) <br />
<br />
SELECT<br />
COUNT(*)<br />
FROM<br />
[#foo]<br />
<br />
SELECT<br />
COUNT(DISTINCT [#foo].[foo_id])<br />
FROM<br />
[#foo]<br />
<br />
DROP TABLE [#foo]
|
|
|
|
|
Thanks man,
But now this two Queries, is from Two tables,
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Oh, sorry. I misunderstood your question.
This should do what you want then:
SELECT<br />
A.PROPERTY_KEY - B.[UNITS IN PRO-V]<br />
FROM<br />
(SELECT<br />
COUNT(DISTINCT PROPERTY_KEY) PROPERTY_KEY<br />
FROM<br />
sde.VW_Toi_Deeds_Vuyiswa<br />
WHERE<br />
FUNCTION_KEY like '%GEOSS%') A,<br />
(SELECT<br />
COUNT(*) AS [UNITS IN PRO-V]<br />
FROM<br />
SDE.PROPERTY<br />
WHERE<br />
FUNC_KEY LIKE 'GEOSS%') B
|
|
|
|
|
Thanks man it worked Perfectly
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi Leppyr64
i have to Display records not Count, how do i archive this. in the Above Query that you gave me.
SELECT
A.PROPERTY_KEY - B.[UNITS IN PRO-V]
FROM
(SELECT
COUNT(DISTINCT PROPERTY_KEY) PROPERTY_KEY
FROM
sde.VW_Toi_Deeds_Vuyiswa
WHERE
FUNCTION_KEY like '%GEOSS%') A,
(SELECT
COUNT(*) AS [UNITS IN PRO-V]
FROM
SDE.PROPERTY
WHERE
FUNC_KEY LIKE 'GEOSS%') B
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I don't understand what you want.
You asked for the difference between two queries that returned a number.
A - B = C
If what I gave you is not what you want then I need an example. I'm done guessing.
Please post DDL, Example Data, and Expected results.
|
|
|
|
|
Am Sorry,
Thanks.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I am getting error while fetching the data from sybase to SQL
TDS buffer length too large- oledb driver
Thanks & Regards
Avinash Mhase
Application Development
ZENTA
|
|
|
|
|
Hi,
The actual size of my database isn't enought, autogrow is activate and I can change the parameters but I want to increase from 6Go to 50Go. Do you know if there is a command or a procedure to resize the size of the database without to recreate a database.
Best regards
-- modified at 9:05 Tuesday 20th November, 2007
|
|
|
|
|
Using enterprise manager you can change the database file grow size or use ALTER DATABASE command.
see SQL Server 2005 BOL.
|
|
|
|
|
Hi:
I Mujahid Hussain Awan,I am a software Developer,I have a problem in Crystal Report.First I was working in
Visual Studio 2003(C#).I built many crystal reports using DataSet method,and the Procedure was so simple.First I add
Dataset and then add new element and give all it's attributes,and Datatype of all these attribute.then In Frontend at C#
I add new crystal report then I select Blank Report,then I open Field xplorer Window right Click on Database Fields
then I select Database Expert,a Database window Express Opens then I select Project Data and then I select ADO.net
DataSet a Dataset with the same I created above apears,then I open it and Drag & Drop each Fields in Crystal Report's
Detail Section.and then I Open a Form I initialize Dataset and Crystal report and write quer in Adapter then I Fill
DataSet and set DataSorce Property of Report Object.and set ReportSource property of Crystal report Viewer and run
Project and Record displays in Crystal Report. This is the Procedure of Crystal Report in Visual Studio 2003.
But When I do all these in Visual Studio with same Procedure but no Record Displays in Crystal Report.Can any body
Help me How can I do all this in Visual Studio 2005.
Mujahid Awan
|
|
|
|
|
so far i studied @@error and @@fetch_status , i know their utility.
But i don;t know what's the basic difference between @ and @@ parameters?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|