Man..I like "Alt+F1"
Now if have to whine..then I should say.."the F1 key is little too far
from alt key in the keyboard.. ok..I will adjust.. ;)"
Thanks Martin.
-----Original Message-----
From: Martin Eklund
[mailto:mssqldba-ezmlmshield-x23886260.[Email address protected]
Sent: Monday, October 30, 2006 12:15 PM
To: LazyDBA Discussion
Subject: RE: Any rule of thumb?
In MSSQL Query Analyzer, select/mark your table and press "Alt + F1". I
like "desc <table/view>" too.
// Martin
-----Original Message-----
From: Jeff Seeman
[mailto:mssqldba-ezmlmshield-x25798540.[Email address protected]
Sent: den 30 oktober 2006 21:09
To: LazyDBA Discussion
Subject: RE: Any rule of thumb?
Mordechai:
Which do you think is simpler: running your procedure or typing "desc
<table/view>"?
-----Original Message-----
From: Mordechai Danielov [mailto:mssqldba-ezmlmshield-x66202373.[Email
address protected]
Sent: Monday, October 30, 2006 11:54 AM
To: LazyDBA Discussion
Subject: RE: Any rule of thumb?
Don't know much about Oracle and PL/SQL, from the little bit that I do
know about MS SQL here are couple of notes:
7) in SQL Server it's difficult to obtain the structure of a table or
view without using the GUI; in SQL*Plus you can just type "desc <table>"
to see the structure;
it's not so tough, just run this code or something simmilar:
declare @tblName varchar(64)
select @tblName = 'Incident'
select isnull(drvd1.Colid,0) as IsPrimaryKey,
SN.Name as ColumnName,
ST.name as DBType,
CASE
WHEN SN.xtype in (34,35,36,48,52,56,58,61,104,127,173,189,231) THEN
SN.Length
ELSE SN.prec
END as 'Length/Precision',
SN.isnullable as AllowNull,
isnull(SC.text,'') as DefaultValue,
isnull(ST.Collation,'') as Collation
from syscolumns SN JOIN dbo.sysobjects as TN
on SN.[id] = TN.[id]
JOIN dbo.systypes AS ST
on ST.[xusertype] = SN.xtype
LEFT JOIN dbo.syscomments As SC
on sc.[Id] = SN.cDefault
LEFT JOIN (select colId,SK.id
from dbo.sysindexkeys as SK join
sysindexes as SI
on SK.indid = SI.indID
join sysobjects as SO
on SI.[name] = SO.[name]
and SK.id = SO.parent_obj
where SO.xtype = 'PK') drvd1
on drvd1.colId =SN.colId
and drvd1.id = TN.[id]
where SN.id=(select object_id(@tblName))
order by 2
8) SQL Server provides no way to query the data dictionary to see stored
procedure code; in Oracle you can say "select owner,name,line,text from
dba_source where lower(text) like '%<whatever text you're looking for>%'
and you can see every procedure in your instance and lines that contain
that code;
try sp_helptext
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
MS Sql Server LazyDBA home page