Viewing 12 posts - 2,026 through 2,037 (of 2,037 total)
Hello James
Why the detour over the line by line cursor?
DECLARE @xml xml
SELECT @xml = BulkColumn FROM OPENROWSET(
BULK 'D:\Temp\Test\test.xml',
SINGLE_BLOB) AS x
SELECT @xml.query('/root/test')
Greets
Flo
March 5, 2009 at 5:03 am
Just write what you said...
DECLARE @datesum TABLE (id tinyint, name VARCHAR(25),sdate DATETIME, edate DATETIME )
INSERT INTO @datesum
SELECT 1,'TestName1','2004-01-25','2005-02-06'
UNION ALL
SELECT 2,'TestName1','2003-07-20','2005-03-18'
UNION ALL
SELECT 3,'TestName1','2002-12-24','2004-03-21'
UNION ALL
SELECT 4,'TestName1','2001-10-27','2003-03-03'
SELECT SUM(DATEDIFF(DAY, sdate, edate)) FROM...
March 5, 2009 at 2:12 am
Hi
So just put the results into a table and return it:
SET NOCOUNT ON
DECLARE @tree TABLE (id INT, parent INT, desp VARCHAR(100))
INSERT INTO @tree VALUES (1, NULL, 'a')
INSERT INTO @tree VALUES...
March 4, 2009 at 4:20 pm
Okay, next try.
If you want the count of visits of your customers within the special_orders use a aggregated sub-query. (In your sample data every customer/location has exactly two entries within...
March 4, 2009 at 4:05 pm
Hi
Since you use your ErrorLog user account for the ConnectionString you have to specify any other user information by your self. If any other user account is connected you can...
March 4, 2009 at 3:52 pm
This example from BOL may solve your problem:
DECLARE @myDoc xml
DECLARE @ProdID int
SET @myDoc = '<Root>
<ProductDescription ProductID="1" ProductName="Road Bike">
<Features>
<Warranty>1 year parts and labor</Warranty>
<Maintenance>3 year parts and labor...
March 4, 2009 at 3:45 pm
Sample:
SET NOCOUNT ON
DECLARE @tree TABLE (id INT, parent INT, desp VARCHAR(100))
INSERT INTO @tree VALUES (1, NULL, 'a')
INSERT INTO @tree VALUES (2, 1, 'b')
INSERT INTO @tree VALUES (3, 2, 'c')
INSERT INTO...
March 4, 2009 at 3:37 pm
As first I would suggest to change the type of your VARCHAR(MAX) column to XML.
Here a little example:
DECLARE @v-2 VARCHAR(MAX)
SET @v-2 = '<Root><Age>45</Age></Root>'
DECLARE @xml XML
SET @xml...
March 4, 2009 at 3:25 pm
You can handle the problem by a little trick. Check the value AND the DATALENGTH (not then LEN). The DATALENGTH of the search criterion still contains the full size.
DECLARE
March 4, 2009 at 3:09 pm
Hello g8r
I'm not sure if I understood, but for the example result of your first post it might be just:
SELECT Visit_Date, COUNT(*)
FROM #Special_Orders
GROUP BY...
March 4, 2009 at 2:54 pm
Oups... did not yet get my breakfast...
Thanks and sorry
Flo
March 4, 2009 at 2:53 am
Yet another way:
DECLARE @excluded_columns TABLE (name SYSNAME)
DECLARE @table_name SYSNAME
DECLARE @columns NVARCHAR(MAX)
SET @table_name = 'Person.Contact'
-- Excluded columns
INSERT INTO @excluded_columns VALUES ('Suffix')
INSERT INTO @excluded_columns VALUES ('rowguid')
SET @columns = ''
SELECT @columns = @columns...
March 4, 2009 at 2:33 am
Viewing 12 posts - 2,026 through 2,037 (of 2,037 total)