Showing posts with label property. Show all posts
Showing posts with label property. Show all posts

Friday, March 23, 2012

please give any example for using UpdateQueryColumns Property

please help me...

what i required is, When a table is updated i want to get the column names
that affected , I think that UpdateQueryColumns Propertey may help me..

If what i am thinking is correct,please specify how to use that propertey,

otherwise specify how i can satisfy my requirement..

Thanks in advance........

Quote:

Originally Posted by ramesh1210

please help me...

what i required is, When a table is updated i want to get the column names
that affected , I think that UpdateQueryColumns Propertey may help me..

If what i am thinking is correct,please specify how to use that propertey,

otherwise specify how i can satisfy my requirement..

Thanks in advance........


create a trigger. use the UPDATE(field) function

Monday, March 12, 2012

Placing Comments In Views

Is it possible to add comment lines to views? I tried using -- and /* . . .
but these lines were removed upon save. I tried using the property window,
but that cleared out my query.
Yes, make sure you have the comment inside the CREATE VIEW, such as
CREATE VIEW v
AS
--MyComment
SELECT 1 AS a
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
> Is it possible to add comment lines to views? I tried using -- and /* . . .
> but these lines were removed upon save. I tried using the property window,
> but that cleared out my query.
|||I did what you suggested, but it still didn't do what I expected. So, I used
a query as simple as yours . . . and it did do what I expected. Could it be
that the comments in the property window don't work on views with UNION
queries?
Just to be clear: If I access the property window within DESIGN mode, the
comments do not appear. But if I access the property box from the list of
all views window, I do see my comment after the CREATE VIEW statement.
"Tibor Karaszi" wrote:

> Yes, make sure you have the comment inside the CREATE VIEW, such as
> CREATE VIEW v
> AS
> --MyComment
> SELECT 1 AS a
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
>
|||Probably some GUI problem with Enterprise Manager. I did a simple test with below view:
CREATE VIEW v2
AS
--MyComment
SELECT 1 AS a
UNION ALL
SELECT 1 AS a
And the comment does not show, as you say. I don't use EM for view design myself. My guess is that
with a more complex query, the parsing that EM does of the view isn't smart enough to extract the
comment. I guess you could call it a bug and open a case with MS for it. I prefer writing the views
from Query analyzer...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:04C89683-D9BF-482A-AFBF-7915F0621F85@.microsoft.com...[vbcol=seagreen]
>I did what you suggested, but it still didn't do what I expected. So, I used
> a query as simple as yours . . . and it did do what I expected. Could it be
> that the comments in the property window don't work on views with UNION
> queries?
> Just to be clear: If I access the property window within DESIGN mode, the
> comments do not appear. But if I access the property box from the list of
> all views window, I do see my comment after the CREATE VIEW statement.
> "Tibor Karaszi" wrote:
|||Just one more note: if I add the comments via script, but then make a change
via EM and/or Visual Studio - saving the changes loses the comment lines.
But thanks, I got what I need . . . I'll just make sure the comments are in
the scripts we deliver to our customers.
"Tibor Karaszi" wrote:

> Probably some GUI problem with Enterprise Manager. I did a simple test with below view:
> CREATE VIEW v2
> AS
> --MyComment
> SELECT 1 AS a
> UNION ALL
> SELECT 1 AS a
> And the comment does not show, as you say. I don't use EM for view design myself. My guess is that
> with a more complex query, the parsing that EM does of the view isn't smart enough to extract the
> comment. I guess you could call it a bug and open a case with MS for it. I prefer writing the views
> from Query analyzer...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> news:04C89683-D9BF-482A-AFBF-7915F0621F85@.microsoft.com...
>

Placing Comments In Views

Is it possible to add comment lines to views? I tried using -- and /* . . .
but these lines were removed upon save. I tried using the property window,
but that cleared out my query.Yes, make sure you have the comment inside the CREATE VIEW, such as
CREATE VIEW v
AS
--MyComment
SELECT 1 AS a
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
> Is it possible to add comment lines to views? I tried using -- and /* . . .
> but these lines were removed upon save. I tried using the property window,
> but that cleared out my query.|||I did what you suggested, but it still didn't do what I expected. So, I used
a query as simple as yours . . . and it did do what I expected. Could it be
that the comments in the property window don't work on views with UNION
queries?
Just to be clear: If I access the property window within DESIGN mode, the
comments do not appear. But if I access the property box from the list of
all views window, I do see my comment after the CREATE VIEW statement.
"Tibor Karaszi" wrote:
> Yes, make sure you have the comment inside the CREATE VIEW, such as
> CREATE VIEW v
> AS
> --MyComment
> SELECT 1 AS a
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
> > Is it possible to add comment lines to views? I tried using -- and /* . . .
> > but these lines were removed upon save. I tried using the property window,
> > but that cleared out my query.
>|||Probably some GUI problem with Enterprise Manager. I did a simple test with below view:
CREATE VIEW v2
AS
--MyComment
SELECT 1 AS a
UNION ALL
SELECT 1 AS a
And the comment does not show, as you say. I don't use EM for view design myself. My guess is that
with a more complex query, the parsing that EM does of the view isn't smart enough to extract the
comment. I guess you could call it a bug and open a case with MS for it. I prefer writing the views
from Query analyzer...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:04C89683-D9BF-482A-AFBF-7915F0621F85@.microsoft.com...
>I did what you suggested, but it still didn't do what I expected. So, I used
> a query as simple as yours . . . and it did do what I expected. Could it be
> that the comments in the property window don't work on views with UNION
> queries?
> Just to be clear: If I access the property window within DESIGN mode, the
> comments do not appear. But if I access the property box from the list of
> all views window, I do see my comment after the CREATE VIEW statement.
> "Tibor Karaszi" wrote:
>> Yes, make sure you have the comment inside the CREATE VIEW, such as
>> CREATE VIEW v
>> AS
>> --MyComment
>> SELECT 1 AS a
>>
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "Jim" <Jim@.discussions.microsoft.com> wrote in message
>> news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
>> > Is it possible to add comment lines to views? I tried using -- and /* . . .
>> > but these lines were removed upon save. I tried using the property window,
>> > but that cleared out my query.
>>|||Just one more note: if I add the comments via script, but then make a change
via EM and/or Visual Studio - saving the changes loses the comment lines.
But thanks, I got what I need . . . I'll just make sure the comments are in
the scripts we deliver to our customers.
"Tibor Karaszi" wrote:
> Probably some GUI problem with Enterprise Manager. I did a simple test with below view:
> CREATE VIEW v2
> AS
> --MyComment
> SELECT 1 AS a
> UNION ALL
> SELECT 1 AS a
> And the comment does not show, as you say. I don't use EM for view design myself. My guess is that
> with a more complex query, the parsing that EM does of the view isn't smart enough to extract the
> comment. I guess you could call it a bug and open a case with MS for it. I prefer writing the views
> from Query analyzer...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> news:04C89683-D9BF-482A-AFBF-7915F0621F85@.microsoft.com...
> >I did what you suggested, but it still didn't do what I expected. So, I used
> > a query as simple as yours . . . and it did do what I expected. Could it be
> > that the comments in the property window don't work on views with UNION
> > queries?
> >
> > Just to be clear: If I access the property window within DESIGN mode, the
> > comments do not appear. But if I access the property box from the list of
> > all views window, I do see my comment after the CREATE VIEW statement.
> >
> > "Tibor Karaszi" wrote:
> >
> >> Yes, make sure you have the comment inside the CREATE VIEW, such as
> >>
> >> CREATE VIEW v
> >> AS
> >> --MyComment
> >> SELECT 1 AS a
> >>
> >>
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://www.solidqualitylearning.com/
> >> Blog: http://solidqualitylearning.com/blogs/tibor/
> >>
> >>
> >> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> >> news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
> >> > Is it possible to add comment lines to views? I tried using -- and /* . . .
> >> > but these lines were removed upon save. I tried using the property window,
> >> > but that cleared out my query.
> >>
> >>
>

Placing Comments In Views

Is it possible to add comment lines to views? I tried using -- and /* . . .
but these lines were removed upon save. I tried using the property window,
but that cleared out my query.Yes, make sure you have the comment inside the CREATE VIEW, such as
CREATE VIEW v
AS
--MyComment
SELECT 1 AS a
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
> Is it possible to add comment lines to views? I tried using -- and /* . .
.
> but these lines were removed upon save. I tried using the property window
,
> but that cleared out my query.|||I did what you suggested, but it still didn't do what I expected. So, I use
d
a query as simple as yours . . . and it did do what I expected. Could it be
that the comments in the property window don't work on views with UNION
queries?
Just to be clear: If I access the property window within DESIGN mode, the
comments do not appear. But if I access the property box from the list of
all views window, I do see my comment after the CREATE VIEW statement.
"Tibor Karaszi" wrote:

> Yes, make sure you have the comment inside the CREATE VIEW, such as
> CREATE VIEW v
> AS
> --MyComment
> SELECT 1 AS a
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> news:53FCF340-8E7A-495C-BD84-0C8A7882B001@.microsoft.com...
>|||Probably some GUI problem with Enterprise Manager. I did a simple test with
below view:
CREATE VIEW v2
AS
--MyComment
SELECT 1 AS a
UNION ALL
SELECT 1 AS a
And the comment does not show, as you say. I don't use EM for view design my
self. My guess is that
with a more complex query, the parsing that EM does of the view isn't smart
enough to extract the
comment. I guess you could call it a bug and open a case with MS for it. I p
refer writing the views
from Query analyzer...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:04C89683-D9BF-482A-AFBF-7915F0621F85@.microsoft.com...[vbcol=seagreen]
>I did what you suggested, but it still didn't do what I expected. So, I us
ed
> a query as simple as yours . . . and it did do what I expected. Could it
be
> that the comments in the property window don't work on views with UNION
> queries?
> Just to be clear: If I access the property window within DESIGN mode, the
> comments do not appear. But if I access the property box from the list of
> all views window, I do see my comment after the CREATE VIEW statement.
> "Tibor Karaszi" wrote:
>|||Just one more note: if I add the comments via script, but then make a change
via EM and/or Visual Studio - saving the changes loses the comment lines.
But thanks, I got what I need . . . I'll just make sure the comments are in
the scripts we deliver to our customers.
"Tibor Karaszi" wrote:

> Probably some GUI problem with Enterprise Manager. I did a simple test wit
h below view:
> CREATE VIEW v2
> AS
> --MyComment
> SELECT 1 AS a
> UNION ALL
> SELECT 1 AS a
> And the comment does not show, as you say. I don't use EM for view design
myself. My guess is that
> with a more complex query, the parsing that EM does of the view isn't smar
t enough to extract the
> comment. I guess you could call it a bug and open a case with MS for it. I
prefer writing the views
> from Query analyzer...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> news:04C89683-D9BF-482A-AFBF-7915F0621F85@.microsoft.com...
>