I am using Visual Studio 2010 Professional.
I have created a new SQL Server 2008 Database Project, locally applied and deployed a simple scheme and stored procedure. Everything looks as it should until I try to create the unit test by right clicking the stored procedure, is this functionality only supported in Premium and Ultimate?
CREATE FUNCTION [dbo].[Split]
RETURNS @t TABLE
id int identity(1,1),
declare @xml xml
set @xml = N'<root><r>' + replace(@delimited,@delimiter,'</r><r>') + '</r></root>'
insert into @t(val)
r.value('.','varchar(15)') as item
from @xml.nodes('//root/r') as records(r)
Then cross apply to return your desired column. eg.
declare @tmp table (value varchar(100))
insert into @tmp values ('ASD654-100-CCCEEE4444-200-')
insert into @tmp values ('QWEQWEQ-2000-JJJLLL-20-PPPBBMMNN-600-')
cross apply dbo.split(value,'-')
where id = 3
I'm very new to SQL Server 2008, and need a bit of help manipulating numbers.
I've got a int column holding numbers up to 11 digits. I need to do the following manipulation and use it in a SQL query. Basically, the first digit is transfered to the 3rd position on the right side.
The values are variable, there are even records with only a value of 1.