Showing posts with label method. Show all posts
Showing posts with label method. Show all posts

Wednesday, March 28, 2012

How can I read type of all fields in joined query?

How can I read type of all fields in joined query?

Is there a stored procedure method to use for this purpose?

Thanks

What language needs to know this? c#/VB? T-Sql?

If c#/vb, and you are loading things into a DataTable, the meta-data is available in the DataTable object. I suspect it's availabe in DataReaders, etc.

|||

Hi David,

I need T-SQL stored procedure that gave me type of all fields in a joined query.

Thanks for your help

|||

create procedure get_stuff

as

begin

select col_1, col_2, col_3 from some_table
union
select col_a, col_b, col_c from some_other_table


end

That's the basic syntax. Check the manual for how to add parameters if needed.

how can i read data from Spreadsheet (Excell) to SQL Server 2000?

i have data on a spreadsheet and i need to read it to a table in SQL server ? how can i do that ? some one refere to me a method for that but i need to see what other think is the best option and the most effecienet way let us say!!

Depend on Excel file structure
if it is fixed - like a table - then use jet (if you doing it from within asp.net app).
if it is not fixed use excel object model

if youi want to do it from within sql server (without application services) then simple use dts package..

|||

You can use DTS to transfer the data from excell to SQL Server.

|||

Try the thread below for code using Excel as linked server. Hope this helps.

http://forums.asp.net/1019602/showpost.aspx

|||can you give me a link or a solution for all cases whether from asp.net or from sql server !!? thanks

Friday, March 23, 2012

How can I place a value from a dataset into the page header?

Hello,

I know that I can do it through:

1. A hidden parameter

2. Report Items

The first method is not good for my report because I have another application that renders the report to a PDF.

And the second method I cannot refer more than one report item and I need to refer two items.

Is there any other method that I can use?

Thanks,

Abdel

Abdel,

I believe that those are your only options, I use the parameter trick and I'm able to export successfully to PDF. Can you state why this is failing?

Ham

Friday, February 24, 2012

How can I get the files under a special directory on a remote sql server?

we can get directory information by EnumDirectories method of sql server
object from a remote sql server, but how can I get the files under a special
directory on a remote sql server?
I tried finding result in MSDN, but I can't get it. Any one can help me?
Thanks in advance.
Bill WhiteBill White wrote:
> we can get directory information by EnumDirectories method of sql
> server object from a remote sql server, but how can I get the files
> under a special directory on a remote sql server?
> I tried finding result in MSDN, but I can't get it. Any one can help
> me?
> Thanks in advance.
> Bill White
From SQL Server?
Exec master..xp_cmdshell N'DIR C:\MyFolder\*.*'
You can create a temp table and insert the results of xp_cmdshell into
the temp table for processing if you need to. If this is SQL 2005, then
xp_cmdshell could be disabled on the server.
David Gugick
Quest Software
www.imceda.com
www.quest.com|||It's a good idea, but I have another question about it.
Does SQL Server do it in this manner? or does it by another unopened method?
Thanks a lot.
Bill White
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:u4i%23wJL9FHA.2816@.tk2msftngp13.phx.gbl...
Bill White wrote:
> we can get directory information by EnumDirectories method of sql
> server object from a remote sql server, but how can I get the files
> under a special directory on a remote sql server?
> I tried finding result in MSDN, but I can't get it. Any one can help
> me?
> Thanks in advance.
> Bill White
From SQL Server?
Exec master..xp_cmdshell N'DIR C:\MyFolder\*.*'
You can create a temp table and insert the results of xp_cmdshell into
the temp table for processing if you need to. If this is SQL 2005, then
xp_cmdshell could be disabled on the server.
David Gugick
Quest Software
www.imceda.com
www.quest.com