Posts

Showing posts from July, 2005

SQL Server 2005 Reserved Keywords

Image
Reserved Keywords are part of the grammar of the Transact-SQL language used by SQL Server to parse and understand Transact-SQL statements and batches. Although it is syntactically possible to use SQL Server reserved keywords as identifiers and object names in Transact-SQL scripts, this can be done only using delimited identifiers. It is recommended to not use the reserved keywords as identifiers or object names. more

SQLCMD Utility in Yukon

Image
SQLCMD is DOS command prompt utility introduced in 2005 that supersedes isql.exe and osql.exe. Like isql and osql, SQLCMD.exe can be used to execute T-SQL statements and scripts. Unlike isql and osql, SQLCMD has extensive support for scripting and variables. SQLCMD.exe uses OLE DB to connect and execute the T-SQL batches. more Another example

Yukon - SQL Server 2005

Image
Time to move to new SQL server . You can either download Yukon or order from microsoft. Some good links about sql 2005 online books and additional tools . Another good article on Yukon, SQLOS .

Toad for SQL Server on USB

Image
I use this tool to connect to sql server. It works without any kind of install on the client computer. Its similar to ms sql querry analyzer. Attached image shows how to connect to the server etc. Download Toad. More USB Tools Links .

Simple sql server monitoring

This query shows any process thats running more than 30 secs. SELECT spid, cmd, status, loginame, open_tran, datediff(s, last_batch, getdate ()) AS [WaitTime(s)] FROM master..sysprocesses p WHERE open_tran > 0 AND spid > 50 AND datediff (s, last_batch, getdate ()) > 30 ANd EXISTS (SELECT * FROM master..syslockinfo l WHERE req_spid = p.spid AND rsc_type <> 2) This query shows if a process is running more that 10 secs. SELECT spid, waittime, lastwaittype, waitresource FROM master..sysprocesses WHERE waittime > 10000 -- The wait time is measured in milliseconds AND spid > 50 you can kill the process with command - kill [spid]

Command line with sql

isqlw -S [server name] -d [database name] -U [user name] -P [password] C:\>isqlw -S [server name] -d [database name] -U [user name] -P [password] -i "c:\project\sql\emp.sql" -o "c:\project\sql\test.csv" With this command line sql example you can run a sql command from dos prompt and send output to a file.