Viewing 12 posts - 1,036 through 1,048 (of 1,048 total)
Hi,
It should be
UPDATE table_name
SET RefreshDate = '20120822 08:00';
rather than
UPDATE cjs
SET RefreshDate = '20120822 08:00';
else it will throw error
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 5, 2012 at 1:56 am
Hi,
I run the similar query and I didnt get the any error.
create procedure abc as
select x.id,y.name1 from name1 x
inner join Practice.dbo.name1 y ON x.id=y.ID
Command executed successfully
EXEC abc
Result- it returns the...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 5, 2012 at 1:48 am
Hi vivek,
SELECT SUBSTRING(ageatdeath,0,CHARINDEX('Y',ageatdeath,0)) AS AGE_VAL,
SUBSTRING(ageatdeath,CHARINDEX('Y',ageatdeath,0),LEN(ageatdeath)) AS AGE_UNIT
this code also works fine.
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 5, 2012 at 1:38 am
You haven't specify the length of datatype in "DECLARE @myVariable AS varchar" that's why it is giving 1 as output.
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 4, 2012 at 12:24 am
how Casting or converting a string literal behaves returning 30 characters.
this is the only thing on which am stuck..
plz explain
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 3, 2012 at 6:17 am
How in case of
LEN(CONVERT(VARCHAR,@a)) AS 'Converted'
, LEN(CAST(@a AS VARCHAR)) AS 'Cast'
It is returning 30?
Can you plz exlpain.
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 3, 2012 at 4:04 am
declare @a varchar(5)='56767'
select LEN(@a)
It will result into 56767.
DECLARE @a VARCHAR ='xyz'
SELECT
LEN(@a) AS 'Declared'
, LEN(CONVERT(VARCHAR,'xyz')) AS 'Converted'
, LEN(CAST('xyz' AS VARCHAR)) AS 'Cast'
When we use...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 3, 2012 at 3:37 am
thanks Kingston..
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 3, 2012 at 1:19 am
can anyone explain me why select len(@a) as 'declared' gives output as 1
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 2, 2012 at 11:31 pm
I have a table CityMaster, LocationMaster and Location table from another database. In LocationMaster CityID (int) is stored while in Citymaster (CityID, CityName, StateID) fields are stored, in Location CityName...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 2, 2012 at 1:57 am
Thanks
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 2, 2012 at 1:33 am
DECLARE @Date1 DATETIME = '2012-08-28 11:53:00'
select cast(@Date1 AS int)
It gives the result 41147. Can anyone tell me how this conversion is done.
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 2, 2012 at 12:25 am
Viewing 12 posts - 1,036 through 1,048 (of 1,048 total)