<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marcus Nyberg &#187; SQL-server</title>
	<atom:link href="http://www.marcusnyberg.com/category/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcusnyberg.com</link>
	<description>Digital and dangerous</description>
	<lastBuildDate>Mon, 26 Jul 2010 11:00:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Query designer in management studio sql server 2005</title>
		<link>http://www.marcusnyberg.com/2008/04/17/query-designer-in-management-studio-sql-server-2005/</link>
		<comments>http://www.marcusnyberg.com/2008/04/17/query-designer-in-management-studio-sql-server-2005/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 08:58:44 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[SQL-server]]></category>

		<guid isPermaLink="false">http://www.marcusnyberg.com/2008/04/17/query-designer-in-management-studio-sql-server-2005/</guid>
		<description><![CDATA[I have been using Management Studio for SQL-server 2005 for a while now. However, I have never really liked it because of the really strange user interface. Compared to the simple Enterprise manager I first thought that Management studio was a nightmare. But I guess it takes some time to get used to&#8230; I have [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using Management Studio for SQL-server 2005 for a while now. However, I have never really liked it because of the  really strange user interface. Compared to the simple Enterprise manager I first thought that Management studio was a nightmare. But I guess it takes some time to get used to&#8230;</p>
<p>I have searched for a simple and quick way to start the query designer. I only want to do a couple of querys and exit. In enterprise manager you only had to browse for a table, right click it and choose open table -> query. The same procedure in management studio takes a lot more clicks and is not worth the effort.</p>
<p>Today I found <a href="http://www.mssqltips.com/tip.asp?tip=1086">this post</a> which describes how to access the query designer in SQL-server 2005 Management studio in a quick way. I also found out that it had a lot more features than the earlier version. That&#8217;s really good. </p>
<p>How to access the query designer the fastest way:</p>
<p>1. Start Management studio and connect to server.<br />
2. Browse for the database and select it.<br />
3. Press Ctrl+N for a new query window.<br />
4. Press Ctrl+Shift+Q to get the query designer.<br />
5. Rock on.</p>
<p>This is a great feature that is added to what previously was named &#8221;Query analyzer&#8221;. The results of these queries are however not editable like they were in Enterprise managers query designer. I guess I have to through the &#8221;open table&#8221; (and get all rows) procedure for that functionality. That is really strange, why couldn&#8217;t thay have left the &#8221;open table -> query&#8221; option?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusnyberg.com/2008/04/17/query-designer-in-management-studio-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shrinking ALL Truncate Log Files</title>
		<link>http://www.marcusnyberg.com/2007/12/13/shrinking-all-truncate-log-files/</link>
		<comments>http://www.marcusnyberg.com/2007/12/13/shrinking-all-truncate-log-files/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 14:48:49 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[SQL-server]]></category>

		<guid isPermaLink="false">http://www.marcusnyberg.com/2007/12/13/shrinking-all-truncate-log-files/</guid>
		<description><![CDATA[The transaction logs on your SQL-server can fill up a lot of disk space. In my case, I monthly needed to truncate all the log files from the databases that I get from our production environment. These log files are really huge. I need to truncate them because I do not need the logs on [...]]]></description>
			<content:encoded><![CDATA[<p>The transaction logs on your SQL-server can fill up a lot of disk space. In my case, I monthly needed to truncate all the log files from the databases that I get from our production environment. These log files are really huge. I need to truncate them because I do not need the logs on my development machine. I made this little T-SQL script to make my (and your) life easier.</p>
<pre>declare @db varchar(300)
declare @logname as varchar(300)
declare @sql nvarchar(1000)

declare cDB cursor for
SELECT name from master..sysdatabases sdb
WHERE sdb.name NOT IN('master','model','pubs','msdb')
ORDER BY name

open cDB
fetch cDB into @db

while (@@fetch_status = 0)
begin

--print @db
SET @sql='SELECT @logname=name FROM '+@db+'.dbo.Sysfiles WHERE fileid=2'
--print @sql
EXEC sp_executesql @sql,N'@logname varchar(300) out,@db varchar(300)',@logname out,@db
--print @logname

SET @sql='Use '+@db+';'
SET @sql=@sql+'Backup Log '+@db+' with truncate_only;'
SET @sql=@sql+'DBCC shrinkfile ('+@logname+', 2);'
--print @sql
EXEC sp_executesql @sql,N'@logname varchar(300)',@logname

fetch cDB into @db
end
close cDB
deallocate cDB
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.marcusnyberg.com/2007/12/13/shrinking-all-truncate-log-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
