|
|
what do u think abt triggers.HUH!u can write triggers that will execute it on 1st of every month.
get back to me
|
|
|
|
|
Triggers cannot be scheduled. Triggers get fired only when you delete, update or insert data on a table with triggers.
|
|
|
|
|
hi friends,
Is there is any major core difference between FOR and UPDATE trigger, or just the name change due to versions SQL 7 & SQL 2000.Plese reply.
|
|
|
|
|
No in dont differ too much they r almost same
|
|
|
|
|
You CREATE TRIGGER [TRIGGER NAME] ON [dbo].[AddressMenuItems]
FOR INSERT, UPDATE, DELETE [choose one of those].
AS ...
That's the syntax, and it is prompted by the SQL Server when you create a new trigger.
There is no such thing as "Trigger FOR" without either INSERT / UPDATE or DELETE.
I hope that helps.
Best
Bigfootguy
|
|
|
|
|
I am using OSQL to generate a text file. The query used to fetch records for the text file returns a variable length record. The text file generated contains extra spaces at the end of the record. The total length of the record including spaces is equal to the databse table field length. Executing the query in Query Analyzer does not give any extra space.
Is there any way where I get the record without any extra space in the text file?
|
|
|
|
|
Daredeviljpr wrote:
The total length of the record including spaces is equal to the databse table field length
Check the datatype of your column.
If you use char or nchar, your text will be padded with extra space.
If for some reason you can't change the column's data type, just trim the extra space at the end.
HTH.
Ed
|
|
|
|
|
I am using varchar as the datatype. I also tried using ltrim, rtrim but of no use. when we run the query in Query Analyzer no spaces are shown but when the text file is generated spaces are padded to the right. I am concatenating the field values to make one column and then generate a text file.
Is there any way to remove those extra spaces...
|
|
|
|
|
hi
plz tell me how can i create a copy of existing database using SQLDMO in VB.net at run time.
plz help me. looking forward ur reply.
thankx
|
|
|
|
|
|
I'm not an SQL Server expert and I need some advice, please! My client has a database here in the USA and wants to give his office in asia access to it. They are using SQL server in the USA. The application they are using is written in VC++ and uses ODBC. The app can be modified to use ADO, OLE DB, or any other appropriate db access mechanism that will get the job done. The offices have a high speed network connection between them. All of the computers that use this application are MS Windows machines.
How do I do this? Is it the same as setting up a network DSN?
Thanks in advance.
Chuck
|
|
|
|
|
Hey Chuck we had the same issue at my company. What I decided to to is create a MIP(Mapped IP) from the firewall side. So you route that IP address to your sql server and allow port 1433 to that port.
So what you do from your sql server is register MIP 192.xxx.xxx.xxx and that should connect you to the SQL Server.
This should not be diffucult all you need is acccess to your firewall.
Hope this sheds some light on your issue
|
|
|
|
|
Hi,
if I shutdown my program (MFC Dialog) I get an unhandled exception (MTXOCI.dll): Access Violation. The only thing I do is creating an instance of
Connection (_ConnectionPtr) and then call Open to database. Connection string looks like: "Provider=MSDAORA;Data Source=mySource;User Id=myuser;Password=myPwd;".
the Open is ok an any other call to db works, but I don't find why it crashes on shutdown.
Someone know why? pls help me...
thx & greets
|
|
|
|
|
Hi all,
I have stored files in SQL Server Database using text field.
Now I want to send those files as an attachment with email. I dont want to store files temporarly on local disk. So how can i do this??
Thanks
Regards,
Nilesh
Nilesh Gambhava,
Life is NP-Complete so don't use Algorithm but use Heuristics
|
|
|
|
|
Guys,
We've got a problem.
There is a DTS package which polls for a file and puts it into a ..\Processing directory.
It is written as an ActiveX Script.
It refuses to run as a scheduled job.
However, if you execute it, it runs perfect.
There are no other jobs running that would interfere with this one.
Indeed, no other jobs running even close to that time at all.
To add to this: when you look in the job history, it always shows that the job failed - even when you manually run it and it is in fact succesful.
We have tried to delete the DTS and the job and re-create them from scratch.
However, the same problem persist.
We would not like to re-create the DTS package and the job under a different name (that worked before for other problem, BUT: it would break the standards, as over 100 clients have that DTS installed and scheduled, and it works fine with them!)
Is that a Microsoft bug or something?
It looks like somewhere it has recorded that this package name does not work!
Any help is appreciated.
Best
Bigfootguy
|
|
|
|
|
OK now.
The error was in Scheduling a Job: the Step should have been of type Operating System Command (CmdExec), NOT Transact SQL Script (TSQL), as the DTS package itself is ActiveX VB Script.
The problem has been resolved.
Best
Bigfootguy
|
|
|
|
|
As we select data from multiple tables using SELECT Query. Is it possible to insert records into multiple tables simultaneously using one INSERT Query.
In case of Multiple Clients on Client/Server Application, Is it certain that a child record in Child Table will never miss a correct reference to its parent record id in case of following quries:
"INSERT INTO MasterTable ("& ParID.Text & "," & SecondRecord.Text & ")"
'Certainity of Execution of another query as above from any other client
"INSERT INTO ChildTable (" & ChID.Text & "," & ParID.Text & "," OtherRecord.Text & ")"
If ParID.Text is acquired by "SELECT Max(ID) FROM MasterTable"
Is there any way to execute both quries cerrtainly after one another or combine quries?
Shoaib Nawaz
-- modified at 17:40 Monday 26th September, 2005
|
|
|
|
|
If I understand your question correctly, this situation can be handled by a insert trigger. You can easily do cascaded inserts.
|
|
|
|
|
shoaibnawaz wrote:
Is there any way to execute both quries cerrtainly after one another or combine quries?
Wrapping the queries in a transaction would be the normal way to do it. I also recommend using a stored procedure - you can pass all the data to the Stored Procedure and it can wrap the inserts into a transaction for you.
Also, I most certainly do NOT think that the way you are creating queries (by concatenating strings together) is very wise. It presents a large gaping security hole in the side of your application that is just asking to be exploited. You should read SQL Injection Attacks and Some Tips on How to Prevent Them[^]
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
I am new in programming field.
I have to tell you that I am using currently Access DB for BackHand. Can Access support Stored Procedure.
Shoaib Nawaz
|
|
|
|
|
I've not used Access in about 6 or 7 years so I don't know if it can. I don't think so.
You can still use parameterised queries rather than inject values in to the SQL Command in Access though - that at least improves the security of your database.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Access does support Stored Procedure.
You can also use Transaction when executing your sql statements if you don't want to use Stored Procedure.
And using parameters is a must as a preliminary security precaution.
Ed
|
|
|
|
|
Pls tell me which Query can be used to see the all the tables present in a database of the SQL server i dnt find it any where any one like to help me
ankur
|
|
|
|
|
SELECT * FROM INFORMATION_SCHEMA.TABLES
but you need to perform this query once on each database.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|