|
Hi
I am using SQL Server 2005 in our InstallShield Project.In that It needs to take the login inforamtion at run time for checking the password.Where will we get all those kind of Informations.Where is it resided in our machine.
Please .... respond to my question.
Thanks In Advance.
Jeeva
|
|
|
|
|
hi all
i have a Query that return results and i have written it like this
<br />
select * <br />
from sde.property p1<br />
where p1.func_key = 'PV000000'<br />
and exists (select 1 <br />
from sde.property p2<br />
where p2.lis_key = p1.lis_key<br />
and substring(p2.func_key,1,5)='GEOSS'<br />
and P1.aCTIVE =1<br />
And substring(p1.Attrib_code,5,2) != '16')<br />
order by Actual_extent Asc<br />
<br />
And i want to Update the records returned by the above query like this
<br />
<br />
update Property<br />
set Attrib_code = substring(Attrib_code,1,4)+ '16'+ substring(Attrib_code,7,6)<br />
<br />
Now i was to combine this Queries , how can i achieve this
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
|
|
|
|
|
Give this a try
update p1
set Attrib_code = substring(Attrib_code,1,4)+ '16'+ substring(Attrib_code,7,6)
from sde.property p1
where p1.func_key = 'PV000000'
and exists (select 1
from sde.property p2
where p2.lis_key = p1.lis_key
and substring(p2.func_key,1,5)='GEOSS'
and P1.aCTIVE =1
And substring(p1.Attrib_code,5,2) != '16')
order by Actual_extent Asc
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
Thank you very much its working
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
|
|
|
|
|
Thank you very much its working
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
|
|
|
|
|
Recently i came across an error updating my DB. had checked the validations and field requirements of each individual field in the DB and when submit, it prompt me this.
--------------------------------------------------------------------------------------------------------------------
Error updating the database. Please make sure all values are correctly input
INSERT INTO tblUsers (userid, email, password, Cpassword, Fname, Lname, birthDate, street, Pcode, city, state) VALUES ('asdasd','adasda@asdas.asa','123123123','123123123','dasda','asdada','01/14/2008','asdasd','1233','asda','asda')
System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at ASP.rego4_aspx.ExecuteStatement(Object strSQL) in c:\inetpub\wwwroot\test\insertDB.aspx:line 81
--------------------------------------------------------------------------------------------------------------------
its stated Syntex error in the command but however it seems workingly fine updating another table. can anyone help point out my error here?
Thanx in advance!
|
|
|
|
|
Try running the query through Management Studio. You should get more detailed error information.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hmm... sure! i would give it a shot! Thanx for advice!
regards
|
|
|
|
|
That's OK. I would suggest in future however that you investigate problems more thoroughly yourself before resorting to a forum for help. It only takes a few moments to run an adhoc query in Management Studio and should be a quicker way to find the solution to a problem than posting on a forum where you may have to wait several days for a response.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
To solve a problem of participating in a transaction, where COM code calls into .NET 2.0 code, I need the .NET code to participate in the transaction started by the COM code. A distributed transaction is not an option, and sp_bindsession is not working.
I would like, if possible, to receive an ADO connection object in my .NET class, somehow convert that to an ADO.NET connection object, and be done with minimal code changes. However, it is not a train smash if I have to use ADO in my .NET code for the data retrieval. This is my worst case, but only involves minor changes. I just don't like it.
|
|
|
|
|
I want to show 'select * from emp' query result in HTML page as table view (html table )..Is it possible..?
If s how can i?
|
|
|
|
|
If you are using ASP.NET, use one of the data-bound controls e.g. GridView.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I'm using HTML page, not asp.net...so how can i get the info from aspx page to html page
???????????????
|
|
|
|
|
Can you use ASP.net? You may also want to consider a book on web development...
|
|
|
|
|
hi,
In SQL, what is the command to count the raws with select statement.
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
select count(*) from YourTable
|
|
|
|
|
when I do
select 10/5
o/p : 2
select 5/10
o/p : 0
please tell me
how I can get o/p : 0.5
I do not want like written bellow.
---------------------------
select 10.0/5
o/p : 2.000000
select 5.0/10
o/p : 0.500000
You get the best out of others when you give the best of yourself.
|
|
|
|
|
select cast(5 as float) / cast(10 as float)
|
|
|
|
|
Hi,
How can i check the structure of a database in mssql server?
What I mean is I need a function or script which creates the table in the database if that table doesnot exist, and moreover i also need to check the existence of columns in a given table and also check if it's datatype is valid or not,if it is a primary key and so on and so forth.
What I need is just a routine or a sql script to check the data structure of a database?
|
|
|
|
|
You can use IF EXISTS to check if most database objects exist or not. This can be tables, and stored procedures. Give google a shot and it'll turn up a bit of good stuff for you
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I am trying to insert a new record to a database access SQL. The connection is right, The statement is right and if I run it in a local machine it works just fine using express sql. but if I use it in my business server 2003 with the original sql program it does not work. The contactid is an identity column and it should automaticaly incriment and it does under access but it won't work through the command. What am I doing wrong?
Cannot insert the value NULL into column 'ContactID', table 'PLEASANTWEBSQL.dbo.COMPPATSTAB'; column does not allow nulls. INSERT fails. The statement has been terminated.
Dim cmd As New System.Data.SqlClient.SqlCommand
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandText = "insert into comppatstab (firstname, Lastname, middlename, Birthdate, address, city, state, postalcode ) Values ( ...)
This is part of my command text with the values matching.
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.ExecuteNonQuery()
sqlConnection1.Close()
|
|
|
|
|
MUSIWA wrote: Cannot insert the value NULL into column 'ContactID'
Your cmd.CommandText shows no indication of using ContactID...
---modified
I missed the part of ContactID being identity. Are you sure?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Thankyou for replying I realy appreciate it. In my command.text I did not include the contactID because I thought that it will be automatically added when I add the new record. See when I looked at the syntax I did not notice how you add the primary key value if you do not know what the number is. In other words I do not know if I need to include the contactId and what value then do you give it?
|
|
|
|
|
From what I recall, if the ContactID is indeed an identity field with an auto-increment, you do not need to add it into the insert statement. Double check that the field is indeed an identity field and that it is supposed to not have any nulls allowed.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Yeah you were right I had a brain fart The table was recentely made from a query and it does not automaticaly make the primary key an Identity I corrected that and the whole thing works like a charm thanks again You were a life saver!
|
|
|
|