Viewing 15 posts - 2,146 through 2,160 (of 3,544 total)
oooops! forgot to initialise the variable ![]()
need to add
SET @count = 0
before sp_executesql
Far away is close at hand in the images of elsewhere.
Anon.
October 19, 2005 at 8:51 am
or
SET @strQuery = 'IF EXISTS(select 1 from app_client where ' + @conditionstring + ') SET @count=1'
to avoid using count(*) to improve performance
Far away is close at hand in the images of elsewhere.
Anon.
October 19, 2005 at 8:34 am
Create Procedure XYZ
(
@conditionstring nvarchar(3950)
)
AS
DECLARE @count int
DECLARE @strQuery nvarchar(4000)
SET @strQuery = 'Select @count = count(*) from app_client where ' + @conditionstring
EXEC sp_executesql @strQuery, N'@count int OUTPUT', @count...
Far away is close at hand in the images of elsewhere.
Anon.
October 19, 2005 at 8:30 am
sushila ![]()
SELECT *
Bad practice ![]()
I would do
IF NOT EXISTS(SELECT 1 FROM app_client WHERE first_name = @name AND last_name...
Far away is close at hand in the images of elsewhere.
Anon.
October 19, 2005 at 7:23 am
SELECT a.DeptId, MIN(a.Marks) AS [Marks]
FROM a
WHERE a.Marks IN
(SELECT TOP 2 b.Marks FROM b WHERE b.DeptId = a.DeptId ORDER BY Marks DESC)
GROUP BY a.DeptId
ORDER...
Far away is close at hand in the images of elsewhere.
Anon.
October 19, 2005 at 7:20 am
Create the procedure to do the following
DELETE FROM WHERE ....
DECLARE @newseed int,@sql nvarchar(100)
SELECT @newseed=ISNULL(MAX([ID]),0) FROM
SET @sql = N'DBCC CHECKIDENT (,RESEED,' + CAST(@newseed as nvarchar) +...
Far away is close at hand in the images of elsewhere.
Anon.
October 19, 2005 at 7:10 am
SqlJunkie beat me to the punch ![]()
As an alternative why not load the data into a staging table (with rowid IDENTITY column) then...
Far away is close at hand in the images of elsewhere.
Anon.
October 17, 2005 at 7:01 am
| ...is that the voice of a sore loser... |
Who me Far away is close at hand in the images of elsewhere.
Never
Anon.
October 17, 2005 at 2:31 am
| ha David - another one for remi! Not that anyone's keeping tabs!!! |
Yeah as always ![]()
Far away is close at hand in the images of elsewhere.
Anon.
October 14, 2005 at 10:55 am
and.......
if the number of digits following BAL is variable then
select substring(@string, charindex('bal', @string), patindex('%[a-z]%',substring(@string, charindex('bal', @string)+4, len(@string)))+3)
as for the rest of the parsing we will need for accurate definition of...
Far away is close at hand in the images of elsewhere.
Anon.
October 14, 2005 at 9:30 am
http://www.databasejournal.com/features/mssql/article.php/3500276
This reports on long running jobs but it will give you what you are looking for
Far away is close at hand in the images of elsewhere.
Anon.
October 14, 2005 at 7:34 am
This query
SELECT x.shopID,ISNULL(st.stateID,-1) AS [stateID],x.stateName
FROM (SELECT sh.shopID,
SUBSTRING(',' + sh.states + ',', n.number + 1,
CHARINDEX(',', ',' + sh.states + ',', n.number + 1) - n.number - 1) as...
Far away is close at hand in the images of elsewhere.
Anon.
October 14, 2005 at 4:55 am
Two observations
Your last posted query uses a column named [RIC] which is not specified elsewhere and therefore the query will not work
The query uses an INNER JOIN which means you...
Far away is close at hand in the images of elsewhere.
Anon.
October 14, 2005 at 3:17 am
Maybe
Definately indeterminate ![]()
RETURN expects an 'integer expression', the subquery is not and neither is it's results.
Mind you,...
Far away is close at hand in the images of elsewhere.
Anon.
October 11, 2005 at 7:43 am
1. Your code indicates that PAY_DURING and EMPLOYED_DURING records exist before the EMPLOYEE record
2. Write a sp to insert EMPLOYEE and do the checks there
3. If sp not possible and...
Far away is close at hand in the images of elsewhere.
Anon.
October 11, 2005 at 7:24 am
Viewing 15 posts - 2,146 through 2,160 (of 3,544 total)