Viewing 15 posts - 271 through 285 (of 1,124 total)
I missed mentioning that the query can also be written by excluding the FROM clause
UPDATEdbo.tblCust
SETLAST_NAME = SUBSTRING( FIRST_NAME, CHARINDEX( ' ', FIRST_NAME ) + 1, 100 ) + LAST_NAME,
FIRST_NAME =...
--Ramesh
April 30, 2009 at 8:16 am
Are you sure that the below assignment is correct?
SET tblCust.LAST_NAME = SUBSTRING(FIRST_NAME, CHARINDEX(' ', FIRST_NAME) + 1, 100) + LAST_NAME
You are appending the LAST_NAME value to the extracted substring which...
--Ramesh
April 30, 2009 at 8:05 am
What value do you get in variable intCount? If it returns -1 then it means the recordset object is opened in dynamic mode. Change the CursorType property of...
--Ramesh
April 30, 2009 at 6:39 am
Can you post the errors that you get while executing the package?
--Ramesh
April 30, 2009 at 5:03 am
mathewspsimon (4/30/2009)
Isnt there another way?-Thanks
There can be many other ways, though you should have posted in the correct forum.
This solution assumes that there is only 1 row available for an...
--Ramesh
April 30, 2009 at 5:01 am
shnex (4/30/2009)
But when I run the query...
--Ramesh
April 30, 2009 at 4:49 am
I am not sure this can be done using simple methods, though can be achieved by using complex approaches such as application locks, system tables or ole automation objects. ...
--Ramesh
April 30, 2009 at 4:02 am
Heard about ROW_NUMBER() function in 2005, that's what you require..
IF ( OBJECT_ID( 'tempdb..#Items' ) IS NOT NULL )
DROP TABLE #Items
CREATE TABLE #Items
(
ItemID INT NOT NULL IDENTITY(1,1) PRIMARY KEY CLUSTERED,
ItemName VARCHAR(10)...
--Ramesh
April 30, 2009 at 3:50 am
ezhil (4/30/2009)
Thanks arun.Your third option works for me.:-)
The third option can be re-written as
SELECT * FROM table WHERE ( @A IS NULL OR Col1 = @A )
[/CODE]
--Ramesh
April 30, 2009 at 3:08 am
You can use the reporting services functions such as LEFT & SUBSTRING to display few characters.
--Ramesh
April 30, 2009 at 1:23 am
I am just posting this so it will get you started with some other better solutions than this one.
DECLARE @SomeDate DATETIME
SET @SomeDate = '1-Apr-1986'
; WITH Employees
AS
(
SELECT1 AS EmployeeID, CONVERT( DATETIME,...
--Ramesh
April 21, 2009 at 3:44 am
Here is the script that I use to create linked servers...
DECLARE @strLinkedServer NVARCHAR(100)
SELECT @strLinkedServer = 'Prod2005Server'
EXECUTE master.dbo.sp_dropserver
@server = @strLinkedServer,
@droplogins = 'droplogins'
EXECUTE master.dbo.sp_addlinkedserver
@strLinkedServer,
...
--Ramesh
April 17, 2009 at 6:55 am
RBarryYoung (4/8/2009)
One problem is that you guys are testing against Easy data. Now why don't you try some HARD data:
Barry,
I've tested both of the solutions and unfortunately:doze:...
--Ramesh
April 8, 2009 at 9:32 am
Here is sample for Books online that uses XQuery methods
DECLARE @x xml
-- Replace "!" with " ", as the code formatting eats up the XML
SET @x='!Root>
...
--Ramesh
April 8, 2009 at 8:59 am
Viewing 15 posts - 271 through 285 (of 1,124 total)