|
Try to check the information from here[^] and google for more information.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I'd like to do a bulk insert into a table in a Sybase database, similar to the "bulk insert" command for SQL-Server. I've tried using the input command that I found on Sybase's website:
"Input into Tablename from mysqlfile.sql"
Although, it doesn't seem to like "input" (However the command does work perfectly fine in interactive sql).
I'm using the ExecuteNonQuery method in the OdbcCommand (System.Data.Odbc) class.
Thanks in advance,
Eric
|
|
|
|
|
From memory, "Input Into" is a special command that is handled by directly by the ISQL program (and so is not understood by the database engine).
You might consider using running the Sybase BCP command - although you need to be careful of your %PATH environmental variable if you have MS-SQL installed (because the MSSQL client tools has a DLL that clashes). Other possibilities include using MS-SQL's DTS packages.
Hope this helps.
Andy
|
|
|
|
|
Hello,
I am trying to load Excel data to DataSet, (using OldDb... classes). Unfortunately during Fill method of OleDbDataAdapter OLE looses part of my data. I think that is becouse before loading data JET 4.0 makes some assumptions about what type columns in the sheet are. I think, this is why, when in a column there are some numbers and some strings I can read only numbers or only strings - it depends on which is more frequent.
Is there any way I could make OleDBDataAdapter (or JET driver) to read data as string!
Best regards
Leszek
|
|
|
|
|
Hi there. In your connection string, you can use the IMEX import mode - IMEX=1. Something like this:
string sCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\SomeExcelWorksheet.xls;"
+ "Extended Properties=\"Excel 8.0;IMEX=1\"";
You can look at this Microsoft Support document[^] for a more thorough description of the IMEX option.
|
|
|
|
|
Thanks,
this is what I was looking for,
Best regards
Leszek
|
|
|
|
|
Hi !
My application (developped in C++) is using an Access database. The database is actually made of two '*.mdb' files, one being linked to the other with linked tables.
It works fine : I use one database, and I can make SQL queries including the linked tables from the other without any troubles.
My problem now is if I want to install my app on someone else's computer, the path to the databases is different, but the link is absolute. Thus, the linked tables are not found and my application doesn't work.
I know that with Access, there is a menu to update the path of the linked tables, but of course, I don't want to have to do it manually through the Access Application : I want to be able, from my app, to update the linked tables automatically.
Problem : I have no idea if it is possible to do that, and how !
Any help ?
Thanks !
Jerome
|
|
|
|
|
Hi Jerome. I think this Microsoft Support document[^] may have some useful information for you. You may want to look at the Developer Solutions sample program (Solutions9.mdb) referenced in the document.
|
|
|
|
|
Guys,
I have a stored procedure in SQL Server where I pass few parameters like username, email address etc. The stored procedure simply inserts these records into users table that has an identity column as ID. Finally I read the @@IDENTITY variable to read the ID of newly inserted record and returns it via an OUT parameter passed in the stored procedure.
Now question is if I have to call this stored procedure from my C# code, can I used DataReader for this purpose? What are the best practices?
TIA
Jixi
|
|
|
|
|
If you are accessing the newly inserted ID via an OUT parameter then you would use SqlCommand.ExecuteNonQuery() .
You could alterantively return the newly inserted ID via a select statement and use a data reader if you want to. e.g. After the insert in your stored procedure you would put
SELECT @@IDENTITY As Identity and you could retrieve that single value using a DataReader, but that is really a bit reduntant because that is what SqlCommand.ExecuteScalar() does for you anyway.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Thanks for your help Colin, appreciate it.
Jixi
|
|
|
|
|
I keep getting this same exception when i try to connect to a sql database:
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
dev.Random1.Page_Load(Object sender, EventArgs e) in random1.aspx.cs:27
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
any ideas? This is a work-related project so i need to figure out the error quickly.
-- Steve
|
|
|
|
|
You need to either log in with an account that has permission to use SQL Server, or you need to set up the permission in SQL Server for the account you want to use.
I'm not really a fan of allowing Anonymous access to things in a business senario so I would suggest that you log in using an appropriate account. As you are accessing this through an ASP.NET application I am curious as to what your security settings are, if you check the box that says allow anonymous access then it will access resources through a special ASP.NET account.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Hi All,
Does anyone know how to disable the Auto Ansi to OEM option in SQL 2000. Its not in the tab as that is for the DB library and not the ODBC connection that 2000 uses. Any help would be greatly appreciated. Thanks
N.
|
|
|
|
|
hi
I have a very large database with several stored procedures. now, I need to find a stored procedure that does some calculation if that stored procedure has a string "MESSAGE"(just an example) in an IF statement somewhere down the procedure.
currently i am opening every stored procedure, doing a Ctrl+F for the above string and if i find it then that means i determine that this is the stored procedure that i will have to work with(change the calculation in it or some work)
so my question is that can i write something ... that will list me all the stored procedures which have a certain string contained in them??
I am new to sql stuff .. so please help me. this could save me a lot of time.
thanks
-messageman
|
|
|
|
|
sp_helptext is a system stored procedure which takes the name of a stored procedure and then lists it. This code will list all your stored procedure names:
SELECT name FROM sysobjects WHERE type = 'P'
So all you need to do is make a table of the names, then go through it, calling sp_helptext to get the stored procedure text, and if your text matches, return the name.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hi christian
thank you for the reply. the thing is that there are 120 stored procedures in the database and I need to know which stored procedure's BODY contains the string 'MESSAGE', etc. some stored procedures are almost 4 pages long.
I am not searching for the stored procedure named %Message%. but searching for a stored procedure whose body contains the string.
can you please give me a code sample ?
thanks
|
|
|
|
|
SELECT
ROUTINE_NAME
FROM
INFORMATION_SCHEMA.ROUTINES
WHERE
ROUTINE_DEFINITION LIKE '%MESSAGE%'
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
its_skar wrote:
the thing is that there are 120 stored procedures in the database and I need to know which stored procedure's BODY contains the string 'MESSAGE', etc. some stored procedures are almost 4 pages long.
Sure - so you need to use the code I provided to build a table that has a list of stored procedure names. Then you need to use that tempory table to step through the stored procedures, IN CODE, retrieving the text of the stored procedures, WHERE the text is LIKE %Message%.
its_skar wrote:
I am not searching for the stored procedure named %Message%. but searching for a stored procedure whose body contains the string.
That's why I gave you the name of the stored procedure that returns all the text of the procedure. You also need to get the names, otherwise, how will you know where to get the text from ?
its_skar wrote:
can you please give me a code sample ?
If I find the time tonight, I'll see what I can put together for you.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Quoting from MSDN:
"SQL Query Analyzer uses the SQL Server ODBC driver, which, by default, sets these SQL-92 options on: SET ANSI_WARNINGS, SET ANSI_PADDING, and SET ANSI_NULLS. Any errors returned are formatted as ODBC errors rather than DB-Library errors."
Is there any way to modify these options so that they are not the default?
Thanks!
|
|
|
|
|
If you mean in Query Analyzer, go to Tools/Options and change the settings on the Connection Properties tab. This affects new connections.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
I have a program in which I connect to MSSQL database on my system ( local host) I want to connect to a remote database on a system with particular IP. How do I do this?
Karteek
|
|
|
|
|
You don't specify what your program is written in, so I'll assume it is a language that targets the .NET Framework.
You change the connection string property of the SqlCommand object so that the part of the string that reads "Server=(local)", changes the (local), or 127.0.0.1 or whatever to the IP or machine name of the remote server.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Could someone suggest how I might best use my PalmIII w/ my laptop to emulate a network database or databases?
I need a lot of work/ SQL and .NET? (C# and C++/MFC)
Any articles, advice suggestions would be greatly appreciated. thanks
[ps- If it seems like I don't know what I'm talking about, you're right-- I don't.....]
|
|
|
|
|
You can't, simple as that. A PalmIII is only able to connect via a conduit, I believe, and certainly there is no support for SQL databases on the Palm.
Why do you need the network angle ? Just install MSDE or SQL Server on your laptop, the system will be agnostic to where the db comes from anyhow.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|