|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I just want help on a small sql problem.
Like in oracle if u write this code insert into emp(ename,empno) values('&ename','&empno') and run ,it will prompt for name and empnumber values.. I am testing the same thing in MSsql query analayser how to do the same thing in sql. Because in my databse i have to populate lot of intial values. thanx in advance |
|
#2
|
||||
|
||||
|
AFAIK, SQL Server doesn't support prompting for variables.
The way you would do it in Query Analyzer would be like this Code:
DECLARE @EmpName varchar(30) DECLARE @EmpNum int Set @EmpName = 'Bob Smith' Set @EmpNum = 12 INSERT INTO emp(EmpName, EmpNum) VALUES(@EmpName,@EmpNum) You would just change the values in the "SET" statements. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > how to prompt for insert |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|