Viewing 15 posts - 1 through 15 (of 22 total)
In this article you'll find methods hos to share data between procedures:
April 29, 2009 at 5:44 am
There are some functions, you can use. Choose appropriate one:
declare @i int
declare @f float
set @f = 3.789
set @i = cast(@f as int)
select @i
set @i = round(@f,...
February 18, 2009 at 1:58 am
manjulaatapattu (2/16/2009)
MachineName Varchar(50),
EntryTime DateTime
within one minutes around 500 records get inserted to this table., so I need to get
count of records inserted last min,count of...
February 17, 2009 at 1:03 am
SET @query = '
SELECT
ID
, Email
, Class
, Session
, Quantity
FROM
TEST
WHERE
Session IN (''' + @Session + ''')'
February 13, 2009 at 5:47 am
ALZDBA (2/11/2009)
How about using
select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
from information_schema.tables
where table_type = 'BASE TABLE'
order by table_schema, table_name
But it's good only for the actual database, isn't it? So, there is no...
February 11, 2009 at 5:50 am
You can use an undocumented stored procedure sp_msforeachdb:
EXEC sp_msforeachdb 'select * from sys.tables'
or, if you need one resulset:
select Replicate(' ', 128) DB, * into #temp from sys.tables
delete #temp
exec sp_msforeachdb...
February 11, 2009 at 5:32 am
SET @Text = 'Line 1' + Char(13) + Char(10) + 'Line 2'
February 9, 2009 at 3:48 am
Why don't you use IF Statement?
DECLARE @var INT
DECLARE @ID_MIN INT
DECLARE @ID_MAX INT
SET @var = 5
IF @var < 20
BEGIN
SET @ID_MIN = @var
SET @ID_MAX = @var
END
ELSE
BEGIN
SET...
February 5, 2009 at 5:59 am
Yes, you can.
CREATE FUNCTION [dbo].[Sign]
(
@C Char(1)
)
RETURNS int AS
BEGIN
declare @I int
IF @C = 'S'
set @I = 1
ELSE
set @I = -1
Return @I
END
January 2, 2009 at 3:38 am
ankur (12/24/2008)
but the column contains True,False & NULL value and i want all rows which doesn't contain True value.
Where Coalesce(CancelFlag, 0) = 0
December 24, 2008 at 3:24 am
karthikeyan (12/12/2008)
because it should use the ascii value..so ascii value for b is always greater than ascii value of a...so it will show the first part...
but in my...
December 12, 2008 at 7:34 am
karthikeyan (12/12/2008)
but if i don't have index...or if we dont have ordered result set....what will happen? it leads to wrong result set. Am i right ?
Try this:
IF 'b' > 'a'
...
December 12, 2008 at 7:17 am
And here is one more option:
select cast(Floor(cast(Getdate() as float)) as datetime)
December 2, 2008 at 7:55 am
You can use a ROW_NUMBER function.
UPDATE T
SET [Field] = Row_num
FROM
YourTable T
INNER JOIN
(SELECT [PrimaryKey], ROW_NUMBER() OVER (ORDER BY PrimaryKey) Row_num...
December 2, 2008 at 6:16 am
1. You check the system views, whether the column exists on the table, if yes -- OK.
2. If the column does not exists you check for it in your mapping...
December 2, 2008 at 3:01 am
Viewing 15 posts - 1 through 15 (of 22 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy