|
|
|
|
-
Hari Kumar Commented 10 Months ago through Ask
Got the answer from here..
http://sqlserver2000.databases.aspfaq.com/how-do-i-use-a-variable-in-a-top-clause-in-sql-server.html...
|
-
Hari Kumar Question Asked 10 Months ago through ASK
We can use "Select" as
Select Top 100 * from temp;
But why can't we use a variable instead of number, such as,
Declare @n bigint;
Set @n=100;
Select top @n * from temp;...
|
ask
98
·
2% ·
538
|
|
-
Hari Kumar Posted 10 Months ago through Ask
We can use "Select" as
Select Top 100 * from temp;
But why can't we use a variable instead of number, such as,
Declare @n bigint;
Set @n=100;
Select top @n * from temp;
...
|
-
Hari Kumar Liked 10 Months ago through Just Learned
I recently saw the following code:
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[TableName]')
AND type in (N'U'))
DROP TABLE [dbo].[TableName];
However, this is more complicated than needed. You can j...
|
-
Hari Kumar Learned 10 Months ago through Just Learned
I recently saw the following code:
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[TableName]')
AND type in (N'U'))
DROP TABLE [dbo].[TableName];
However, this is more complicated than needed. You can j...
|
-
Hari Kumar Liked 10 Months ago through Just Learned
I recently saw the following code:
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[TableName]')
AND type in (N'U'))
DROP TABLE [dbo].[TableName];
However, this is more complicated than needed. You can j...
|
-
Hari Kumar Learned 10 Months ago through Just Learned
I recently saw the following code:
IF EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[TableName]')
AND type in (N'U'))
DROP TABLE [dbo].[TableName];
However, this is more complicated than needed. You can j...
|
-
Hari Kumar Liked 12 Months ago through Just Learned
Sometimes when SQL Server is configured to use some port other than default port number (1433), then you may not be able to connect directly in SSMS just by specifying the name of the server in the **Server Name** field in **Connection to Server** di...
|
-
Hari Kumar Learned 12 Months ago through Just Learned
Sometimes when SQL Server is configured to use some port other than default port number (1433), then you may not be able to connect directly in SSMS just by specifying the name of the server in the **Server Name** field in **Connection to Server** di...
|