Hi,
I use nested loop with inner joins to retrieve organization's chart from
EmployeeID-ReportsTo columns.
Our client uses XML and I must send the chart in XML format. How can I
perform this?
Any help would be greatly appreciated.
Leila
Did you look at the details about FOR XML clause in SQL Server Books Online?
Anith
|||Thanks Anith,
But I couldn't use FOR XML for my problem. When I query the sub-employees of
a particular employee, I must keep that in XML format. Then each
sub-employee may have sub-employees itself that should be inserted beneath
the related element.
Maybe I'm using wrong algorithm?
Please help me..
Thanks in advance..
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:uU#JCFr5EHA.3648@.TK2MSFTNGP11.phx.gbl...
> Did you look at the details about FOR XML clause in SQL Server Books
Online?
> --
> Anith
>
|||You will need to do this in your client tool. I suggest you post to a
newsgroup that supports whatever client application you are using.
Bob Barrows
Leila wrote:[vbcol=seagreen]
> Thanks Anith,
> But I couldn't use FOR XML for my problem. When I query the
> sub-employees of a particular employee, I must keep that in XML
> format. Then each sub-employee may have sub-employees itself that
> should be inserted beneath the related element.
> Maybe I'm using wrong algorithm?
> Please help me..
> Thanks in advance..
>
> "Anith Sen" <anith@.bizdatasolutions.com> wrote in message
> news:uU#JCFr5EHA.3648@.TK2MSFTNGP11.phx.gbl...
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Showing posts with label loop. Show all posts
Showing posts with label loop. Show all posts
Monday, March 12, 2012
Retrieving Data in XML Format
Labels:
chart,
client,
columns,
database,
format,
fromemployeeid-reportsto,
inner,
joins,
loop,
microsoft,
mysql,
nested,
oracle,
organizations,
retrieve,
retrieving,
server,
sql,
xml
Retrieving Data in XML Format
Hi,
I use nested loop with inner joins to retrieve organization's chart from
EmployeeID-ReportsTo columns.
Our client uses XML and I must send the chart in XML format. How can I
perform this?
Any help would be greatly appreciated.
LeilaDid you look at the details about FOR XML clause in SQL Server Books Online?
--
Anith|||Thanks Anith,
But I couldn't use FOR XML for my problem. When I query the sub-employees of
a particular employee, I must keep that in XML format. Then each
sub-employee may have sub-employees itself that should be inserted beneath
the related element.
Maybe I'm using wrong algorithm?
Please help me..
Thanks in advance..
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:uU#JCFr5EHA.3648@.TK2MSFTNGP11.phx.gbl...
> Did you look at the details about FOR XML clause in SQL Server Books
Online?
> --
> Anith
>|||You will need to do this in your client tool. I suggest you post to a
newsgroup that supports whatever client application you are using.
Bob Barrows
Leila wrote:
> Thanks Anith,
> But I couldn't use FOR XML for my problem. When I query the
> sub-employees of a particular employee, I must keep that in XML
> format. Then each sub-employee may have sub-employees itself that
> should be inserted beneath the related element.
> Maybe I'm using wrong algorithm?
> Please help me..
> Thanks in advance..
>
> "Anith Sen" <anith@.bizdatasolutions.com> wrote in message
> news:uU#JCFr5EHA.3648@.TK2MSFTNGP11.phx.gbl...
>> Did you look at the details about FOR XML clause in SQL Server Books
>> Online?
>> --
>> Anith
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
I use nested loop with inner joins to retrieve organization's chart from
EmployeeID-ReportsTo columns.
Our client uses XML and I must send the chart in XML format. How can I
perform this?
Any help would be greatly appreciated.
LeilaDid you look at the details about FOR XML clause in SQL Server Books Online?
--
Anith|||Thanks Anith,
But I couldn't use FOR XML for my problem. When I query the sub-employees of
a particular employee, I must keep that in XML format. Then each
sub-employee may have sub-employees itself that should be inserted beneath
the related element.
Maybe I'm using wrong algorithm?
Please help me..
Thanks in advance..
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:uU#JCFr5EHA.3648@.TK2MSFTNGP11.phx.gbl...
> Did you look at the details about FOR XML clause in SQL Server Books
Online?
> --
> Anith
>|||You will need to do this in your client tool. I suggest you post to a
newsgroup that supports whatever client application you are using.
Bob Barrows
Leila wrote:
> Thanks Anith,
> But I couldn't use FOR XML for my problem. When I query the
> sub-employees of a particular employee, I must keep that in XML
> format. Then each sub-employee may have sub-employees itself that
> should be inserted beneath the related element.
> Maybe I'm using wrong algorithm?
> Please help me..
> Thanks in advance..
>
> "Anith Sen" <anith@.bizdatasolutions.com> wrote in message
> news:uU#JCFr5EHA.3648@.TK2MSFTNGP11.phx.gbl...
>> Did you look at the details about FOR XML clause in SQL Server Books
>> Online?
>> --
>> Anith
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Labels:
chart,
client,
columns,
database,
employeeid-reportsto,
format,
inner,
joins,
loop,
microsoft,
mysql,
nested,
oracle,
organizatio,
retrieve,
retrieving,
server,
sql,
xml
Friday, March 9, 2012
Retrieving ALL Object Privs for ALL Users in ALL Databases
Hi All,
Does someone have a procedure that will loop through ALL databases and get
the object priviledges for ALL users in the database?
Thanks...MHi
From Aaron Bertrand
This will only cover those who have
been explicitly given access to the procs using GRANT.
DECLARE @.username VARCHAR(32)
SELECT @.username = '?'
SELECT o.name, CanExec = CASE WHEN p.id = o.id THEN 'Yes' ELSE 'No' END
FROM sysobjects o LEFT OUTER JOIN syspermissions p
ON o.id = p.id
AND p.grantee = USER_ID(@.username)
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:OPhCB0$VFHA.2684@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> Does someone have a procedure that will loop through ALL databases and get
> the object priviledges for ALL users in the database?
> Thanks...M
>|||Hi,
Execute SP_helprotect from Query Analyzer. This will give you the full
permission for all users in a database. If you have multiple database then
either execute the stored procedure sepeeately for each databases or write a
script to fire this procedure for all databases.
Thanks
Hari
SQL Server MVP
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:OPhCB0$VFHA.2684@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> Does someone have a procedure that will loop through ALL databases and get
> the object priviledges for ALL users in the database?
> Thanks...M
>
Does someone have a procedure that will loop through ALL databases and get
the object priviledges for ALL users in the database?
Thanks...MHi
From Aaron Bertrand
This will only cover those who have
been explicitly given access to the procs using GRANT.
DECLARE @.username VARCHAR(32)
SELECT @.username = '?'
SELECT o.name, CanExec = CASE WHEN p.id = o.id THEN 'Yes' ELSE 'No' END
FROM sysobjects o LEFT OUTER JOIN syspermissions p
ON o.id = p.id
AND p.grantee = USER_ID(@.username)
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:OPhCB0$VFHA.2684@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> Does someone have a procedure that will loop through ALL databases and get
> the object priviledges for ALL users in the database?
> Thanks...M
>|||Hi,
Execute SP_helprotect from Query Analyzer. This will give you the full
permission for all users in a database. If you have multiple database then
either execute the stored procedure sepeeately for each databases or write a
script to fire this procedure for all databases.
Thanks
Hari
SQL Server MVP
"Michelle" <smiley2211@.yahoo.com> wrote in message
news:OPhCB0$VFHA.2684@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> Does someone have a procedure that will loop through ALL databases and get
> the object priviledges for ALL users in the database?
> Thanks...M
>
Labels:
database,
databases,
getthe,
loop,
microsoft,
mysql,
object,
oracle,
priviledges,
privs,
procedure,
retrieving,
server,
sql,
users
Tuesday, February 21, 2012
Retrieve date from filename
Hye all,
I need help on this.
Let say my source file in excel format. Currently i'm using foreach loop to execute those source files. The problem is that , i want to retrieve a date from the source(filename) itself. i've tried using derived column. but it doesnt work.
eg: Source file name Email_Jan_05.xls, i want to grab the string JAN and 05 which later i'm going to put it in my database.
any suggestion? Thanks in advance.
Inside foreach loop, insert a script task before the data flow task, create a presedence constraint between them. Inside the script task, obtain the file date and store it in some variable.|||Thanks Michael.
Anyway, do u have any source code / syntax or reference for this?
|||I don't have any code at hand, but look at System.IO.File.GetCreationTime and System.IO.File.GetLastWriteTime (depending on what time you need).
Subscribe to:
Posts (Atom)