Monday, March 26, 2012
how to track object dependencies (view, function). granularity - c
object, to reproduce what it does is not a big deal.
This report provides object names thwe view or function depends on for me
ust fine.
For darta warehouse analysis I need to track down dependencies of a
particular column / all collumns in the view. And the existing oviews are big
time ugly, pages of code (perform not any nicer either).
SQL parses a view and builds all the dependencies, but is there a way to get
ahold of that information somehow?
I mean I have quite a bit of ugly looking views, and the idea of doung it by
hand does not look good, it is one nasty job to be honest.
I looking for means to automat that e, create a report aout column-column
dependencies of a view/function.
Did anyone here do anything similar, knows a tool that does, any other
ideas are very welcome
Thanks, Liliya
I'm not sure if I understood your question 100% but here;s my answer anyway,
hope it helps. You can use the system stored procedure called sp_depends to
get object dependencies
Sincerely,
John K
Knowledgy Consulting
www.knowledgy.org
Atlanta's Business Intelligence and Data Warehouse Experts
"Liliya Huff" <LiliyaHuff@.discussions.microsoft.com> wrote in message
news:92770E4B-F9E1-42EB-B68E-6AD50CABA825@.microsoft.com...
> There is a way in management studio 2005 to get dependencies on a databse
> object, to reproduce what it does is not a big deal.
> This report provides object names thwe view or function depends on for me
> ust fine.
> For darta warehouse analysis I need to track down dependencies of a
> particular column / all collumns in the view. And the existing oviews are
> big
> time ugly, pages of code (perform not any nicer either).
> SQL parses a view and builds all the dependencies, but is there a way to
> get
> ahold of that information somehow?
> I mean I have quite a bit of ugly looking views, and the idea of doung it
> by
> hand does not look good, it is one nasty job to be honest.
> I looking for means to automat that e, create a report aout column-column
> dependencies of a view/function.
> Did anyone here do anything similar, knows a tool that does, any other
> ideas are very welcome
> --
> Thanks, Liliya
>
|||Liliya
I think you need to look at RedGate third party compare product
"Liliya Huff" <LiliyaHuff@.discussions.microsoft.com> wrote in message
news:92770E4B-F9E1-42EB-B68E-6AD50CABA825@.microsoft.com...
> There is a way in management studio 2005 to get dependencies on a databse
> object, to reproduce what it does is not a big deal.
> This report provides object names thwe view or function depends on for me
> ust fine.
> For darta warehouse analysis I need to track down dependencies of a
> particular column / all collumns in the view. And the existing oviews are
> big
> time ugly, pages of code (perform not any nicer either).
> SQL parses a view and builds all the dependencies, but is there a way to
> get
> ahold of that information somehow?
> I mean I have quite a bit of ugly looking views, and the idea of doung it
> by
> hand does not look good, it is one nasty job to be honest.
> I looking for means to automat that e, create a report aout column-column
> dependencies of a view/function.
> Did anyone here do anything similar, knows a tool that does, any other
> ideas are very welcome
> --
> Thanks, Liliya
>
|||I can pull object dependencies easy, as I have mentioned before. sp_depends
is one way to do it. tracing what management studio does pulling dependencies
is another way. Both are easy. It does not return the level of detail I need.
view1.columnXYZ depends on object1.column1 and so on, entire dependency tree
under to the last table/function.column
Thanks, Liliya
"Knowledgy" wrote:
> I'm not sure if I understood your question 100% but here;s my answer anyway,
> hope it helps. You can use the system stored procedure called sp_depends to
> get object dependencies
> --
> Sincerely,
> John K
> Knowledgy Consulting
> www.knowledgy.org
|||Downloaded the tool, got trial expired immediately. interesting product...
I have one of their products, started wondering, how exactly do keep track
of tier licenses etc...
demo video leaves the impression that all it is a gui on top of sp_depends.
I would not buy the product on that video... I mean, no need to get what ms
management studio already has. I do not believe they parse views and
functions from what i have seen so far.
Hope, their sales rep is going to be quick to answer a question of the
existing customer.
Thanks, Liliya
"Uri Dimant" wrote:
> Liliya
> I think you need to look at RedGate third party compare product
|||the tool tracks dependencies on object level only. not granular enough for my
needs.
Thanks, Liliya
"Uri Dimant" wrote:
> Liliya
> I think you need to look at RedGate third party compare product
|||RedGate third party compare product - provides only object level dependencies
confirmed by the vendor
"
We use our own parser to build a schema representation. Unfortunately, SQL
Dependency Tracker will only go down to table/view level, it will not show
you the dependencies at column level.
This is something that lots of customers ask us for so when there is
development work planned for SQL Dependency Tracker this will be a seriously
considered feature. However, I do not have any kind of timescale on this.
"
Any other vendors?
Thanks, Liliya
|||Investigate CAST. Worked with their stuff about 10 years ago but nothing
came close to their ability to track dependencies. Note that it was an
upper 5 to as much as 7 figure product back then. :-)
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Liliya Huff" <LiliyaHuff@.discussions.microsoft.com> wrote in message
news:92770E4B-F9E1-42EB-B68E-6AD50CABA825@.microsoft.com...
> There is a way in management studio 2005 to get dependencies on a databse
> object, to reproduce what it does is not a big deal.
> This report provides object names thwe view or function depends on for me
> ust fine.
> For darta warehouse analysis I need to track down dependencies of a
> particular column / all collumns in the view. And the existing oviews are
> big
> time ugly, pages of code (perform not any nicer either).
> SQL parses a view and builds all the dependencies, but is there a way to
> get
> ahold of that information somehow?
> I mean I have quite a bit of ugly looking views, and the idea of doung it
> by
> hand does not look good, it is one nasty job to be honest.
> I looking for means to automat that e, create a report aout column-column
> dependencies of a view/function.
> Did anyone here do anything similar, knows a tool that does, any other
> ideas are very welcome
> --
> Thanks, Liliya
>
how to track object dependencies (view, function). granularity - c
object, to reproduce what it does is not a big deal.
This report provides object names thwe view or function depends on for me
ust fine.
For darta warehouse analysis I need to track down dependencies of a
particular column / all collumns in the view. And the existing oviews are big
time ugly, pages of code (perform not any nicer either).
SQL parses a view and builds all the dependencies, but is there a way to get
ahold of that information somehow?
I mean I have quite a bit of ugly looking views, and the idea of doung it by
hand does not look good, it is one nasty job to be honest.
I looking for means to automat that e, create a report aout column-column
dependencies of a view/function.
Did anyone here do anything similar, knows a tool that does, any other
ideas are very welcome
--
Thanks, LiliyaI'm not sure if I understood your question 100% but here;s my answer anyway,
hope it helps. You can use the system stored procedure called sp_depends to
get object dependencies
--
Sincerely,
John K
Knowledgy Consulting
www.knowledgy.org
Atlanta's Business Intelligence and Data Warehouse Experts
"Liliya Huff" <LiliyaHuff@.discussions.microsoft.com> wrote in message
news:92770E4B-F9E1-42EB-B68E-6AD50CABA825@.microsoft.com...
> There is a way in management studio 2005 to get dependencies on a databse
> object, to reproduce what it does is not a big deal.
> This report provides object names thwe view or function depends on for me
> ust fine.
> For darta warehouse analysis I need to track down dependencies of a
> particular column / all collumns in the view. And the existing oviews are
> big
> time ugly, pages of code (perform not any nicer either).
> SQL parses a view and builds all the dependencies, but is there a way to
> get
> ahold of that information somehow?
> I mean I have quite a bit of ugly looking views, and the idea of doung it
> by
> hand does not look good, it is one nasty job to be honest.
> I looking for means to automat that e, create a report aout column-column
> dependencies of a view/function.
> Did anyone here do anything similar, knows a tool that does, any other
> ideas are very welcome
> --
> Thanks, Liliya
>|||Liliya
I think you need to look at RedGate third party compare product
"Liliya Huff" <LiliyaHuff@.discussions.microsoft.com> wrote in message
news:92770E4B-F9E1-42EB-B68E-6AD50CABA825@.microsoft.com...
> There is a way in management studio 2005 to get dependencies on a databse
> object, to reproduce what it does is not a big deal.
> This report provides object names thwe view or function depends on for me
> ust fine.
> For darta warehouse analysis I need to track down dependencies of a
> particular column / all collumns in the view. And the existing oviews are
> big
> time ugly, pages of code (perform not any nicer either).
> SQL parses a view and builds all the dependencies, but is there a way to
> get
> ahold of that information somehow?
> I mean I have quite a bit of ugly looking views, and the idea of doung it
> by
> hand does not look good, it is one nasty job to be honest.
> I looking for means to automat that e, create a report aout column-column
> dependencies of a view/function.
> Did anyone here do anything similar, knows a tool that does, any other
> ideas are very welcome
> --
> Thanks, Liliya
>|||I can pull object dependencies easy, as I have mentioned before. sp_depends
is one way to do it. tracing what management studio does pulling dependencies
is another way. Both are easy. It does not return the level of detail I need.
view1.columnXYZ depends on object1.column1 and so on, entire dependency tree
under to the last table/function.column
--
Thanks, Liliya
"Knowledgy" wrote:
> I'm not sure if I understood your question 100% but here;s my answer anyway,
> hope it helps. You can use the system stored procedure called sp_depends to
> get object dependencies
> --
> Sincerely,
> John K
> Knowledgy Consulting
> www.knowledgy.org|||Downloaded the tool, got trial expired immediately. interesting product...
I have one of their products, started wondering, how exactly do keep track
of tier licenses etc...
demo video leaves the impression that all it is a gui on top of sp_depends.
I would not buy the product on that video... I mean, no need to get what ms
management studio already has. I do not believe they parse views and
functions from what i have seen so far.
Hope, their sales rep is going to be quick to answer a question of the
existing customer.
--
Thanks, Liliya
"Uri Dimant" wrote:
> Liliya
> I think you need to look at RedGate third party compare product|||the tool tracks dependencies on object level only. not granular enough for my
needs.
--
Thanks, Liliya
"Uri Dimant" wrote:
> Liliya
> I think you need to look at RedGate third party compare product|||RedGate third party compare product - provides only object level dependencies
confirmed by the vendor
"
We use our own parser to build a schema representation. Unfortunately, SQL
Dependency Tracker will only go down to table/view level, it will not show
you the dependencies at column level.
This is something that lots of customers ask us for so when there is
development work planned for SQL Dependency Tracker this will be a seriously
considered feature. However, I do not have any kind of timescale on this.
"
Any other vendors?
Thanks, Liliya|||Investigate CAST. Worked with their stuff about 10 years ago but nothing
came close to their ability to track dependencies. Note that it was an
upper 5 to as much as 7 figure product back then. :-)
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Liliya Huff" <LiliyaHuff@.discussions.microsoft.com> wrote in message
news:92770E4B-F9E1-42EB-B68E-6AD50CABA825@.microsoft.com...
> There is a way in management studio 2005 to get dependencies on a databse
> object, to reproduce what it does is not a big deal.
> This report provides object names thwe view or function depends on for me
> ust fine.
> For darta warehouse analysis I need to track down dependencies of a
> particular column / all collumns in the view. And the existing oviews are
> big
> time ugly, pages of code (perform not any nicer either).
> SQL parses a view and builds all the dependencies, but is there a way to
> get
> ahold of that information somehow?
> I mean I have quite a bit of ugly looking views, and the idea of doung it
> by
> hand does not look good, it is one nasty job to be honest.
> I looking for means to automat that e, create a report aout column-column
> dependencies of a view/function.
> Did anyone here do anything similar, knows a tool that does, any other
> ideas are very welcome
> --
> Thanks, Liliya
>
Monday, March 12, 2012
how to supress instance name while logging to sql server 2005?
I am using SQL server 2005 express edition on win XP installed on my machine
.
when I use the SQL server Management studio, I have to enter
machinename\SQLExpress .How can I connect using just machinenname and omit
the SQLExpress instancename?what settings do i need to do?
Thanks for your help.
regards,
you indtsll it. You could have changed it during the installation. You can
now only uninstall SQL Express and reintall it as the default instance.
But I would suggest you not to do that and leave it as it is, so that when
you are going for developer edition or any other edition at a later stage,
you might want it to run under default instance.
Hope this helps.
Wednesday, March 7, 2012
How to store S.P scripts in a folder?
Hi
I'm using Microsoft SQL server management studio express 2005.
I’ve a Database with some S.Ps.
How to store those S.P scripts in a folder?
Please advice
Thanks
They will all show up in the GUI under Programmability/Stored Procedures, though you can't actually create custom folders for stored procedures in SSMS although its been put forward as a suggestion for SQL2008.
If you want your sprocs well organised and shared with other people, you may want to consider a source control product such as sourcesafe or clearcase.
HTH!
I know that it will show up in GUI under Programmability/S.P
my question is
I need to store the scripts of all those S.Ps in a Folder created on my Desktop
how?
please advise
Thanks
|||Sorry, i misunderstood your question.
It seems the ability to script out objects in one easy hit has been missed out of SSMS. I would therefore suggest spending some time writing a little SMO script which you can use to script objects to file. Otherwise, its a case of doing each one individually i think.
Do some research into SMO for details on how to program with it.
HTH
|||Hi vijay,
following the step as below:
1. Open SSMS
2. Login SQL Server
3. Make sure you can see the Database that you wanna Script SP.
4. Expand the node to Programmability \ Stored Procedure , then stay the focus on it.
5. After Step 4 you can see SPs list in the right-side window "Summary".
6.Click the first SP , press "Shift" without release.
7.choose the last one SP.
8.punch the mouse 's Right button ,choose the " Script Stored Procedure as →" "Create to →" to Flie.
9.Choose the folder that you wanna store those SPs and press "Save".
10. done.
Hoping it will help u.
Best Regrades,
Hunt.
|||1.You can generate a script and save manually to a folder.
Thanks
Databasetimes.net
|||Thanks Tsai
I followed these steps.
It’s creating one file with all S.P scripts.
Can’t we create a separate file for each & every S.P?
Please advice
Thanks
|||You have to write your own SMO script for this. Its simple; you can do it on your own favorite language(on .NET/C#/VB)
|||
Thanks Mani
I’m very much appreciate if you could provide that SMO script in C#
Thanks
Vijay
|||
hi vijay,
ok,I got your issue.
u don't have to make a SMO.
We can use SSMS DataBase Generate Script Wizard.
1.open SSMS
2.Login SQLServer
3.choose the Databse that you wanna Gen SPs, Stay Focus on the it.
4.With punch mouse Right button → Task → Generate Script
5.Generate Script Wizard will pop up → Choose "Next"
6.make sure Step "Select a DataBase" → that you select at step 3. and Choose "Next"
7.Step "Choose Script Option" → Choose "Next"
if you wanna drop SP before Re-Create SP,u have to Choose "Script Create" = True , "Script Drop" = True
8.Step "Choose Object Types" → Select "Stored Procedure" → Choose "Next"
9.Step "Choose Stored Procedure" → Click "Select All" → Choose "Next"
10.Step "Output Option" → Select " Script to File \ File to generate \ File per Object " → Choose "Next "
11 Step"Script Wizard Summary" → Choose "Finish"
12. Done.
Hoping this can help u.
Best Regrades,
Hunt.
|||Vijay,
This problem has been fixed in SP2. Earlier to sp2 yes it was not possible to script objects in seperate file. Upgrade the system to SP2 and then try. you will be able to script each object in seperate file
Download sp to from here
http://support.microsoft.com/kb/913089/
Madhu
|||Thanks a lot Tsai
I got my answer from your nice reply. This is what I'm expecting.
I marked it as Answer.
With Regards
Vijay
How to store S.P scripts in a folder?
Hi
I'm using Microsoft SQL server management studio express 2005.
I’ve a Database with some S.Ps.
How to store those S.P scripts in a folder?
Please advice
Thanks
They will all show up in the GUI under Programmability/Stored Procedures, though you can't actually create custom folders for stored procedures in SSMS although its been put forward as a suggestion for SQL2008.
If you want your sprocs well organised and shared with other people, you may want to consider a source control product such as sourcesafe or clearcase.
HTH!
I know that it will show up in GUI under Programmability/S.P
my question is
I need to store the scripts of all those S.Ps in a Folder created on my Desktop
how?
please advise
Thanks
|||Sorry, i misunderstood your question.
It seems the ability to script out objects in one easy hit has been missed out of SSMS. I would therefore suggest spending some time writing a little SMO script which you can use to script objects to file. Otherwise, its a case of doing each one individually i think.
Do some research into SMO for details on how to program with it.
HTH
|||Hi vijay,
following the step as below:
1. Open SSMS
2. Login SQL Server
3. Make sure you can see the Database that you wanna Script SP.
4. Expand the node to Programmability \ Stored Procedure , then stay the focus on it.
5. After Step 4 you can see SPs list in the right-side window "Summary".
6.Click the first SP , press "Shift" without release.
7.choose the last one SP.
8.punch the mouse 's Right button ,choose the " Script Stored Procedure as →" "Create to →" to Flie.
9.Choose the folder that you wanna store those SPs and press "Save".
10. done.
Hoping it will help u.
Best Regrades,
Hunt.
|||1.You can generate a script and save manually to a folder.
Thanks
Databasetimes.net
|||Thanks Tsai
I followed these steps.
It’s creating one file with all S.P scripts.
Can’t we create a separate file for each & every S.P?
Please advice
Thanks
|||You have to write your own SMO script for this. Its simple; you can do it on your own favorite language(on .NET/C#/VB)
|||
Thanks Mani
I’m very much appreciate if you could provide that SMO script in C#
Thanks
Vijay
|||
hi vijay,
ok,I got your issue.
u don't have to make a SMO.
We can use SSMS DataBase Generate Script Wizard.
1.open SSMS
2.Login SQLServer
3.choose the Databse that you wanna Gen SPs, Stay Focus on the it.
4.With punch mouse Right button → Task → Generate Script
5.Generate Script Wizard will pop up → Choose "Next"
6.make sure Step "Select a DataBase" → that you select at step 3. and Choose "Next"
7.Step "Choose Script Option" → Choose "Next"
if you wanna drop SP before Re-Create SP,u have to Choose "Script Create" = True , "Script Drop" = True
8.Step "Choose Object Types" → Select "Stored Procedure" → Choose "Next"
9.Step "Choose Stored Procedure" → Click "Select All" → Choose "Next"
10.Step "Output Option" → Select " Script to File \ File to generate \ File per Object " → Choose "Next "
11 Step"Script Wizard Summary" → Choose "Finish"
12. Done.
Hoping this can help u.
Best Regrades,
Hunt.
|||Vijay,
This problem has been fixed in SP2. Earlier to sp2 yes it was not possible to script objects in seperate file. Upgrade the system to SP2 and then try. you will be able to script each object in seperate file
Download sp to from here
http://support.microsoft.com/kb/913089/
Madhu
|||Thanks a lot Tsai
I got my answer from your nice reply. This is what I'm expecting.
I marked it as Answer.
With Regards
Vijay
Friday, February 24, 2012
How to stop the TOP clause being added to query when defining a view
Hi
I've just switched over to SQL2005 Server Management Studio although most of my databases are SQL2000. Apart from noticing that everything takes longer than with Enterprise Manager I have one specific problem.
When I save a view that I have created in the visual toolbox it gets saved with the TOP 100 Percent clause added, even if I take the clause out of the SQL statement it gets put right back in when I save it. This is causing an application which worked fine before to fail with the error "cannot update a view with TOP clause"
Anyone any ideas how I can stop this clause being added?
Many thanks
? Hi Ian, >>Anyone any ideas how I can stop this clause being added? Take out the ORDER BY clause as well. An ORDER BY in a view is only allowed if there is also a TOP clause. Also, the only guaranteed effect the ORDER BY in the view will have is to define what rows to select and what rows to discard for satisfying the TOP requirement. No guarantee is made wrt the order of rows returned, unless you add an ORDER BY to the final SELECT statement you use to query your data. SQL Server 2000 did, usually, return the rows in the order that was specified in the view. New optimizing techniques in SQL Server 2005 have changed that behaviour. -- Hugo Kornelis, SQL Server MVP