How Do I Start An External Program Using TSQL

Student from norway needs help. After update on certain rows a trigger will trigg a program (using LDAP?) That fetches data and stores it in an Active Directory What should this trigger look like, it only starts another program.

Thanks
Atle Eriksen

View Replies


ADVERTISEMENT

Calling An External Program

Hi,

Is there a stored proc or a function I can call from Query Analyzer to execute another .EXE and return when it's finished?

I'd like something like
SET @RET = sp_CallEXE('c:mypathmyprogram.exe myparameters')

(Except for the name of the function, there should be something that does this right? I mean, DTS does it already so it must be referring to a function or a SP.)

I want an answer to so that I can validate that everything went well (hence the @RET variable)

Thanks,

Skip.

View Replies View Related

Xp_cmdshell - Need To Execute External Program Asynchonous

hi,

i need to start an external program (vb.net) from within a trigger. via xp_cmdshell everything works fine except that the execution of the trigger waits for the vb-program to finish.

now i tried a workaround with a "starter application" which only calls the vb.net program (asynchronous) an ends.

this works fine from a dos prompt (command prompt returns immediately and vb.net task is running). but when i call the starter app from the trigger with xp_cmdshell, the behavior is the same as before: execution does not continue until the vb.net task ends.

any other ideas that could solve my problem? submitting an agent-job is not fine for me because i need to supply parameters to the called program and maybe i need call it more than once at the same time.

thanks
thomas

View Replies View Related

How Can I Execute An Sql Query Which Is In An External Folder, From My Program??

how can i execute an sql query(which is in test.sql) which is in an external folder, from my program??

View Replies View Related

Get Password To Start A Program

I have this Visual Basic program that if you are already logged into the application, the program get the username and password automatically to run the program. If the user runs the program not logged into the application, the program prompts username and password.

I need to know the T-SQL statement that will get the username and password when the user is already logged into the application. Basically I have the username part but the password keeps coming back as NULL and will not allow program to run.

Please help.

Sharon

View Replies View Related

Uninstalled Program, Now SQL Won't Start

 

I have recently had issues opening a program.  I called their tech guy and he said that since my SQL is stopped, their program won't open.  He asked if I had uninstalled anything lately.  I had uninstalled the Kodak Easy Share within the last couple of weeks.  We use Windows XP.  I have tried opening the Service Manger and when I click the refresh or start buttons nothing happens. 
 
Please someone help me restart my SQL.
 

View Replies View Related

It Takes A Long Time To Insert The First Record Each Time When The Program Start

I am using VS2005 (VB) to develop a PPC WM5.0 Program. And I am using SQLCE 3.0. My PPC Hardware is in 400MHz.

The question is when the program try to insert the first record into sdf database after each time the program started. It takes a long time. Does anyone know why and how can I fix it?

I will load the whole database into a dataset when the program start and do all the "Insert", "Update", "Delete" in this dataset and fill it into database after each action.

        cn.Open()
        sda = New SqlCeDataAdapter(SQL, cn) 'SQL = Select * From Table
        scb = New SqlCeCommandBuilder(sda) 
        sda.Update(dataset)
        cn.Close()

I check the sda.update(), it takes about 0.08s for filling one record into database normally. But:

1. Start the PPC Program

2. Load DB into dataset

3. Create a ONE new record in dataset

4. Fill back to DB

When I take this four steps everytime, the filling time is almost 1s or even more!

Actually, 0.08s is just a normal case. Sometimes, it still takes over 1s to filling back a dataset which only inserted one record when the program is running. (Even all inserted records are exactly the same in data jsut different in the integer key)

 However, when I give up the dataset and using the following code:

            cn.Open()
            Dim cmd As New SqlCeCommand(SQL, cn) ' I have build the insert SQL before (Insert Into Table values(XXXXXXXXXXXXXXX All field)

           cmd.CommandType = CommandType.Text
            cmd.ExecuteNonQuery()
            cn.Close()
            StartTime = Environment.TickCount

 I found that it is still the same that the first inserted record takes more time, but just about 0.2s. And the normal insert time is around 0.02s. It is 4 times faster!!!

View Replies View Related

Program Icons In &&"Start Menu&&"

Hello,

I´ve made a mistake on my part. I have deleted my complete program icons for "Microsoft SQL Server" in my start menu.

Is there a simple way to just renew all the icons in my start menu without reinstalling the complete sql server.

Thank you very much for any tips.

View Replies View Related

Do Sqlexception Breaks The Functionality Of The Program? (program Flow)

why we use sql exceptions ...

what the program will do if we  caught that exception .. i need some suggestions ... i got this exception(String or binary data would be truncated.
The statement has been terminated.).. will it affect the functionality of the program...

hiow can i avoid this exception..

View Replies View Related

Can I Return A Value In A Variable From A SSIS Program Back To C# After The SSIS Program Is Run From C#?

Can I return a value in a variable from a SSIS program back to C# after the SSIS program is run from C#?

View Replies View Related

Equivalent Tsql For Sql Server 2000 Is Needed [from Sql Server 2005 Only Tsql]

Can anyone please give me the equivalent tsql for sql server 2000 for the following two queries which works fine in sql server 2005

1
-- Full Table Structure

select t.object_id, t.name as 'tablename', c.name as 'columnname', y.name as 'typename', case y.namewhen 'varchar' then convert(varchar, c.max_length)when 'decimal' then convert(varchar, c.precision) + ', ' + convert(varchar, c.scale)else ''end attrib,y.*from sys.tables t, sys.columns c, sys.types ywhere t.object_id = c.object_idand t.name not in ('sysdiagrams')and c.system_type_id = y.system_type_idand c.system_type_id = y.user_type_idorder by t.name, c.column_id


2
-- PK and Index
select t.name as 'tablename', i.name as 'indexname', c.name as 'columnname' , i.is_unique, i.is_primary_key, ic.is_descending_keyfrom sys.indexes i, sys.tables t, sys.index_columns ic, sys.columns cwhere t.object_id = i.object_idand t.object_id = ic.object_idand t.object_id = c.object_idand i.index_id = ic.index_idand c.column_id = ic.column_idand t.name not in ('sysdiagrams')order by t.name, i.index_id, ic.index_column_id

This sql is extracting some sort of the information about the structure of the sql server database[2005]
I need a sql whihc will return the same result  for sql server 2000

View Replies View Related

Error 9004 On Start. SQl Server Fails To Start

Hi

I have a SQL Server 2000 instance that has been running fine for months, but this morning it refuses to start. The event log shows error messages "Error 9004, Severity 21, State 1". I've tried starting SQL Server in minimal server mode, but this doesn't help either.

It looks to me like the master database is corrupt. Can anyone tell me if that's a fair assessment and if there is a quick recovery from this one.

Thanks

Malcolm

BTW: The error log file shows the following...

2004-06-14 10:16:24.49 server Microsoft SQL Server 2000 - 8.00.194 (Intel X86)
Aug 6 2000 00:57:48
Copyright (c) 1988-2000 Microsoft Corporation
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 3)

2004-06-14 10:16:24.50 server Copyright (C) 1988-2000 Microsoft Corporation.
2004-06-14 10:16:24.50 server All rights reserved.
2004-06-14 10:16:24.50 server Server Process ID is 2384.
2004-06-14 10:16:24.52 server Logging SQL Server messages in file 'e:mssqlMSSQLlogERRORLOG'.
2004-06-14 10:16:24.52 server Warning: -f command line flag used...minimal server configured.
2004-06-14 10:16:24.53 server SQL Server is starting at priority class 'normal'(4 CPUs detected).
2004-06-14 10:16:24.69 server SQL Server configured for fiber mode processing.
2004-06-14 10:16:24.71 server Using dynamic lock allocation. [2500] Lock Blocks, [5000] Lock Owner Blocks.
2004-06-14 10:16:24.80 server MS DTC initialization skipped because of start up option.
2004-06-14 10:16:24.80 spid3 Warning ******************
2004-06-14 10:16:24.82 spid3 SQL Server started in single user mode. Updates allowed to system catalogs.
2004-06-14 10:16:24.83 spid3 Starting up database 'master'.
2004-06-14 10:16:24.85 spid3 Error: 9004, Severity: 21, State: 1.
2004-06-14 10:16:24.86 spid3 06/14/04 10:16:24 Stack Overflow Dump not possible - Exception c00000fd E at 0x00444B1F
2004-06-14 10:16:24.86 spid3 Address=444b1f Exception Code = c00000fd
2004-06-14 10:16:24.88 spid3 eax=00000000 ebx=00000000

View Replies View Related

Cant Start SQL Server Using Minimal Start/config

We are trying to start SQL Server using SQLSERVR -f - c but the start up fails with the message error log in use
the error log has hundreds of the following messages :

1999/09/23 09:28:20.72 spid2 Lazywriter: WARNING, LRU list is empty (0 free bufs, 94 total bufs)
1999/09/23 09:29:18.41 spid12 bufwait: timeout, BUF_IO, bp 0x10dc500, pg 0x23e345, stat 0x801000/0x6, obj 0x8,
bpss 0x212e278.

We cannot log on using ISQL just hangs. PS We did not receive recovery complete message on the attempted
minimum startup/

View Replies View Related

IS Same? (RS Start In Window Severvices V RS Start In Configration)

 

1) RS Start in Window Severvices
  2) RS Start in Configration

   1) and 2) Is Same?

   I think that It looks like same Operation.

View Replies View Related

Get With The Program

It is very interesting to me that most people in this group can't do simpleSQL. Are you viewing MySQL as a simple file system?As long as you do that,you willnot understand SQL in any dialect. So from now on:When you have a question about SQL. post the table structures. Uh, "WithCreate".Post some sample data in the form of INSERTS.Regards,Rich--The journey is the reward.

View Replies View Related

Help In Program

i have a program which should give the out like this
XAPIALTMKT20010829105525.TXT

but its giving the output = 'X'
which is just the first initial...how
can i get this...

if i don't write the @filename=....
only then its giving the output..but i want to store it in the
varable..how can i do that
================================
declare
@v datetime ,
@filename varchar

select @v=getdate()
select @filename='XAPIALTMKT'
+CONVERT(varchar, @v, 112)
+SUBSTRING(CONVERT(varchar, @v, 108), 1, 2)
+SUBSTRING(CONVERT(varchar, @v, 108), 4, 2)
+SUBSTRING(CONVERT(varchar, @v, 108), 7, 2)
+'.TXT'

print @filename
================================================

thanks,
Harish

View Replies View Related

SQL Program Question

Hello, i installed :

SQL Server 2005 Express Edition with Advanced Services
Install Microsoft SQL Server 2005 Express Edition with Advanced Services

but I do not see any program in my program menu to open it. Is this a stand alone program I can open? Thanks

View Replies View Related

((((((((( Can Someone Post SQL 03 Program ))))))))))))))))))

View Replies View Related

Mailsend Program

Hi All,

I have installed SQL Server 2005 and created a job. I made the job failed to test the mailsend program. The notification step that uses the mailsend succeeded but I did not get an email. I am using mailsend program on SQL Server 2000 and it works fine. I am really stomped and don't know what to do to fix it?

Thanks.

View Replies View Related

Mailsend Program

Hi All,

I am trying to send an email from a cmd prompt from SQL Server 2005 server using mailsend program. I am getting the message "Could not send mail". I am really stumped, don't know how to fix it. Any suggesstions?

Thanks.

View Replies View Related

Triggers - C# Program

Hi,

In SQL Server is it possible to have a trigger that will throw an event which could be caught by C# program running in the back ground?

Is this even possible? If it is, have u any links to help/examples?

Regards!

View Replies View Related

Is It This Job Can Program In Trigger?

I've have following table,

tblHIT - this table will reveive record every minutes
Date | Time | Main_ID | Hit
------------------------------------
3/1/2006 | 100 | 200 | 8700
...
...
...
4/14/2008 | 100 | 200 | 4500
4/14/2008 | 100 | 201 | 8700
4/14/2008 | 200 | 200 | 3500
4/14/2008 | 300 | 201 | 7700
...
...

I've also 1 job in SQL Server Agent will execute STORED PROCEDURE and will filter 7 days record before from current date and insert it into tblHIT_7days. tblHIT_7days shown as follow
tblHIT_7days
Date | Time | Main_ID | Hit
------------------------------------
3/7/2008 | 100 | 200 | 8700
...
...
...
4/13/2008 | 100 | 200 | 4500
4/13/2008 | 100 | 201 | 8700
4/13/2008 | 200 | 200 | 3500
4/13/2008 | 300 | 201 | 7700

I've plan to create TRIGGER. This TRIGGER will insert the appropriate record from tblHIT into tblHIT_7days and also delete a appropriate record in tblHIT_7days. This INSERT and DELETE transaction depend on current date.

Is it possible, TRIGGER can do this?

View Replies View Related

Using Sql Server In DB Program

I am about to build a program that will require the use of DB.  In the pass I used Access as my back end, but this time I would like to use Sql Server.  I just have a few questions before I begin. 

1. After deploying and installing my program, do I need to have sql server installed on users system or can the DB file exist on its own and just use ADO.NET to access the file? (As I done in the pass to access my Access mdb file)

 2. If I can deploy a sql file -- can it be done with Sql Server Express?

3. If it can't be done, what db program should I use?

View Replies View Related

Program Locking Up While Using Rda

On some occasions when trying to send data back to the server, the program will lock up for up to 30 minutes. The code below is the rda data transfer process and the function IsConnected() determines whether there is a connection.
 
  If Not MainFrm.IsConnected Then       
     rda.ConnectionManager = True
  End If
  If MainFrm.IsConnected Then
    Dim sCon As String = "Provider=SQLOLEDB;Data Source=175.21.21.121;Initial       
    Catalog=OurDb;User ID=UserId;Password=pwd"
    rda.InternetUrl = "http://Ourwebsite.co.uk/tfr/sqlcesa30.dll"
    rda.LocalConnectionString = "Data Source=Program FilesSysdata.sdf"
    For i As Integer = 0 To RecCount - 1
      Try
        rda.SubmitSql(UpdateRec(i, 0), sCon)
      Catch Ex As SqlCeException
        ErrTxt = Ex.ToString
      End Try
    Next
 

    Public Shared Function IsConnected() As Boolean
        Dim request As HttpWebRequest
        Dim response As HttpWebResponse
        Try
            request = CType(WebRequest.Create("http://www.intel.com/"), HttpWebRequest)
            response = CType(request.GetResponse(), HttpWebResponse)
            If response.StatusCode = HttpStatusCode.OK Then
                response.Close()
                Return True
            Else
                response.Close()
                Return False
            End If
        Catch Ex As WebException
            Return False
        End Try
    End Function
 
There are rda properties which determine a timeout. How can I use these to stop my program from locking up if the signal is weak?

View Replies View Related

Problem With Update Program

 I have written this Program For Updating the profile Information .At the Page_Load Event I read the profile information from the database and write it in the respective Textboxes .At the Button_Click event I have written a program to Update the data from the respective Textboxes.The program executes but doesnot updates .public partial class CreateProfile : System.Web.UI.Page{    SqlConnection con;    SqlCommand com;    string un = HttpContext.Current.User.Identity.Name;    protected void Page_Load(object sender, EventArgs e)    {        con = new SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Profiledata.mdf;Integrated Security=True;User Instance=True");        com = new SqlCommand("select * from profiletable where username='" + un + "' ", con);        DataSet ds = new DataSet();        SqlDataAdapter da = new SqlDataAdapter(com);        SqlCommandBuilder cb = new SqlCommandBuilder(da);        DataTable dt = new DataTable();        da.Fill(ds);        dt = ds.Tables[0];        Textname.Text = dt.Rows[0][1].ToString();        com.Cancel();    }    protected void Button2_Click(object sender, EventArgs e)    {        con = new SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Profiledata.mdf;Integrated Security=True;User Instance=True");        con.Open();        com = new SqlCommand("update profiletable set name='" + Textname.Text + "'  where username='" + un + "' ", con);        com.ExecuteNonQuery();        com.Cancel();        con.Close();    }} Plz help me with this program........................   

View Replies View Related

Use Sql 2005 To Program Against Sql 2000

I have sql server 2005 (full version) installed on my local machine, while the databases (on the server) I want to program against are in sql 2000. Could I program against sql 2000 databases using sql 2005? If yes, what do I need to know before I start doing that? Any suggestions are welcome.

View Replies View Related

ASP.NET,Gettting Error In The Program

Hi,
please have look into the code and let me know the solution plz. 
string ProID;
try
{
using(SqlConnection conn=new SqlConnection(source))
{
conn.Open();
DataSet ds=new DataSet();
DDLProject.Items.Clear();
SqlCommand cmd=new SqlCommand("SP_ProjectSelect",conn);
cmd.CommandType=CommandType.StoredProcedure;
cmd.Parameters.Add("Name",SqlDbType.NChar,30,"@Name");
cmd.UpdatedRowSource=UpdateRowSource.None;
cmd.Parameters["Name"].Value=DDLProductLine.SelectedItem;
 
SqlDataReader dr=cmd.ExecuteReader(); ------------->>>> Here iam getting Following Error.
 
while(dr.Read())
{ Response.Write(dr["ID"].ToString());
}
 
}
}
catch(System.Exception ex)
{
Response.Write(ex);
}
Error:
System.InvalidCastException: Object must implement IConvertible. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader() at MIS.UI.ResourceList.DDLProductLine_SelectedIndexChanged(Object sender, EventArgs e) in c:inetpubwwwrootdotnet pgmsmisui
esourcelist.aspx.cs:line 121 
Any suggestion plzz,where went wrong.
Thanks in advance
Regards
Mahesh Reddy 
 
 

View Replies View Related

Missing Program Group

Guys and GirlsI have a server that was running SQL Server 2000 (on Windows 2000server).In preperation for an upgrade from an old SQL Server 6.5 system. Iun-installed 2000. I edited the registry to remove all references toSQL Server and deleted all files. I have rebooted the server.I have run an install of 6.5. It seems to have worked all right exceptthere is no program groups on my start menu. Any ideas what might havehappened?RegardsMatt

View Replies View Related

Store Program EXE In Table?

Hello, Folks. I am not sure if this can be done (and a brief search ofthis group didn't yield any results that I thought would do the trick)but if it can be done it would make my life easier so here goes.First, what I am trying to accomplish is to make a program I've writtenautomatically update itself if there is a newer version on the network.Second, my application runs on one or more computers at manygeographically separated locations. I have remote control softwarethat enables me to remotely update and troubleshoot my application butI since I have to pay for this access per computer I don't have theability to control each and every computer that runs my software (forthose clients with more than one computer that uses my software).Third, my application uses as its data storage system MSDE 2000 (withcurrent service pack).Fourth, my users are not technical people and I want to rely on them aslittle as possible.Fifth, not all of the workstations are Internet enabled or connected,so having the application check a website for an update is notfeasible.Finally, to bring those different pieces together, what I want to beable to do is connect to and control the "server" (the computer withMSDE installed on it) and store in the database what the currentversion number is along with the current program files. Then, when theapplication launches, it will check that stored version number againstit's own version number to determine if there is a newer versionavailable. If there is a newer version available I want it to updateitself (that workstation) by retrieving that newer software from thedatabase. I want to avoid file sharing because it's problematic andsince I already have SQL Server (MSDE) running on the network I'd liketo use that.Is there some way that I can either a) store my program files (one EXEapproximately 5MB in size and one OCX approximately 250KB in size) in atable to be retrieved by my application so it can update itself or b) away to get SQL Server (MSDE) to read a file locally on the server andreturn it to my application just like it would any recordset so I couldjust tell it where the file was and let it read it from whicheverfolder it's stored in?I've looked at making a column of datatype Binary, and perhaps that'sthe way I'll go (re-creating the field to the correct size each time Ido an update or perhaps making it really big so I don't have to worryabout the size). But I thought I'd ask around first since this isn'tanything I know much about.Thank you for your time and help.--HC

View Replies View Related







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