|
|
-
Madhivanan Liked 13 Hours ago through Blogs
As you know, semicolon is used as a statement terminator in almost all RDBMSs. However the usage
of semicolon is optional in SQL Server except a few cases. Here are atleast the three cases
where usage of semicolon is a must
1 At the start of the ...
|
-
Madhivanan Liked 13 Hours ago through Blogs
0
begin
insert into @temp(data)
select substring(@s,1,charindex('~!@#',@s)-1)
set @s=substring(@s,charindex('~!@#',@s)+4,len(@s))
end
insert into @temp(data)
select @s
--Extract the tags
select data from @temp wh...
|
-
Madhivanan Liked 13 Hours ago through Blogs
In my previous post about Removing unwanted characters , I posted a method that used a function
Here is another method that uses Dynamic SQL
declare @data table (data varchar(100))
-- table that has source data
insert @data
select 'tes^@...
|
-
Madhivanan Liked 13 Hours ago through Blogs
One of the new features available in SQL Server 2008 is compressed backup which takes backup of
a database with mimimum possible size. The syntax is
backup database db_name to disk='backup_path'
with init, compression
But this works only in En...
|
|
|
-
Madhivanan Liked 19 Hours ago through Blogs
In this blog post, I explained different uses of GO command
Here is a Fun when you use GO as object name
CREATE PROCEDURE GO
(
@I INT
)
AS
SELECT @I AS number
Well. The procedure is created and let us try to execute
GO 2
W...
|
-
Madhivanan Liked 1 Days ago through Blogs
In this post splitting-csv-to-columns I showed how to split delimited data into multiple columns Simon in his post Set-based-splitting-of-delimited-strings-to-columns showed how to use that in a set based approach which would work on a set of data.In hi...
|
-
Madhivanan Liked 1 Days ago through Blogs
Suppose you have string in csv format and want to split into seperate columns. You can use parsename function as long as you have maximum four values. The following would work for any number of values
declare @s varchar(2000),@data varchar(2000)
...
|
-
Madhivanan Commented 1 Days ago through Blogs
Zubi, Thanks. But it gives the following error
Msg 8114, Level 16, State 5, Line 15
Error converting data type varchar to numeric....
|
|
|