Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Monday, March 26, 2012

OH NO! Please help!

One of my IT guys "disabled" the "BUILTIN\Administrator" account in SQL
server and now we can't connect to the server using Enterprise Manager.
None of the other logins have administration privileges.
How can we either re-enable the account or get administrative access to
SQL server?
--DaveIf you are running in mixed security mode you can use sa.
Christian Smith
"Dave Navarro" <dave@.dave.dave> wrote in message
news:MPG.1a96f8a675e3bc62989785@.news-40.giganews.com...
> One of my IT guys "disabled" the "BUILTIN\Administrator" account in SQL
> server and now we can't connect to the server using Enterprise Manager.
> None of the other logins have administration privileges.
> How can we either re-enable the account or get administrative access to
> SQL server?
> --Dave|||In article <elZTG3m8DHA.2752@.TK2MSFTNGP09.phx.gbl>, csmith@.digex.com
says...
> If you are running in mixed security mode you can use sa.
Tried it and it didn't work.
I had already installed Service Pack 3, but I don't think it was 3a.
The knowledge base seems to indicate that re/installing the service pack
will enable/create the BUILTIN/Administrator account.
Is that correct?
--Dave|||Also, is it the BUILTIN\Administrator user or the BUILTIN\Administrators
group? If it is the user than the group should still be there unless
removed. What about the user that SQL is running under? Was it explicitly
given access or was it using the BUILTIN access?
"Dave Navarro" <dave@.dave.dave> wrote in message
news:MPG.1a96f8a675e3bc62989785@.news-40.giganews.com...
> One of my IT guys "disabled" the "BUILTIN\Administrator" account in SQL
> server and now we can't connect to the server using Enterprise Manager.
> None of the other logins have administration privileges.
> How can we either re-enable the account or get administrative access to
> SQL server?
> --Dave|||SP3 and SP3a are pretty much the same. 3a is only there if you couldn't get
3 to install. Which article said you the SP would fix this? Do you have a
link? Also, how did sa not work? What did you try to do? The
BUILTIN\Adminsitrators is completely different from SQL security model that
sa uses. If you have the password you should be able to access the system
using SA.
Christian Smith
"Dave Navarro" <dave@.dave.dave> wrote in message
news:MPG.1a96fd2a91bf5623989786@.news-40.giganews.com...
> In article <elZTG3m8DHA.2752@.TK2MSFTNGP09.phx.gbl>, csmith@.digex.com
> says...
> > If you are running in mixed security mode you can use sa.
> Tried it and it didn't work.
> I had already installed Service Pack 3, but I don't think it was 3a.
> The knowledge base seems to indicate that re/installing the service pack
> will enable/create the BUILTIN/Administrator account.
> Is that correct?
> --Dave|||http://support.microsoft.com/search/default.aspx?
InCC_hdn=true&Catalog=LCID%3D1033%26CDID%3DEN-US-KB%26PRODLISTSRC%
3DON&withinResults=&QuerySource=gASr_Query&Product=sql2k&Queryc=builtin%
5Cadministrator&Query=builtin%
5Cadministrator&KeywordType=ALL&maxResults=150
&Titles=false&numDays=&InCC=on
I looked over most of the articles in this query and almost every single
one of them says to install/re-install the service pack to fix security
problems.
My train of thought was to try it and see what happens...
--
I was able to get in using info from the following article:
http://www.microsoft.com/sql/techinfo/tips/administration/May3.asp
We're back up and running now.
Thanks for taking the time to help, it's deeply appreciated.
--Dave
In article <eG76HDn8DHA.3404@.TK2MSFTNGP09.phx.gbl>, csmith@.digex.com
says...
> SP3 and SP3a are pretty much the same. 3a is only there if you couldn't get
> 3 to install. Which article said you the SP would fix this? Do you have a
> link? Also, how did sa not work? What did you try to do? The
> BUILTIN\Adminsitrators is completely different from SQL security model that
> sa uses. If you have the password you should be able to access the system
> using SA.
> Christian Smith
> "Dave Navarro" <dave@.dave.dave> wrote in message
> news:MPG.1a96fd2a91bf5623989786@.news-40.giganews.com...
> > In article <elZTG3m8DHA.2752@.TK2MSFTNGP09.phx.gbl>, csmith@.digex.com
> > says...
> > > If you are running in mixed security mode you can use sa.
> >
> > Tried it and it didn't work.
> >
> > I had already installed Service Pack 3, but I don't think it was 3a.
> > The knowledge base seems to indicate that re/installing the service pack
> > will enable/create the BUILTIN/Administrator account.
> >
> > Is that correct?

OH NO! Please help!

One of my IT guys "disabled" the "BUILTIN\Administrator" account in SQL
server and now we can't connect to the server using Enterprise Manager.
None of the other logins have administration privileges.
How can we either re-enable the account or get administrative access to
SQL server?
--DaveIf you are running in mixed security mode you can use sa.
Christian Smith
"Dave Navarro" <dave@.dave.dave> wrote in message
news:MPG.1a96f8a675e3bc62989785@.news-40.giganews.com...
> One of my IT guys "disabled" the "BUILTIN\Administrator" account in SQL
> server and now we can't connect to the server using Enterprise Manager.
> None of the other logins have administration privileges.
> How can we either re-enable the account or get administrative access to
> SQL server?
> --Dave|||In article <elZTG3m8DHA.2752@.TK2MSFTNGP09.phx.gbl>, csmith@.digex.com
says...
> If you are running in mixed security mode you can use sa.
Tried it and it didn't work.
I had already installed Service Pack 3, but I don't think it was 3a.
The knowledge base seems to indicate that re/installing the service pack
will enable/create the BUILTIN/Administrator account.
Is that correct?
--Dave|||Also, is it the BUILTIN\Administrator user or the BUILTIN\Administrators
group? If it is the user than the group should still be there unless
removed. What about the user that SQL is running under? Was it explicitly
given access or was it using the BUILTIN access?
"Dave Navarro" <dave@.dave.dave> wrote in message
news:MPG.1a96f8a675e3bc62989785@.news-40.giganews.com...
> One of my IT guys "disabled" the "BUILTIN\Administrator" account in SQL
> server and now we can't connect to the server using Enterprise Manager.
> None of the other logins have administration privileges.
> How can we either re-enable the account or get administrative access to
> SQL server?
> --Dave|||SP3 and SP3a are pretty much the same. 3a is only there if you couldn't get
3 to install. Which article said you the SP would fix this? Do you have a
link? Also, how did sa not work? What did you try to do? The
BUILTIN\Adminsitrators is completely different from SQL security model that
sa uses. If you have the password you should be able to access the system
using SA.
Christian Smith
"Dave Navarro" <dave@.dave.dave> wrote in message
news:MPG.1a96fd2a91bf5623989786@.news-40.giganews.com...
> In article <elZTG3m8DHA.2752@.TK2MSFTNGP09.phx.gbl>, csmith@.digex.com
> says...
> Tried it and it didn't work.
> I had already installed Service Pack 3, but I don't think it was 3a.
> The knowledge base seems to indicate that re/installing the service pack
> will enable/create the BUILTIN/Administrator account.
> Is that correct?
> --Dave|||http://support.microsoft.com/search/default.aspx?
InCC_hdn=true&Catalog=LCID%3D1033%26CDID%3DEN-US-KB%26PRODLISTSRC%
3DON&withinResults=&QuerySource=gASr_Query&Product=sql2k&Queryc=builtin%
5Cadministrator&Query=builtin%
5Cadministrator&KeywordType=ALL&maxResults=150
&Titles=false&numDays=&InCC=on
I looked over most of the articles in this query and almost every single
one of them says to install/re-install the service pack to fix security
problems.
My train of thought was to try it and see what happens...
I was able to get in using info from the following article:
http://www.microsoft.com/sql/techin...ration/May3.asp
We're back up and running now.
Thanks for taking the time to help, it's deeply appreciated.
--Dave
In article <eG76HDn8DHA.3404@.TK2MSFTNGP09.phx.gbl>, csmith@.digex.com
says...
> SP3 and SP3a are pretty much the same. 3a is only there if you couldn't g
et
> 3 to install. Which article said you the SP would fix this? Do you have
a
> link? Also, how did sa not work? What did you try to do? The
> BUILTIN\Adminsitrators is completely different from SQL security model tha
t
> sa uses. If you have the password you should be able to access the system
> using SA.
> Christian Smith
> "Dave Navarro" <dave@.dave.dave> wrote in message
> news:MPG.1a96fd2a91bf5623989786@.news-40.giganews.com...

Friday, March 23, 2012

Office Interop Assemblies and SSIS

Hi guys,

I'm trying to write an SSIS script that will create an excel file and append data to it.

I downloaded the Office 2007 PIAs (Primary Interop Assemblies) and installed them on my desktop PC where i'm developing from.

However, and even though the assemblies are in the GAC, they don't appear when you look in "Add Reference" for your script task.

If i create a standard .NET web or windows app and try to "Add Reference" I can find them there.

Am I missing anything obvious?

Thanks for your help in advance

Mike

Do you have the Visual Studio Tools for Office 2007 installed?

Just curious, why create the excel file in the script task?

|||

Mike_Gaziotis wrote:

Hi guys,

I'm trying to write an SSIS script that will create an excel file and append data to it.

I downloaded the Office 2007 PIAs (Primary Interop Assemblies) and installed them on my desktop PC where i'm developing from.

However, and even though the assemblies are in the GAC, they don't appear when you look in "Add Reference" for your script task.

If i create a standard .NET web or windows app and try to "Add Reference" I can find them there.

Am I missing anything obvious?

Thanks for your help in advance

Mike

This should help.

VSA requires DLLs to be in the Microsoft.Net folder (but not all the time)

(http://blogs.conchango.com/jamiethomson/archive/2005/11/02/SSIS_3A00_-VSA-requires-DLLs-to-be-in-the-Microsoft.Net-folder-_2800_but-not-all-the-time_2900_.aspx)

-Jamie

|||

The VSA designer's "Add Reference" dialog does not look for assemblies in the GAC but only in the %ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies and %windir%\Microsoft.NET\Framework\v2.0.50727

We recomend that you copy them to the SQL server location pointed above for the "Add Reference" to work.

|||Thanks very much Jamie and Silviu!
Putting the DLLs in the .NET Folder seems to have done the trick.

In response to jwelch's question: I would have used the standard Data Flow task but it didn't seem to support some of the functionality i needed (ie dynamically building the file path and file name based on content etc)

Thanks again guys

Mike
|||

Actually, that sounds like a great opportunity to use variables or expressions. If you describe your scenario a little more, perhaps there might be some alternative approaches.

Not trying to change your mind on direction, just want to make sure you know what options are available.

|||Hi Jwelch,

Always keen to find out if there are more approaches that i haven't considered. Even if they're not used in this scenario it's good to know of the possibilites

Here are my SSIS job requirements:
- Execute (several) SQL queries which retrieve report data
- Insert the data in worksheets of several excel files
- Save the files by:
a: Putting a timestapt in their name (ie reportA_04072007)
b: storing them in different locations on the server based on the report
(ie %Reports%/ReportA/reportA_04072007.xls)
- Send mails with excel files attached

This is to be a scheduled job managed by the SQL server agent.

It's not a job of enormous complexity i must admit, but i somehow i found myself (perhaps because of me being a developer rather than a DBA by nature) more keen to write code than having to use loops, data flow tasks and all the rest. In fact when i first had the problem with the assemblies i half considered writing a windows app that would do that job and then run that from the sql server agent. And really, is there such a big difference between writing an app or a script-only SSIS job?

Thanks and sorry for the babble
Mike

Wednesday, March 21, 2012

Odd SQL IN usage?

Hi guys,

Got an odd SQL string that I need to produce that is most probably simple to
construct but with it being hot in our office, I simply can't get my head
around it...!!

Its based around an online emailing facility whereby multiple hotels can be
emailed via a single application. Users within the application have access
rights to email only specific hotels.

The tables are laid out like this (irrelevant columns left out)...

CampaignID, CampaignName, CampaignHotelIDs
1 Test Campaign 1,4,5,7,9
2 Test Campaign2 1,2

UserID, UserName, UserHotelIDAccess
1 Test User 1,6,7
2 Test User 2,7

Now on the stats page I want to give users access to view ONLY sent
campaigns to which they have access to view, I was considering the IN SQL
statement to achieve something like this...

'WHERE CampaignHotelIDs IN UserHotelIDAcess'

...but that doesn't want to work, can anyone give me any ideas to get this
working within just a single SQL query?

Cheers, @.sh@.sh wrote:

Quote:

Originally Posted by

Hi guys,
>
Got an odd SQL string that I need to produce that is most probably simple to
construct but with it being hot in our office, I simply can't get my head
around it...!!
>
Its based around an online emailing facility whereby multiple hotels can be
emailed via a single application. Users within the application have access
rights to email only specific hotels.
>
The tables are laid out like this (irrelevant columns left out)...
>
CampaignID, CampaignName, CampaignHotelIDs
1 Test Campaign 1,4,5,7,9
2 Test Campaign2 1,2
>
UserID, UserName, UserHotelIDAccess
1 Test User 1,6,7
2 Test User 2,7
>
Now on the stats page I want to give users access to view ONLY sent
campaigns to which they have access to view, I was considering the IN SQL
statement to achieve something like this...
>
'WHERE CampaignHotelIDs IN UserHotelIDAcess'
>
...but that doesn't want to work, can anyone give me any ideas to get this
working within just a single SQL query?


--BEGIN PGP SIGNED MESSAGE--
Hash: SHA1

Your columns "UserHotelIDAccess" and "CampaignHotelIDs" are in violation
of 1NF (First Normal Form) "A cell must be atomic." I.e., there must
only be one item per column. If your data was like this:

CampaignID, CampaignName, CampaignHotelIDs
1 Test Campaign 1
1 Test Campaign 4
1 Test Campaign 5
1 Test Campaign 7
1 Test Campaign 9
2 Test Campaign2 1
2 Test Campaign2 2

UserID, UserName, UserHotelIDAccess
1 Test User 1
1 Test User 6
1 Test User 7
2 Test User 2
2 Test User 7

Your WHERE clause would work like this:

WHERE CampaignHotelIDs = UserHotelIDAccess
--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)

--BEGIN PGP SIGNATURE--
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRK15H4echKqOuFEgEQJqNgCePdnBVao0mJq2YSFXG/GubalXfhMAoNRY
UlESaxNSeKctgZhjJ5pZ1UFV
=kzX+
--END PGP SIGNATURE--|||@.sh (spam@.spam.com) writes:

Quote:

Originally Posted by

Got an odd SQL string that I need to produce that is most probably
simple to construct but with it being hot in our office, I simply can't
get my head around it...!!


It must also have been hot in the office when this was desiged:

Quote:

Originally Posted by

CampaignID, CampaignName, CampaignHotelIDs
1 Test Campaign 1,4,5,7,9
2 Test Campaign2 1,2
>
UserID, UserName, UserHotelIDAccess
1 Test User 1,6,7
2 Test User 2,7


If you are on SQL 2000, this is very painful to work with. If you are on
SQL 2005, it's slightly less painful.

Before I go, which version of SQL Server do you actually have?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications. It is very hard to debug code when you do not let us
see it.

You can immediately improve your database by not allowing the moron
that crammed everything into a single column to write code until he can
explain Normal Forms. I would also inspect everything he has done and
pull it out. That kind of fundamental error tells you what kind of
programmer you have.|||Thanks for your reply, I see what you're suggesting but its too late to
change the overall structure of the table now ;o(

"MGFoster" <me@.privacy.comwrote in message
news:tOerg.596$vO.300@.newsread4.news.pas.earthlink .net...

Quote:

Originally Posted by

>
Your columns "UserHotelIDAccess" and "CampaignHotelIDs" are in violation
of 1NF (First Normal Form) "A cell must be atomic." I.e., there must
only be one item per column. If your data was like this:
>
CampaignID, CampaignName, CampaignHotelIDs
1 Test Campaign 1
1 Test Campaign 4
1 Test Campaign 5
1 Test Campaign 7
1 Test Campaign 9
2 Test Campaign2 1
2 Test Campaign2 2
>
UserID, UserName, UserHotelIDAccess
1 Test User 1
1 Test User 6
1 Test User 7
2 Test User 2
2 Test User 7
>
Your WHERE clause would work like this:
>
WHERE CampaignHotelIDs = UserHotelIDAccess
--
MGFoster:::mgf00 <atearthlink <decimal-pointnet
Oakland, CA (USA)
>
--BEGIN PGP SIGNATURE--
Version: PGP for Personal Privacy 5.0
Charset: noconv
>
iQA/AwUBRK15H4echKqOuFEgEQJqNgCePdnBVao0mJq2YSFXG/GubalXfhMAoNRY
UlESaxNSeKctgZhjJ5pZ1UFV
=kzX+
--END PGP SIGNATURE--

|||"Erland Sommarskog" <esquel@.sommarskog.sewrote in message

Quote:

Originally Posted by

news:Xns97F91FCEE7C9Yazorman@.127.0.0.1...
It must also have been hot in the office when this was desiged:


Well it seemed a good idea at the time, and infact works within the
application itself brilliantly and efficiently without numerous hits on the
DB - however this one element now is proving tricky

We're using SQL 7 so based on what you've said, I guess you can't help ;o)

Cheers, @.sh|||On Fri, 7 Jul 2006 10:46:12 +0100, @.sh wrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

>"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
>news:Xns97F91FCEE7C9Yazorman@.127.0.0.1...
>It must also have been hot in the office when this was desiged:


>
>Well it seemed a good idea at the time, and infact works within the
>application itself brilliantly and efficiently without numerous hits on the
>DB - however this one element now is proving tricky
>
>We're using SQL 7 so based on what you've said, I guess you can't help ;o)


Hi @.sh,

Oh, Erland certainly can help you. Just check out his site:
http://www.sommarskog.se/arrays-in-sql.html#SQL7
--
Hugo Kornelis, SQL Server MVP|||@.sh (spam@.spam.com) writes:

Quote:

Originally Posted by

Quote:

Originally Posted by

>"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
>news:Xns97F91FCEE7C9Yazorman@.127.0.0.1...
>It must also have been hot in the office when this was desiged:


>
Well it seemed a good idea at the time, and infact works within the
application itself brilliantly and efficiently without numerous hits on
the DB - however this one element now is proving tricky
>
We're using SQL 7 so based on what you've said, I guess you can't help
;o)


SQL 7? That will not make it even less painful. :-)

There are two approaches. One is to run a cursor over the rows and
for each row call a stored procedure that unpacks the row into a
table, so that you can run the queries the proper way. You can find
examples of such procedures on my web site:
http://www.sommarskog.se/arrays-in-sql.html#SQL7.

I would in such case such suggest that you put this code in the trigger
on this table, so that you always can work on properly desinged tables.
Overall, you should strive of changing the database design to move away
from this structure. Yes, I see that you in other post said that it's
too late to change the design, but I disagree. Unless the product already
has a declared end of life, it's never too late to change a flat-out
incorrect design like this one.

The other approach is a query similar to:

WHERE ',' + UserHotelIDAcess + ',' LIKE
'%,' + CampaignHotelIDs + ',%'

This theme has some variations, see
http://www.sommarskog.se/arrays-in-sql.html#realslow. All of them are
painfully slow, and could prove unworkable if your data has any volumes.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Saturday, February 25, 2012

odbc problems with Linked server in sql 2005

Hi guys,

I've a Linked server en sql 2000 with oledb provider for odbc drivers (Progress software) to do some queries, and works fine, I m trying to do the same in sql 2005, i set up exactly as i do in sql 2000 but when I try to view the tables: there are nothing the list is missing and obviosly when i try to query, I got errors:

OLE DB provider "MSDASQL" for linked server "test" returned message "[DataDirect-Technologies][ODBC PROGRESS driver]Driver's SQLSetConnectAttr failed.".

OLE DB provider "MSDASQL" for linked server "test" returned message "[DataDirect-Technologies][ODBC PROGRESS driver][PROGRESS]Access denied(Authorisation failed)".

OLE DB provider "MSDASQL" for linked server "test" returned message "[DataDirect-Technologies][ODBC PROGRESS

ex:

works perfectly in sql 2000, not in 2005

SELECT * FROM OPENQUERY (MY_LINKED_SERVER, 'SELECT * FROM AFN_cotizaseguro_rmt')

some body knows if i have to set up additional stuff in sql 2005?

Hi

This seems to be a discussion on ProgressTalk that refers to your problem:

http://www.progresstalk.com/showthread.php?t=103352

If the connection works in the ODBC administrator Test Connection then they seem to suggest checking the security context setting in the security page of the linked servers settings in SQL Management studio.

I hope this is some use to you.

|||

Thank u Dhericean, you really help me, now I 'm working with my linked servers in sql 2005, it was just a click in the security, awesome !!!

Regards

Monday, February 20, 2012

ODBC Isolation level

Hello Guys,

Is there any way I can set up the isolation level on the ODBC settings
I have a MFC application, it connects to the SQLServer 2000 , but I would like to set up the Isolation level to UR (uncommitted read), is this
possible ?

I have tried setting this up by means of the Query analyser but this only work during that session it does not affect any of the others connections to the database.

My app is a involves heavy OLTP transactions and I am performing a pseudo stress testing..

thank you for your helpIt is my understanding that this setting is per session. I asked our specialist the same question (dirty reads will do just fine here for our 'brochure' website but the default is read committed?) and was told that this setting was per session. (more later)|||Originally posted by Hollerith
It is my understanding that this setting is per session. I asked our specialist the same question (dirty reads will do just fine here for our 'brochure' website but the default is read committed?) and was told that this setting was per session. (more later)

hey thanks for your help, in the same topic
can you do this

selec foocolum from footable with (nolock) <-- is this correct

thanks

marcos oliva

ODBC In Stored Procedure

Hey guys,
I'm trying to get the column names from a table to which I'm connected
through OBDC. I don't want to use linked server. I get my data with
Openrowset.
I found the SQLDescribeCol and SQLColumns ODBC functions.
Can anybody tell me how to use those functions in a SQL Server stored
procedure?
Thanks a lotHi Pumkin,
should work as follows
SELECT colId, name,
FROM dbo.sysObjects
WHERE Id = OBJECT_ID('YourTableName')
ORDER BY ColId
HTH ;-)
Gru, Uwe Ricken
MCP for SQL Server 2000 Database Implementation
GNS GmbH, Frankfurt am Main
http://www.gns-online.de
http://www.memberadmin.de
http://www.conferenceadmin.de
________________________________________
____________
dbdev: http://www.dbdev.org
APP: http://www.AccessProfiPool.de
FAQ: http://www.donkarl.com/AccessFAQ.htm|||Hey,
I should explain myself better... I need to get the column names of a
table given as parameter. There is COLUMN_NAME from INFORMATION_SCHEMA
for SQL Server. The problem is that my table is not on my server and is
not a SQL Server table either. I need to access it through ODBC.
Can anybody help? Thanks|||Pumkin wrote:
> Hey,
> I should explain myself better... I need to get the column names of a
> table given as parameter. There is COLUMN_NAME from INFORMATION_SCHEMA
> for SQL Server. The problem is that my table is not on my server and
> is not a SQL Server table either. I need to access it through ODBC.
> Can anybody help? Thanks
It is not possible to use the ODBC functions you mentioned from a stored
procedure which can only run queries via openrowset.
If the table is in a relational database, then it should be possible to run
a query against that database to get the column names. Without more specific
information, it is impossible to go into details. Maybe you should try a
newsgroup devoted to the rdbms you are linking to.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.|||Hy Bob,
Thanks for the reply. The database that I am connecting to in not
relational. But I found something now...
It works if I do "select * from table where 1=2"
But I was looking for something more dynamically build.|||Pumkin wrote:
> Hy Bob,
> Thanks for the reply. The database that I am connecting to in not
> relational. But I found something now...
> It works if I do "select * from table where 1=2"
> But I was looking for something more dynamically build.
I'm not sure how that helps you: your t-sql code is not going to be able to
read those column names. I was thinking that you needed your code to somehow
use those column names for something.
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

ODBC in Stored Procedure

Hey guys,

I'm trying to get the column names from a table to which I'm connected
through OBDC. I don't want to use linked server. I get my data with
Openrowset.
I found the SQLDescribeCol and SQLColumns ODBC functions.
Can anybody tell me how to use those functions in a SQL Server stored
procedure?

Thanks a lotPumkin (PopClaudia@.gmail.com) writes:
> I'm trying to get the column names from a table to which I'm connected
> through OBDC. I don't want to use linked server. I get my data with
> Openrowset.
> I found the SQLDescribeCol and SQLColumns ODBC functions.
> Can anybody tell me how to use those functions in a SQL Server stored
> procedure?

You can't. Well, you could write an extended stored procedure or an
OLE object that you could call from a stored procedure, and that would
use these functions.

However, it would be more straight forward to query the system catalog
on the remote server directly.

What exactly are you trying to achieve?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx