Viewing 15 posts - 2,401 through 2,415 (of 2,458 total)
Expanding on mohankollu's solution... You can get this returned as text in the result set with
DECLARE @aa table(col varchar(20))
insert into @aa values('100'),('200'),('300'),('400'),('500');
WITH t(col) AS
(
SELECT col+','
FROM @aa FOR...
August 21, 2012 at 3:26 pm
ashwinboinala (8/21/2012)
i have an issue Subscriber DB size is growing larger than Publisher , publisher db is 21gb , but subscriber db is 72 gb i am using...
August 21, 2012 at 11:38 am
There are many, many ways to procuce each result set. For the first one you could use UNION (not UNION ALL).
August 21, 2012 at 11:29 am
Can you post some ddl? how many rows are in these tables? It would be helpful to understand your indexes, contraints, etc.
August 21, 2012 at 11:14 am
GilaMonster (8/20/2012)
That query returns the total size of the DB files. A backup does not back up the entire file, just the used portion of...
August 20, 2012 at 6:00 pm
This will tell you the minimum size (the size of your MDF and NDF files). The backup, unless compressed, will never be less than this.
USE {myDB};
SELECT SUM(size/128) AS mb...
August 20, 2012 at 4:03 pm
Transaction log maintenance can be a drag. The stairway about this topic is great.
August 20, 2012 at 3:48 pm
Beginner2012 (6/8/2012)
Hello,can we create a SQL server table on a PC based on a query on the sql server ?
Thank you
edited... Misunderstood your question.
... Perhaps some more detail would...
August 16, 2012 at 6:27 pm
TRY/CATCH is traditionally used more for stuff like this:
SET NOCOUNT ON;
DECLARE @pos TABLE (sale_id varchar(4), product_id int)
DECLARE @err varchar(200)
BEGIN TRY
INSERT INTO @pos VALUES ('ccc', 'a')
END TRY
BEGIN CATCH
--...
August 16, 2012 at 3:23 pm
Read, read, read: books online, a web page or blog...
Practice, practice, practice...
Microsoft E-learning, plenty of free stuff there. Go to products > SQL Server. There's tons of free...
August 16, 2012 at 2:26 pm
First, being a DBA and a SQL developer is an excellent experience on bothaccounts. This is also a great time as there is a HUGE shortage of DBAs and Database...
August 7, 2012 at 12:16 am
Kirby1367 (8/3/2012)
August 3, 2012 at 4:32 pm
I agree with everyone re: "Why the big ol' index?"
Do you have any idea how many reads this table gets vs writes?
If the index is not used often...
August 3, 2012 at 3:16 pm
Here is my solution:
DECLARE @i varchar(50)='122333444455555';
WITH val(x,n) AS
(
SELECT LEFT(@i,LEN(@i)),'0'
UNION ALL
SELECT LEFT(x,LEN(x)-1),RIGHT(x,1) FROM val WHERE LEN(x)>0
)
SELECT SUM(CAST(n AS int)) FROM val
What's cool is you can replace SELECT SUM(CAST(n...
August 3, 2012 at 2:59 pm
SomewhereSomehow (8/3/2012)
Here is my solution
declare @i int = 985;
with nums(n) as(select n from (values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10))nums(n))
select sum(convert(int,substring(convert(varchar(10),@i),n,1)))
from nums where n <= len(convert(varchar(10),@i))
This is good. A couple things to note:
First, the...
August 3, 2012 at 2:43 pm
Viewing 15 posts - 2,401 through 2,415 (of 2,458 total)