|
If you are using SQL Server then:
SELECT CHARACTER_MAXIMUM_LENGTH
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'yourtablename' AND
COLUMN_NAME = 'your column name'
|
|
|
|
|
This Project (Book Store Management System) have the necessary parts include:
# Employee's system - it will display who is taking care of the counter on
that particular day.
- this system will not keep track on the payroll of the
staffs.
# Stock Update System - it could update the amount of stocks.
# Sales system - it can help to keep track of how many items which have been
sold.
# Member system - it will store the member's detail whenever the customers want
to register as member of the book store.
- this system will be used by clerk only.
# Password Login - it is the essential component of the starting the system.
- This password login must not be a fixed one but indeed it
could change from time to time.
These 4 system will be handle by the cashier.
--------------------------------------------------------------------------------
This project actually is a free topic, so we, students are free to choose what we want.
--------------------------------------------------------------------------------
Thus, this project is my own idea. If you wish to add some ideas or commends, feel free to do so. I would appreciate it very much.
I hope you can understand my question.
Please help me in the source code.
Thank you.
Aaron
|
|
|
|
|
I'm not sure what it is you are asking for, unless you are asking someone here to write the source for you. This will not happen, however if you do have a question, there are many here among us (great Jimi Hendrix line too ) that would be glad to help you out.
Nick Parker
|
|
|
|
|
I have the following tables:
CREATE PLAYER (
PLAYERNO INT UNIQUE NOT NULL,
NAME CHAR(20),
...
PRIMARY KEY(PLAYERNO)
)
CREATE TABLE GAME (
GAMENO INT UNIQUE NOT NULL,
PLAYER1 INT,
PLAYER2 INT,
HOURS INT,
...
PRIMARY KEY(GAMENO),
FOREIGN KEY(PLAYER1) REFERENCES PLAYER(PLAYERNO),
FOREIGN KEY(PLAYER2) REFERENCES PLAYER(PLAYERNO)
)
How do I retrieve, for every player, the total number of hours he played as Player1 and the total number of hours played as Player2? The resulting table should be something
like:
PLAYERNO HRS-PLAYED-AS-P1 HRS-PLAYED-AS-P2
|
|
|
|
|
I guess this will work:
select 'PLAYERNO' + game.player1 ,sum(game.hours) + 'hours played' as P1,'PLAYERNO' + game.player2 ,sum(game.hours)+'hours played' as P2 from game where gameno = @yournumber
I'm not sure but maybe you nedd some data conversion when you add 'PLAYERNO' to game.player
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I'll gladly help out, but you haven't asked a question yet?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Is it possible to run UDF from C# or VC application?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I have a stituation where I need to be able to run a DTS package to clean up some data. The only thing that changes in the DTS is one number. Unable to find away to pass this variable to the package directly I made a table and a stored proc that updates this tables value. Then I run the DTS pack. This all works fine but is manual. If I could fire the DTS from the stored proc then this application would rebuild it's corrupt data on the fly. But I can't for the life of me figure out how to fire the DTS without clicking on the lil green arrow, running from a cmd prompt or using windows run utility.
Any ideas?
-----------------------------------------
Real programmers don't document. If it was hard to write, it should be hard to understand.
|
|
|
|
|
You should be able to run the DTS package from code, so lets say that your recordset returns 0 which means you would need to fire your DTS package to rebuild the data you could do something like this, (at least in VB6 )
'=========================================================
'Include Microsoft DTSPackage Object Library in References
<p>
Dim dts As DTS.ExecutePackageTask
dts.PackageName = "[YourPackageNameHere]"
dts.RepositoryDatabaseName = "[YourDatabaseNameHere]"
dts.ServerUserName = "[YourUserNameHere]"
dts.ServerPassword = "[YourPasswordHere]"
dts.Execute(Package, PackageEvents, PackageLog, DTSTaskExecResult_Success)
HTH
Nick Parker
|
|
|
|
|
Thanks, but this woundn't work from within the stored proc. I think this is the perverbial dead-end; where I need to look back and see how I got in this situation. The problem is probably my implimentation. The DTS takes approx. 4-5 hours to run, so anything through IIS is out. Thanks again though.
Real programmers don't document. If it was hard to write, it should be hard to understand.
|
|
|
|
|
pmenefee wrote:
Thanks, but this woundn't work from within the stored proc. I think this is the perverbial dead-end;
Actually, if you have your DTS designated to a job then I think what you should check into is sp_start_job . This should work from within a stored procedure.
HTH
Nick Parker
|
|
|
|
|
You can use: xp_cmdshell and dts run utility to execute DTS package from store procedure. You can create statement like
exec master..xp_cmdshell 'dtsrun /Uuser_name /Ppassword /Sserver_name /Npackage_name /Mpackage_password'
Please read more about xp_cmdshell & dtsrun from SQL Server Books Online.
Regards
|
|
|
|
|
Greetings,
How can I change properties for keys (ie: Caption,input mask) in access using ADO or ADOX?
I can use the code below to change a description:
------------------------------------------------
tblNew->Columns->GetItem(_bstr_t("TestKey"))->
Properties->GetItem("Description")->
Value = "Test";
But if I try to change the caption, it says:
"Item cannot be found in the collection corresponding to the requested name or ordinal."
-------------------------------------------------
tblNew->Columns->GetItem(_bstr_t("TestKey"))->
Properties->GetItem("Caption")->
Value = "FOO";
Why is the "caption" property not available, but the description is?
Is there a way to do this?
Thanks in advance
|
|
|
|
|
I have a table (Table A) in which I have Composite Primary Key on 2 columns. I have another table (Table B) where I want to refer a column as the foreign key reference to one of the columns of Composite Primary Key of table A.
How to define this relationship?
Thanks
Hitesh
|
|
|
|
|
Wny not do it visually through the diagram view?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Does anybody know some sites about SQL Server2000?I need some tutorials and examples about SQLServer2000 and SQL language.Triggers,stored procedures,user defined functions and ....
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Thanks Richard.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Thank uo Nick.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I am trying to update an existing record in a table using the following code in an ASP page. The table (tblProjectCats) has an ID value (integer, autoincrement), and Title and Description fields (both set to varchar). The following code just doesn't work...doesn't give an error message...
'//start code
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "UPDATE tblProjectCats SET Title ='Title', Description = 'Desc' WHERE ID=1", objConn, adOpenDynamic, adLockReadOnly, adCmdText
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
'//end code
|
|
|
|
|
Try:
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
oConn.Execute "UPDATE tblProjectCats SET Title ='Title', Description = 'Desc' WHERE ID=1", , adExecuteNoRecords Or adCmdText
objConn.Close
Set objConn = Nothing
|
|
|
|
|
I'm looking for sample code..
using ADO not ODBC to access DB....
i want to just a simple code...
1. id and password checking on Dialog before application start
2. and then access to DB
3. member table id char(10) password char(10)
4. Is right or not
=======================================================================
CString tempID, tempPW; //
// int result;
tempID = m_strID; // ·Î±×ÀΠâ¿¡ ÀÔ·ÂµÈ ID ÀúÀå
tempPW = m_strPW; // ·Î±×ÀΠâ¿¡ ÀÔ·ÂµÈ Æнº¿öµå ÀúÀå
// µ¥ÀÌÅͺ£À̽º ¿¬°á ¹®ÀÚ¿°ú SQL ¸í·É ¹®ÀÚ¿À» ¼ÂÆÃÇÑ´Ù.
m_strConnection =_T("Provider=SQLOLEDB; Data Source=192.168.3.212; Initial catalog = jok_db; User ID = sa; Password = kiss;");
CString check_id = "EXEC check_id";
m_strCmdText=_T(check_id + " " + "'" + tempID + "'" + "," + "'" +tempPW + "'");
long result = m_pRs->Fields->Item["certify"]->Value;
==========================================================================
environment
MFC, SQL2000
i want to full source code.....
plz i need your help.
thank you for reading....
Have a nice day!!!
|
|
|
|
|
i have a MSAccess database (soon to be upgraded to SQL Server db)... which has Memo fields and some OLE and maybe even picture fields
in ASP... given a connection object (set cn = server.createobject("adodb.connection") ), how do i update the data in the memo field to that of a variable
e.g. i want to do "UPDATE myTable SET myMemoField=<here i="" need="" to="" put="" like="" 50k="" of="" data=""> WHERE ... " but of course i can't fit that all into the string
and even if it did fit in the string, it screws up when i have SQL commands in the text data itself
thanks in advance for your help
- Roman -
|
|
|
|
|
I think you have to do it manually - write code to open recordset, call method Edit(), set value for your memo field and call Update().
When you will move to SQL server you might want to write stored procedures to update your database - you will get it very robust and probably faster.
Martin
--------------------------------------------
C'mon we all know computers are experimental devices and should only be used for playing games.
Using them for alternative stuff like business, is clearly not using them for what they are intended.
Colin Davies
|
|
|
|