|
I create a triggers but I need to add the time
how can I get the time NOW from sql server
thanks
dadax
|
|
|
|
|
GetDate() will return the current date and time. It is easy enough to just get the time portion from the returned DateTime
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
I have a table contain ( username,password )
and I'll save that password encrypted in the database
how can I do this ?
thanks
dadax
|
|
|
|
|
Encrypt the password first and then save it in the database like anything else.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
How can I encrypt it ?
( from SQL )
dadax
|
|
|
|
|
MohamadJaber wrote: How can I encrypt it ?
( from SQL )
As I already said "Encrypt the password first" then put it in SQL. You cannot encrypt it in SQL without using extended stored procedures in SQL Server 2000 or using CLR stored procedures in SQL Server 2005. Either which way the encryption process does not happen in SQL code.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
sorry annoyance you but plz can you tell how can I enrypted and decrypted it using CLR stored procedures in SQL Server 2005
thanks anyway for you help
dadax
|
|
|
|
|
You don't want to do that anyway. From a security standpoint, there's practically no value of encrypting passwords on the server if you transmit them over plaintext SQL. Anyone with a packet logger (easy) can get as many passwords as they could by finding an admin password and reading them out of your DB (hard).
|
|
|
|
|
Here u got good example how to hash password
http://www.c-sharpcorner.com/Code/2003/Feb/HashPassword.asp
|
|
|
|
|
You don't need CLR stored procs to encrypt or decrypt. SQL 2005 has encryption built in. Take a look at my blog at http://www.cubido.at/Blog/tabid/176/EntryID/34/Default.aspx. There you can find an example including a mind map describing SQL 2005 encryption functions.
Regards,
Rainer.
Rainer Stropek
Visit my blog at http://www.cubido.at/Blog/tabid/176/BlogID/4/Default.aspx
|
|
|
|
|
hi
What is the query to take value stored in variable
this value comes from textbox control and then datagrid is filtered through this value
Thanks
|
|
|
|
|
Something like this:
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand();
da.SelectCommand.Connection = conn;
da.SelectCommand.CommandText = "SELECT * FROM MyTable WHERE filterColumn = @filterValue";
cmd.Parameters.Add("@filterValue", myTextBox.Text);
da.Fill(myDataSet);
Assumptions:
* You have an existing SqlConnection called conn
* The table is called MyTable
* You are filtering on a column called filterColumn
* You have a TextBox called myTextBox
* You have a DataSet called myDataSet
Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Thank You Mackay
It is working ....
Thank You once again..
|
|
|
|
|
Hi Friends
I have parent child tables.
Paretnt has 10 records
child has 30 records i.e. all parent records got 3 child records.
date field in child record is unique.
Now i want to fetch records like this
parent record with last two dates of child records
Note: date is not in sequece for child records. i.e. data in child table may be entered with the gaps of years or months
help me please.
Naveed Kamboh
|
|
|
|
|
"?Select top 2 child.date, parent.* from parent inner join child on parent.key = child.foreignkey order by child.date desc"
assumes parent has some field key that is used as 'foreignkey' in child to relate the proper records
|
|
|
|
|
Thanks Graham,
it just fetches 2 recodrds
while i need 2 recods from child for each parent record.
Please if you need more explination email us. thanks
Naveed Kamboh
|
|
|
|
|
Hi every body i get this exception when i try to execude my web???
An attempt to attach an auto-named database for file C:\Web2005\BallonShop\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Please did u know where is the problem ?
good bye thank's
|
|
|
|
|
I want to know how i can transfer data from one MS ACCESS table on one computer to another MS ACCESS table on another computer by using a phone line on each computer using VISUAL BASIC 6.0
Shoaib Hussain
|
|
|
|
|
|
Don't shout!
It's rude, and no one will answer you if you shout
|
|
|
|
|
Shoaib,
Please ..... !!!
<no comments="">
Vikas G
Vikas Garg
|
|
|
|
|
1. Install hex viewer.
2. Load Access file in hex viewer.
3. Call person on other end of phone line.
4. Read hex codes to other person so they can type them in.
5. Save file on remote end.
|
|
|
|
|
Hi,
I am trying to retrieve data from Oracle database using SQL server but after running the statement I encountered an error message. Need help..
select tm_tfr_no from SMSS..NI.NI_TFR_MAIN a <br />
where tm_tfr_received_date_by_lt ='2000-05-21'
Error converting data type DBTYPE_DBTIMESTAMP to datetime.
Dabuskol
|
|
|
|
|
Hi,
I am writing a query that returns me the various figures all the salesperons:
My query goes like this :
Select Usr.user_name as SalesPerson,
isnull(ReqNo,0) ReqNo,isnull(ResSubToSalesPerNo,0) ResSubToSalesPerNo,
isnull(ResSubToClientNo,0) ResSubToClientNo,isnull(InterviewNo,0) InterviewNo,
isnull(ConfirmNo,0) ConfirmNo,isnull(RejectionNo,0) RejectionNo
from
xr_user Usr
left Join
(select sales_person_id,count(requisition_date) ReqNo from xr_sales_reqs where
requisition_date between convert(varchar,'5/1/2006',101) and convert(varchar,'5/29/2006',101)
group by sales_person_id) Reg on
(Usr.User_Id = Reg.sales_person_id)
left join
(select A.sales_person_id,count(date_sub_sales_per) ResSubToSalesPerNo
from xr_sales_reqs A left join xr_candidate_links B on A.sales_req_id=B.sales_req_id
where B.date_sub_sales_per between convert(varchar,'5/1/2006',101) and convert(varchar,'5/29/2006',101)
group by A.sales_person_id) cl1 on
(Usr.User_ID = cl1.sales_person_id)
left join
(select A.sales_person_id,count(date_sub_client) ResSubToClientNo
from xr_sales_reqs A Left join xr_candidate_links B on A.sales_req_id=B.sales_req_id
where B.date_sub_client between convert(varchar,'5/1/2006',101) and convert(varchar,'5/29/2006',101)
group by A.sales_person_id) cl2 on
(Usr.User_ID = cl2.sales_person_id)
left join
(select A.sales_person_id,count(date_interview) InterviewNo
from xr_sales_reqs A Left join xr_candidate_links B on A.sales_req_id=B.sales_req_id
where B.date_interview between convert(varchar,'5/1/2006',101) and convert(varchar,'5/29/2006',101)
group by A.sales_person_id) cl3 on
(Usr.User_ID = cl3.sales_person_id)
left join
(select A.sales_person_id,count(date_of_start_entry) ConfirmNo
from xr_sales_reqs A Left join xr_candidate_links B on A.sales_req_id=B.sales_req_id
where B.date_of_start_entry between convert(varchar,'5/1/2006',101) and convert(varchar,'5/29/2006',101)
group by A.sales_person_id) cl4 on
(Usr.User_ID = cl4.sales_person_id)
left join
(select A.sales_person_id,count(date_of_rejection) RejectionNo
from xr_sales_reqs A Left join xr_candidate_links B on A.sales_req_id=B.sales_req_id
where B.date_of_rejection between convert(varchar,'5/1/2006',101) and convert(varchar,'5/29/2006',101)
group by A.sales_person_id) cl5 on
(Usr.User_ID = cl5.sales_person_id)
Where isnull(ReqNo,0) > 0 or isnull(ResSubToSalesPerNo,0) > 0 or
isnull(ResSubToClientNo,0) > 0 or isnull(InterviewNo,0) > 0 or
isnull(ConfirmNo,0) > 0 or isnull(RejectionNo,0) > 0
now I need to join 1 more table i.e. xr_client cos I need to figure out how clients has each salesperson responded to :
xr_sales_reqs and xr_client have client_id as the common field.
can anybody help me out?
Thanks in advance,
Aryan.
|
|
|
|
|
Hi i keep getting this error message while trying to start a hook dll,
"Error s800D failed to connect," also this discription of my error mesage "%s: Failed to prepare the command SQL = %s." this i know is a syntax error, is their a programme or xp regedit trick to help me out and get this third party dll hook working, any suggestions would be appreciated thxs
peter.
THANX FOR YOUR HELP PETER
|
|
|
|