Delcare a variable with decimal datatype having scale 2 and assign the original value to newly declared variable.
DECLARE @result decimal(5,2),
@value1 decimal(5,4), @value2 decimal(5,4)
SET @value1 = 1.1004
SET @value2 = 1.0004
SELECT @result = @value1
SELECT @result
select @result=@value2...
Hi,
Try this
select * from <table_name> with (tablock,updlock)
The above query will have the table level lock and update lock until the end of the statement or end of transaction.
For more hlep read locking, hints in BOL.
Madhu.
Hi,
While creating a table itself you can create the computed field. Suppose you want to create a column as sum of two already delcared columns, you can create as follows
create table test
(a int,
b int,
c as a+b)
Here the column C is stored the date vartually in the table , it cannot...
Hi,
Sql server will not allow you to use the USE statement inside a Stored Procedure. So it might be the problem. Check once again your stored procedure and modify it as what you want.
Madhu.
You must provide the single quote "'" if U use string type data
so write as,
searchSQL = searchSQL & "where Daily ='" & mydata & "'"
instead of
searchSQL = searchSQL & "where Daily =" & mydata
Madhu.
Hello,
You can write the dos commands as batch file and save it externally to a path and run via the Query analyser with the full path.
For ex:
Suppose, as you mentioned in your question comprise the dos commands as a batch file and store it as sample.bat in c drive or d drive or at any whare...
Hello,
I think below one will solves your problem, you can try this
Begin transaction
Insert into temp_table values(1,'mahesh')
Select max(id) from temp_table with (TABLOCK,HOLDLOCK)
Commit transactin
Or if you want to lock the table exclusively use XLOCK option.
Madhu.
you can do it by using functions LOWER(char_exp) or UPPER(char_exp). LOWER function will be used to convert all upper case letters to lower case letters, UPPER case function also in similar way used.
It may be helpful to U, I think.
Madhu.
you can do it by using LOWER(char_exp) or UPPER(char_exp).
Lower function will be usefull to convert all upper case letters to lower case letters, the similar way UPPER function also.
It may help to U, I think.
Madhu.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.