|
When I give random Search of 1000 records in particular table, the systems hangs after some 30 to 40 searches. Is there a Memory Problem. I use the Process Rowset function in teh demo1 code and retreived.
|
|
|
|
|
i have problem i can't attachment for database (the file you've specified is not a valid sql server database file )
how can solve this problem
Rami Abd alhalim
|
|
|
|
|
What is the file extension?
Rami Said Abd Alhalim wrote: (the file you've specified is not a valid sql server database file )
What part of that do you not understand?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
u must attach the .mdf file.
|
|
|
|
|
Hi
each time I try to add/Update something I receive the error below:
"The transaction log for database 'DatabaseName' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases"
any idea how to solve this
thanks alot
Shaimmaa
|
|
|
|
|
Have you tried the advice given in the error message? What was the result?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
I have a winApplication which has a form.
In that form I have a sql data adapter which contains 4 command for select,update,delete,insert.
When I execute insert command, with passing 9 parameters values, by use of executenonguery function I receive "procedure or function "procedure name" has too many argument specified" error massage at line of executing.
What should I do? I don't know what's happend there cause I check every parameters by breakpoint and saw that every parameters were passed!
|
|
|
|
|
isiran wrote: When I execute insert command, with passing 9 parameters values, by use of executenonguery function I receive "procedure or function "procedure name" has too many argument specified" error massage at line of executing.
What should I do?
Post the code - because we can only guess at the cause of the problem.
isiran wrote: I don't know what's happend there cause I check every parameters by breakpoint and saw that every parameters were passed
Yes, but how many times? The error says "too many" which suggests that the problem isn't that the values are being passed as parameters but "too many" are being passed.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
how can i schedule a job in
SSQL 2000
job is a stored procedure..
i want to excute it in daily basis
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
this may not be the best way but a thought
write an app - which would just have this one command of stored proc execution.
Then schedule this app using windows scheduler.
|
|
|
|
|
Hey ppl, can anyone explain me this code.
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER FUNCTION dbo.JoinBase(@JID INT) RETURNS VARCHAR(200)
AS
BEGIN
DECLARE @JEX VARCHAR(200),
@Qualification VARCHAR(20)
DECLARE c1 CURSOR LOCAL FAST_FORWARD FOR
select enb from I_EM inner join Ew on I_EM.e_id=Ew.e_id and empid=@JID
ORDER BY e_name
OPEN c1
WHILE (@@FETCH_STATUS = 0)
BEGIN
FETCH c1 INTO @Qual
IF (@@FETCH_STATUS = 0)
BEGIN
SET @JEX = IsNull(@JEX + ',', '') + @Qual
END
END
CLOSE c1
RETURN @JEX
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
and what does this ISNULL do????
pls help somebuddy..
|
|
|
|
|
John Mecas wrote: can anyone explain me this code
It produces a comma separated list of all the data in the enb returned by the query.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
hey thanks for response..but can u explain it in some more details..... I knew it concats the values.
|
|
|
|
|
-- Alter an existing function called JoinBase
-- It takes an integer as a parameter called @JID
-- It will return a VARCHAR with a maximum size of 200 characters.
ALTER FUNCTION dbo.JoinBase(@JID INT) RETURNS VARCHAR(200)
AS
BEGIN
-- Two local variables are declared
DECLARE @JEX VARCHAR(200),
@Qualification VARCHAR(20)
-- A cursor is declared.
-- It will return the results of the SELECT statement one row for each loop
DECLARE c1 CURSOR LOCAL FAST_FORWARD FOR
select enb from I_EM inner join Ew on I_EM.e_id=Ew.e_id and empid=@JID
ORDER BY e_name
OPEN c1
-- Loops until the cursor has exhausted all the rows from the SELECT
WHILE (@@FETCH_STATUS = 0)
BEGIN
-- This line won't even compile because @Qual doesn't exist
-- but it is supposed to get the value of enb from the SELECT
-- statement into the local variable @Qual (@Qualification)
FETCH c1 INTO @Qual
-- If the fetch was successful
IF (@@FETCH_STATUS = 0)
BEGIN
-- Append @Qual into the existing list.
-- If the list doesn't exist create one as a blank string
-- The end result is a comma separated list mad up of each
-- @Qualification/@Qual returned from the query.
SET @JEX = IsNull(@JEX + ',', '') + @Qual
END
END
-- Close the cursor
CLOSE c1
-- Returns the result to the caller
RETURN @JEX
END
To me it looks like the cursor is badly used. (Well, using a cursor is bad enough, but there are bits that just don't quite look right). If you want more information on cursors then I expect you can look it up in the documentation - Just search MSDN for it. I don't use cursors if I can help it. They are, occasionally, a necessary evil, but for the most part the should be avoided like the plague.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Maybe this SQL can do the same thing:
select @JEX = isnull(@JEX + ',', '') + enb from I_EM inner join Ew on I_EM.e_id=Ew.e_id and empid=@JID
ORDER BY e_name
If not necessary,do not use CURSOR;P
|
|
|
|
|
That won't work.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
1-we need CURSOR to action row by row "CURSOR giving one record from select statment to effect any thing on record "
2- "Isnull" function contain two parameters the first parameter expressions to check if this expressions have null or not, if the expression have null return second parameters else return value of expressions
if you have more explain about CURSOR tell me plz
Rami Abd Alhalim
|
|
|
|
|
Guys ...
Need help on urgent basis...
I have two tables
CREATE TABLE #T1(id int,Name varchar(10))
insert into #T1 (id,Name) values (1,'Shon')
insert into #T1 (id,Name) values (2,'Julie')
CREATE TABLE #T2(id int,Reason varchar(5))
insert into #T2 (id,Reason) values (1,'X')
insert into #T2 (id,Reason) values (2,'Y')
insert into #T2 (id,Reason) values (1,'Z')
insert into #T2 (id,Reason) values (1,'K')
Now i need output like
Id Name Reason1 Reason2 Reason3 Reason4
1 Shon X Z K Null
2 Julie Y NULL NULL Null
I can restrict upto 4 reasons....
PLEASE PLEASE Help
Thanks!!
|
|
|
|
|
With simple query is not possible. however check this
SET NOCOUNT ON
DECLARE @T1_id AS Int
DECLARE @T1_Name AS Varchar(10)
DECLARE @T2_id AS Int
DECLARE @T2_Reason AS Varchar(5)
DECLARE @qryResult AS Varchar(256)
DECLARE @cnt AS Smallint
IF NOT EXISTS(SELECT * FROM tempdb..sysobjects WHERE name LIKE '#T3[_]%')
CREATE TABLE #T3(id int, Name varchar(10), Reason1 varchar(5),
Reason2 varchar(5), Reason3 varchar(5), Reason4 varchar(5))varchar(5), Reason4 varchar(5))
DELETE FROM #T3
DECLARE CurT1 CURSOR FOR SELECT * FROM #t1
OPEN CurT1
FETCH CurT1 INTO @T1_id, @T1_Name
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO #T3 (id, Name) VALUES(@T1_id, @T1_Name)
SET @cnt = 0
DECLARE CurT2 CURSOR FOR SELECT * FROM #t2 WHERE id = @T1_id
OPEN CurT2
FETCH CurT2 INTO @T2_id, @T2_Reason
WHILE @@FETCH_STATUS = 0
BEGIN
SET @cnt = @cnt + 1
SET @qryResult = 'UPDATE #T3 SET Reason' + Cast(@cnt AS Varchar(10)) + ' = '''
+ @T2_Reason + ''' WHERE id = ' + Cast(@T1_id As Varchar(5))
EXEC (@qryResult)
FETCH CurT2 INTO @T2_id, @T2_Reason
END
CLOSE CurT2
DEALLOCATE CurT2
FETCH CurT1 INTO @T1_id, @T1_Name
END
CLOSE CurT1
DEALLOCATE CurT1
SET NOCOUNT OFF
SELECT * FROM #T3
--SELECT * FROM #T1
--SELECT * FROM #T2
Regards
KP
|
|
|
|
|
Reserved words appears in Blue Color in SQL 2000 !
But in SQL 2005,some of Reserved words appears in Black color itself !
Why?
Eg: VARCHAR()
|
|
|
|
|
Go into the Options and change the font/color appearance to what you want. No big deal. Assuming you are talking about SQL Server Management Studio, black for Identifiers is the default.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Dear Friends,
This is the table I have:
ID Qty
1 3
2 4
3 7
4 2
5 1
I want to Select Group of rows those Total Qty is equal to 10.
ie.
ID Qty
Group1 3
Group1 7
Group2 3
Group2 4
Group2 2
Group2 1
Group3 7
Group3 2
Group3 1
Please help me.
Thanks
Raghavendra Hegde.
|
|
|
|
|
To solve this problem you have to Stored procedure .
so not have any group in sql can giving this result
Rami Abd Alhalim
|
|
|
|
|
Hi friend,
Here i am send u a query which is help to get the value by group. i used a table called newtable with the field of empid,empnum where empid is varchar n empnum is int. Now i used inerjoint to find the group value for each giving datas of empnum
"select t1.empid from newtable as t1 inner join (select empid from newtable where empnum=2) as t2 on t1.empid=t2.empid"
I this may solution for ur question.
If u got anything pls reply me.........
Senthil S
Software Engineer
|
|
|
|
|
declare @empid as int
select @empId=isnull(max(empId),100)+1 from tbltempemployee
select @empid
Hi this command will generate empid like
101
102 like...,
Suppose to need some alphabet letter before the empid..,
How to do that?,
Suppose before empid i like to generate "L" char value...,
It will be like this one...,
L101
L102 like...,
How to metion the "L" char before the empId in Auto generation
Regards,
Magi
|
|
|
|