Viewing 15 posts - 106 through 120 (of 422 total)
Here's a stored procedure that will shred the XML into a table. I had to add a set of <body></body> tags below the root but otherwise your XML parsed perfectly.
[The...
July 8, 2013 at 3:07 pm
Try this:
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL
DROP TABLE #TempTable;
CREATE TABLE #TempTable
(seq_nbr INT IDENTITY(1,1), dx_code1 VARCHAR(6),dx_code2 VARCHAR(6),dx_code3 VARCHAR(6),dx_code4 VARCHAR(6))
INSERT INTO #TempTable (dx_code1,dx_code2,dx_code3,dx_code4)
VALUES('366.16','362.52','370.03','362.52')
--SELECT * FROM #TempTable
IF OBJECT_ID('tempdb..#diag_codes') IS NOT...
July 8, 2013 at 12:59 am
erikd (7/7/2013)
When I run:
select @liststr = coalesce(@liststr+',' ,'') + quotename(column_name)
from [server].j3688802s.information_schema.columns where table_name = 'sample'
print (@liststr)
I get a list of column names like...
July 7, 2013 at 10:51 pm
pdanes (7/5/2013)
July 7, 2013 at 10:40 pm
IF OBJECT_ID('tempdb..#Something') is not null
DROP TABLE #Something
CREATE TABLE #Something
(
ID int,
Employee varchar(20),
Job varchar(20),
StartDate datetime,
EndDate datetime,
Workload int
)
INSERT #Something
SELECT *
FROM (VALUES
(1, 'John Doe', 'HSBC', '01/01/2013', '31/12/2013', 100)
,(2, 'John Doe', 'Vacation', '17/06/2013', '21/06/2013', 100)
,(3,...
July 4, 2013 at 2:06 pm
Parsing addresses (and names) is perhaps one of the trickiest tasks in SQL. There's really no sure fire way to take a name or address that was originally placed in...
July 3, 2013 at 8:37 pm
dhananjay.nagarkar (7/2/2013)
I have requirement - to retrieve order from database that were created before 12:00 AM GMT on June 3, 2013.
I'm using datediff but it is giving...
July 2, 2013 at 9:38 am
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL
DROP TABLE #TempTable
CREATE TABLE #TempTable (
[ID] INT IDENTITY(1,1) NOT NULL,
[SentDate] DATETIME NULL,
PRIMARY KEY (ID))
INSERT INTO #TempTable
SELECT RandomDate
FROM (
...
July 1, 2013 at 6:15 pm
Create some sample data:
IF OBJECT_ID('tempdb..#SampleData') IS NOT NULL
DROP TABLE #SampleData
CREATE TABLE #SampleData (
[ID] INT IDENTITY(1,1) NOT NULL,
[strVal] NVARCHAR(50) NULL,
...
July 1, 2013 at 11:05 am
Maybe this will take you in the right direction. I generated a bunch of random numbers to make a larger sample.
Sample data:
-- [You will need to create some functions to...
June 30, 2013 at 3:04 pm
Vedran Kesegic (6/29/2013)
Also, there is no "end tran" command, you probably meant "commit tran".
You are correct about COMMIT TRAN. It was late after a long day! :blush:
June 30, 2013 at 9:52 am
sankar.nandakumaran (6/28/2013)
I have a table and need insert multiple data into it. First i have delete all data into the table and then insert...
June 29, 2013 at 3:49 am
This is still a work-in-progress and hasn't been tested thoroughly, though it seems to work pretty well. I've been planning to write an article on the proper-casing problem and this...
June 28, 2013 at 6:08 pm
manibad (6/28/2013)
What I need in the end is I have to achieve the Proper case functionality...
June 28, 2013 at 1:11 pm
Very nice! Added to my utility "tool box."
For Caruncles: If you have a situation where your db is running out of alloted space (such as on a 3rd-party shared server)...
June 27, 2013 at 10:25 am
Viewing 15 posts - 106 through 120 (of 422 total)