User Profile
Collapse
-
Heap table.......... ............... ............... .... -
xml datatype in sql serevr??
Hi,
Can any one give a explanation about xml datatype.
How and where it can be used.
Ganesh -
I need all the Table, SP, View, Schema scripts.
So, using this scripts i want to execute in another server. My requirement is i need to generate a DB script file which should be executed in another server. So, while executing the script the database also must created with tables, SP, View, Schema etc..Leave a comment:
-
@@Rowcount - Returns the number of rows affected by the last statement.
For Example.
If Table1 Has 20 rows in the DB.
If we execute the query as below
select * from Table1
Print @@Rowcount
Now the above stmt returns 20 rows, so the count will be 20.
GaneshLeave a comment:
-
I already read it,
I need a scenario where it is used and how it is used...
Ganesh...Leave a comment:
-
What is @@SPID??
Hello..
Can any one give me brief explaination regarding @@SPID.
And where we have to use it and to use it..
Ganesh -
SELECT dbo.POD.POD_Pur chOrderID, dbo.POD.POD_POL ineNbr, dbo.POI.POI_Sta tusCode,
dbo.ProjectGrou p.PRJG_ProjectI D, dbo.POI.POI_Ref erence, dbo.POI.POI_Ite mName,
dbo.POI.POI_Uni tMeasure, dbo.POD.POD_Req uiredDate, dbo.POD.POD_Pro miseDate,
dbo.POR.POR_Rec eiverDate, dbo.POD.POD_Req uiredQty, dbo.POR.POR_Rec eiptQty, dbo.POD.POD_POU nitPrice,
dbo.POD.POD_POU nitPrice...Leave a comment:
-
Hello,
How the COALESCE works??
i=COALESCE(id,m yid)
i=id, if id has any value
i=myid, if id is null
so, based on this you try....
I given one example below try this...
declare @t1 Table (id int, id1 int)
insert into @t1 (id,id1)
select 1,2 union all
select 2,2 union all
select 3,3 union all
select 4,4
declare @t2 Table...Leave a comment:
-
Hello,
I am not very clear with your question, and can you send me the error what u are getting.
My suggestion is to declare both the cursors first on the top. And store the @Fetch_Status variable in temporary local variable.
GaneshLeave a comment:
-
Hello
Try this..
select country,
IsNull(A,0) as A,
IsNull(B,0) as B,
-- My code
case when isnull(B,0) < = 0 then C else C End as 'C'
from <Table-name>
If this is not ok, please explain me clearly i write and give u...
GaneshLeave a comment:
-
The main difference between @@SCOPE_IDENTIT Y and @@IDENTITY is
@@SCOPE_IDENTIT Y - Gets identity value for the last executed SQL statement with in the scope. Its a local variable
@@IDENTITY - Its a global variable. For the last executed statement if you have any trigger/function then after that stmt executed, it returns that stmts executed identity value.
Based on your requirement you use those variblesLeave a comment:
-
Its a SP error, which i did mistake..
Can u tell the procedure to generate script, i need to have script like this...
I should not even create a new database, the script should have create new database also..
Can u pls tell me...Leave a comment:
-
How can i have a copy of entire databse with out data??
Hi all,
Using generate scripts i generated the database script file and executed,
i got an error.
How to copy the entire database without data.
Can any one help me..
Ganesh -
select max(cnt) from
(
select count(*) as cnt
from dbo.TrendCLUBS
group by Club_HomeColor
) aLeave a comment:
-
ganeshkumar08 replied to getting max count - error: error aggregate function calls may not be nestedin SQL ServerCode:select max(cnt) from ( select count(*) as cnt from dbo.TrendCLUBS group by Club_HomeColor ) a
Last edited by acoder; Feb 1 '13, 01:43 PM.Leave a comment:
-
select e1.sal, e1.name from emp e1
where (N-1) = (select count(distinct e2.sal) from emp e2 where e1.sal > e2.sal
from emp e2)
Where N=Nth highest salaryLeave a comment:
-
How to retrieve the database which is deleted??
Hi all,
Can i know how to retrieve the database which is deleted without knowing.
I deleted one database, now i dont know how to retrieve it..
Can any one help me..
Thanks
Ganesh -
Deleteing the duplicate Records
SET ROWCOUNT 1
delete from dbo.[User]
where ID IN (select id from dbo.[User]
group by(id) having(count(id ) > 1))
WHILE @@rowcount > 0
BEGIN
delete from dbo.[User]
where ID IN (select id from dbo.[User]
group by(id) having(count(id ) > 1))
END
SET ROWCOUNT 0
The above query is for deleting the duplicate records. It is working well.
I got this query... -
INSERT, UPDATE clause inside UDF
Hi SQL friends,
My doubt is can we INSERT , UPDATE clauses inside function..
if yes can u give an example function..
Ganesh Kumar -
In SQL Server BEFORE INSERT OR UPDATE TRIGGER is available?
If available means can u give me a sample code.....Leave a comment:
No activity results to display
Show More
Leave a comment: