Viewing 15 posts - 2,146 through 2,160 (of 3,543 total)
or
SET @strQuery = 'IF EXISTS(select 1 from app_client where ' + @conditionstring + ') SET @count=1'
to avoid using count(*) to improve performance
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...
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...
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...
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) +...
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...
October 17, 2005 at 7:01 am
![]() | ...is that the voice of a sore loser... |
Who me Never
October 17, 2005 at 2:31 am
![]() | ha David - another one for remi! Not that anyone's keeping tabs!!! |
Yeah as always
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...
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
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...
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...
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,...
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...
October 11, 2005 at 7:24 am
![]() | Isn't there a problem in SQL Server where, in a stored proc, SQL statements that follow a RETURN... |
October 11, 2005 at 7:14 am
Viewing 15 posts - 2,146 through 2,160 (of 3,543 total)