Showing posts with label friends. Show all posts
Showing posts with label friends. Show all posts

Monday, March 26, 2012

Retriieve table names

Hi friends,
How to retrieve all the tables in the database that is having primary key. I
also want to retrieve the foreign key tables with their parent table.
Thanks
vanithaoops ..take this link :)
http://www.dandyman.net/SQL/downloads.aspx
Dandy Weyn
[MCSE-MCSA-MCDBA-MCDST-MCT]
http://www.dandyman.net
Check my SQL Server Resource Pages at http://www.dandyman.net/sql
"Vanitha" <Vanitha@.discussions.microsoft.com> wrote in message
news:701F4FBD-7537-44B9-9C8D-600744CB013B@.microsoft.com...
> Hi friends,
> How to retrieve all the tables in the database that is having primary key.
> I
> also want to retrieve the foreign key tables with their parent table.
> Thanks
> vanitha|||Sysobjects contains objects stored in every user database.
You can join with sysconstraints and sysforeignkeyconstraints that are
having relationship with the Sysobjects table on the object_id
On Microsoft Website you can look for the SQL System table help file.
I also created a link for it on my website in the download section.
http://www.dandyman.net/sql/downloads.asp
This file might also be VERY useful for future system table querying
--
Dandy Weyn
[MCSE-MCSA-MCDBA-MCDST-MCT]
http://www.dandyman.net
Check my SQL Server Resource Pages at http://www.dandyman.net/sql
"Vanitha" <Vanitha@.discussions.microsoft.com> wrote in message
news:701F4FBD-7537-44B9-9C8D-600744CB013B@.microsoft.com...
> Hi friends,
> How to retrieve all the tables in the database that is having primary key.
> I
> also want to retrieve the foreign key tables with their parent table.
> Thanks
> vanitha|||Vanitha
try this
sp_msforeachtable @.command1 = "sp_helpconstraint '?' "
Regards
R.D
"Vanitha" wrote:

> Hi friends,
> How to retrieve all the tables in the database that is having primary key.
I
> also want to retrieve the foreign key tables with their parent table.
> Thanks
> vanitha|||Vanitha
SELECT Table_Name
FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
WHERE OBJECTPROPERTY(OBJECT_ID(CONSTRAINT_NAME
),
'IsPrimaryKey') = 1
"Vanitha" <Vanitha@.discussions.microsoft.com> wrote in message
news:701F4FBD-7537-44B9-9C8D-600744CB013B@.microsoft.com...
> Hi friends,
> How to retrieve all the tables in the database that is having primary key.
> I
> also want to retrieve the foreign key tables with their parent table.
> Thanks
> vanitha|||Vanitha
see message pane besides grid pane for foreign key references when you
execute that
Regards
R.D
"R.D" wrote:
> Vanitha
> try this
> sp_msforeachtable @.command1 = "sp_helpconstraint '?' "
> Regards
> R.D
> "Vanitha" wrote:
>

Tuesday, March 20, 2012

Retrieving image from database

Dear Friends,

I have read many solution over the net, but since I am unable to utilize anyone according to my needs I am seeking help from you people.

I have a table imagedata in sql server 2005 having fields name and imageperson. Name is string and imageperson is Image field. I have successfully stored name of the person and his image in database.

I have populated the dataset from codebehind and bind it to the repeater.

By writing <%#DataBinder.Eval(Container.DataItem,"name")%>

I am a able to retrieve the name of the person. But when I pass photodata as

<%#photogen((DataBinder.Eval(Container.DataItem,"imageperson")))%>

where photogen is function in code behind having structure

public void photogen(byte[] dataretrieved)

{

Response.BinaryWrite(datarerieved)

}

But it is giving error at <%#photogen((DataBinder.Eval(Container.DataItem,"imageperson")))%>

The best overloaded method match for '_Default.photogen(byte[])' has some invalid arguments

AND

Cannot convert object to byte[].

Can anyone please provide me working solution with code for aspx page and code behind.

Thanks and regards

Have a look at the sample projects at:

http://www.codeproject.com/aspnet/EasyThumbs.asp

Wednesday, March 7, 2012

Retrieve Query

Hi Friends,
I had written a complex SQL query through SQL Query Analyzer, and had
executed the same by pressing F5 button. Before I could save that query on my
PC, my computer switched off.
By any chance is it possible to retrieve the complex query executed by me ?
If yes then how ?
Thanks and Regards,
AmitUnfortunately, you will have to use your skills to recreate that query. QA
does not have to ability, like the browser, to 'remember' the last thing we
typed in.
Be sure that you have that auto-shut down mechanism turned off next time. I
would absolutely hate it if "my computer switched off" without my telling to
it to do so.
--
Arnie Rowland
"To be successful, your heart must accompany your knowledge."
"Amit20" <Amit20@.discussions.microsoft.com> wrote in message
news:B7C8A4E4-3B96-4541-AA99-0F1EF2828B77@.microsoft.com...
> Hi Friends,
> I had written a complex SQL query through SQL Query Analyzer, and had
> executed the same by pressing F5 button. Before I could save that query on
> my
> PC, my computer switched off.
> By any chance is it possible to retrieve the complex query executed by me
> ?
> If yes then how ?
> Thanks and Regards,
> Amit|||You can not get the query back once it's done running. But let's say while
the query was running your computer got shut down and you had an option to
connect through another machine to same SQL instance then you could use the
following to get the query:
DBCC InputBuffer(spid)
It displays only first 255 characters of your query...
Bob
"Arnie Rowland" wrote:
> Unfortunately, you will have to use your skills to recreate that query. QA
> does not have to ability, like the browser, to 'remember' the last thing we
> typed in.
> Be sure that you have that auto-shut down mechanism turned off next time. I
> would absolutely hate it if "my computer switched off" without my telling to
> it to do so.
> --
> Arnie Rowland
> "To be successful, your heart must accompany your knowledge."
>
> "Amit20" <Amit20@.discussions.microsoft.com> wrote in message
> news:B7C8A4E4-3B96-4541-AA99-0F1EF2828B77@.microsoft.com...
> > Hi Friends,
> >
> > I had written a complex SQL query through SQL Query Analyzer, and had
> > executed the same by pressing F5 button. Before I could save that query on
> > my
> > PC, my computer switched off.
> >
> > By any chance is it possible to retrieve the complex query executed by me
> > ?
> > If yes then how ?
> >
> > Thanks and Regards,
> > Amit
>
>|||Or profiler was running, or ...
But for all practical purposes, the OP is SOL.
--
Arnie Rowland
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Bob" <Bob@.discussions.microsoft.com> wrote in message
news:DC9E8CBA-5BD2-480C-8B53-E332F1CB3FEE@.microsoft.com...
> You can not get the query back once it's done running. But let's say while
> the query was running your computer got shut down and you had an option to
> connect through another machine to same SQL instance then you could use
> the
> following to get the query:
> DBCC InputBuffer(spid)
> It displays only first 255 characters of your query...
>
> Bob
> "Arnie Rowland" wrote:
>> Unfortunately, you will have to use your skills to recreate that query.
>> QA
>> does not have to ability, like the browser, to 'remember' the last thing
>> we
>> typed in.
>> Be sure that you have that auto-shut down mechanism turned off next time.
>> I
>> would absolutely hate it if "my computer switched off" without my telling
>> to
>> it to do so.
>> --
>> Arnie Rowland
>> "To be successful, your heart must accompany your knowledge."
>>
>> "Amit20" <Amit20@.discussions.microsoft.com> wrote in message
>> news:B7C8A4E4-3B96-4541-AA99-0F1EF2828B77@.microsoft.com...
>> > Hi Friends,
>> >
>> > I had written a complex SQL query through SQL Query Analyzer, and had
>> > executed the same by pressing F5 button. Before I could save that query
>> > on
>> > my
>> > PC, my computer switched off.
>> >
>> > By any chance is it possible to retrieve the complex query executed by
>> > me
>> > ?
>> > If yes then how ?
>> >
>> > Thanks and Regards,
>> > Amit
>>

Retrieve Query

Hi Friends,
I had written a complex SQL query through SQL Query Analyzer, and had
executed the same by pressing F5 button. Before I could save that query on m
y
PC, my computer switched off.
By any chance is it possible to retrieve the complex query executed by me ?
If yes then how ?
Thanks and Regards,
AmitUnfortunately, you will have to use your skills to recreate that query. QA
does not have to ability, like the browser, to 'remember' the last thing we
typed in.
Be sure that you have that auto-shut down mechanism turned off next time. I
would absolutely hate it if "my computer switched off" without my telling to
it to do so.
Arnie Rowland
"To be successful, your heart must accompany your knowledge."
"Amit20" <Amit20@.discussions.microsoft.com> wrote in message
news:B7C8A4E4-3B96-4541-AA99-0F1EF2828B77@.microsoft.com...
> Hi Friends,
> I had written a complex SQL query through SQL Query Analyzer, and had
> executed the same by pressing F5 button. Before I could save that query on
> my
> PC, my computer switched off.
> By any chance is it possible to retrieve the complex query executed by me
> ?
> If yes then how ?
> Thanks and Regards,
> Amit|||You can not get the query back once it's done running. But let's say while
the query was running your computer got shut down and you had an option to
connect through another machine to same SQL instance then you could use the
following to get the query:
DBCC InputBuffer(spid)
It displays only first 255 characters of your query...
Bob
"Arnie Rowland" wrote:

> Unfortunately, you will have to use your skills to recreate that query. QA
> does not have to ability, like the browser, to 'remember' the last thing w
e
> typed in.
> Be sure that you have that auto-shut down mechanism turned off next time.
I
> would absolutely hate it if "my computer switched off" without my telling
to
> it to do so.
> --
> Arnie Rowland
> "To be successful, your heart must accompany your knowledge."
>
> "Amit20" <Amit20@.discussions.microsoft.com> wrote in message
> news:B7C8A4E4-3B96-4541-AA99-0F1EF2828B77@.microsoft.com...
>
>|||Or profiler was running, or ...
But for all practical purposes, the OP is SOL.
Arnie Rowland
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Bob" <Bob@.discussions.microsoft.com> wrote in message
news:DC9E8CBA-5BD2-480C-8B53-E332F1CB3FEE@.microsoft.com...[vbcol=seagreen]
> You can not get the query back once it's done running. But let's say while
> the query was running your computer got shut down and you had an option to
> connect through another machine to same SQL instance then you could use
> the
> following to get the query:
> DBCC InputBuffer(spid)
> It displays only first 255 characters of your query...
>
> Bob
> "Arnie Rowland" wrote:
>