Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Wednesday, March 28, 2012

Newbie question about installation

Hi,

I have just downloaded SQL Server 2005 Express Edition and am trying to run the setup. I have Windows XP Home Edition SP2 and I have received an error message saying that my operating system does not meet Service Pack level requirements. The documentation on the website shows that my service pack level is correct. Additionally the message suggests that I install the service pack from http://go.microsoft.com/fwlink/?LinkId=50380 but when I select that I get transferred to another web page which is unrelated.

Any ideas?

Did you install the .NET Framework on the machine (.NET 2.0 with additional fixes) ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

I have seen a couple of people asking this question about the service pack, and it was already loaded on... One of the solutions that has been found is to re run the service pack install on the machine, I would try that.

|||Thanks for the suggestion. I have rerun the download and this time I have had no problem.sql

Monday, March 26, 2012

Newbie Question

Hi

I'm working with SQL Express, and this is my first experience with DB, so I'm still learning. I made a rather stupid mistake, and I'm not quite sure how to get out of it. In the process of trying to fix a problem, I changed the default DB in my account to one that it can no longer connect to - for a reason unknown to me. (once I get this cleared up, I'll ask about that.) Now I can't login properly to SQL Express, b/c it can't connect properly.

please help

thanx

Jeffery

hi,

yiu should be able to connect via a system administrator login, bot WinNT trusted authenticated (login in in Windows as a local administrator) or standard SQL Server authenticated (if you enabled mixed security) providing sa login's credentials (userid and password)...

once you connect to SQLExpress, you can modify (via SSMSX) the default database property of the faling login object in the general tab or, executing the

ALTER LOGIN login_name
WITH DEFAULT_DATABASE = new_default_db;

Transact-SQL statement..

regards

|||Thanx...

Duh! - to me - I should have thought of creating another local Admin account.

Thanx - it worked.

Wednesday, March 21, 2012

newbie question

how do I grant a user permission to a database from sql server mgmt studio
express ?
I used admin to create the database, granted the user smith full access to
the directory and files for the database. I tried grant the login id smith
access by simply smith as well as mypc\smith. both were rejected
how should I go about granting user permission?Hi
I don;t use SQL Server 2005 Management Studio Express but this describes how
to do the tasks
http://www.microsoft.com/technet/prodtechnol/sql/2005/mgsqlexpwssmse.mspx
You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
have a large number of logins/users to create.
John
"GS" wrote:
> how do I grant a user permission to a database from sql server mgmt studio
> express ?
> I used admin to create the database, granted the user smith full access to
> the directory and files for the database. I tried grant the login id smith
> access by simply smith as well as mypc\smith. both were rejected
> how should I go about granting user permission?
>
>|||thank you
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:944A0AF9-6167-4698-8610-571B3E8C3148@.microsoft.com...
> Hi
> I don;t use SQL Server 2005 Management Studio Express but this describes
how
> to do the tasks
> http://www.microsoft.com/technet/prodtechnol/sql/2005/mgsqlexpwssmse.mspx
> You may want use SQLCMD and the CREATE LOGIN/CREATE USER commands if you
> have a large number of logins/users to create.
> John
> "GS" wrote:
> > how do I grant a user permission to a database from sql server mgmt
studio
> > express ?
> >
> > I used admin to create the database, granted the user smith full access
to
> > the directory and files for the database. I tried grant the login id
smith
> > access by simply smith as well as mypc\smith. both were rejected
> > how should I go about granting user permission?
> >
> >
> >

Monday, March 19, 2012

Newbie on permissions: ADO.NET, C++.NET, SQL SERVER 2005 EXPRESS, Visual Studio 2005

This is a very basic question, perhaps more of a Windows XP
Professional OS permissions question than a dB or programming
question: how to create and access SQL SERVER databases from an
account other than "Administrator"; for example, from a "Power User"
account?

As anything other than an "Administrator" user (i.e. as a Power User),
I keep getting (when I try from inside of MS Visual Studio 2005
development environment) the error message: "CREATE DATABASE
permission denied in database 'master'

Using the SQL Server Express Surface Area Configuration tool, I set
the parameters below to "enabled" (they were disabled). This only
helped in one respect: now I can create a database with Visual Studio
2005 (using the Server Explorer tool) when logged in as an
"Administrator". But for security reasons (which I'm not even sure
are valid, but at least in my mind they are) I would like to log in as
a Power User.

My configuration: Windows OS on a standalone Pentium 4 PC connected
to the internet--I'm using Visual Studio 2005 and programming in
C#.NET and C++.NET using ADO.NET. I don't need to access any other PC
in any network--I'm just learning the language at this point.

Any ideas? I did remove some prior versions of SQL Server '7' which
helped remove some other unrelated error messages, and, like I say,
from inside the Administrator account I can program and create
databases using the Server Explorer of Visual Studio 2005, but I'd
like to do so from a non-Admin account.

Also whether I can disable some of the parameters below--i.e., do I
really need the "xp_cmdshell" enabled?

Thanks!

RL

Configuring and Managing SQL Server Express
For improved manageability and security, SQL Server 2005 provides
more control over the SQL Server surface area on your system. To
minimize the surface area, the following default configurations have
been applied to your instance of SQL server:

oTCP/IP connections are disabled [changed to enabled]
oNamed Pipes is disabled [changed to enabled]
oSQL Browser must be started manually
oOPENROWSET and OPENDATASOURCE have been disabled
oCLR integration is disabled [changed to enabled]
oOLE automation is disabled [changed to enabled]
oxp_cmdshell is disabled [changed to enabled]

[This works fine but only from inside "Administrator"--RL]raylopez99 (raylopez99@.yahoo.com) writes:

Quote:

Originally Posted by

This is a very basic question, perhaps more of a Windows XP
Professional OS permissions question than a dB or programming
question: how to create and access SQL SERVER databases from an
account other than "Administrator"; for example, from a "Power User"
account?
>
As anything other than an "Administrator" user (i.e. as a Power User),
I keep getting (when I try from inside of MS Visual Studio 2005
development environment) the error message: "CREATE DATABASE
permission denied in database 'master'


That's indeed an issue of SQL Server permissions.

When you are logged in as an Administrator in Windows and connect to
SQL Server, you account maps to BUILTIN\Administrator which has sysadmin
privilege in SQL Server. That is, you can do anything.

WHen you connect with some other Windows user, no get no such extra
thrills, but you need to grant that login rights to do things. For instance

GRANT CREATE DATABASE TO DOMAIN\PowerUser

You can also add that user a role which has the privileges you want,
for instance to the sysadmin role.

--
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|||On Mar 28, 3:45 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

raylopez99 (raylope...@.yahoo.com) writes:


Quote:

Originally Posted by

WHen you connect with some other Windows user, no get no such extra
thrills, but you need to grant that login rights to do things. For instance
>
GRANT CREATE DATABASE TO DOMAIN\PowerUser
>
You can also add that user a role which has the privileges you want,
for instance to the sysadmin role.
>
--
Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se
>


Erland Sommarskog-- thanks.

At the risk of looking even more stupid, if you know of how to "also
add that user a role which has the privileges you want, for instance
to the sysadmin role" within Visual Studio 2005 and/or Windows XP (for
the program SQL Server 2005 Express Edition), please feel free to let
me know. I just want to add the Power User to have Administrator
access for the Visual Studio 2005, when working on ADO.NET (SQL Server
2005), not for all programs, if possible. For now I will simply
program while logged in as an Administrator, which seems to be a good
workaround to my problem.

I've also ordered some books on ADO.NET and SQL SERVER from O'Reilly
and Microsoft Press; if you have any favorites for a C#/C++ programmer
hobbiest, let me know.

RL|||raylopez99 (raylopez99@.yahoo.com) writes:

Quote:

Originally Posted by

At the risk of looking even more stupid, if you know of how to "also
add that user a role which has the privileges you want, for instance
to the sysadmin role" within Visual Studio 2005 and/or Windows XP (for
the program SQL Server 2005 Express Edition), please feel free to let
me know. I just want to add the Power User to have Administrator
access for the Visual Studio 2005, when working on ADO.NET (SQL Server
2005), not for all programs, if possible. For now I will simply
program while logged in as an Administrator, which seems to be a good
workaround to my problem.


Do I understand this correctly that you want your user to have heavy
perms when connected through VS and your application, but not when it's
connected through Management Studio? There is no way you can assign
permissions per application. Permissions are per logins and users.

Of course, it's a legit requirement that a user should only be able to
access objects in the database through the application, as the application
then can control what the user can see and update. There are a couple of
ways to implement this requirement. The method that has been most tested
and rried is to use stored procedures. There are several ways that
permissions can be granted through stored procedures, whereof the most
useful is ownership chaining. If all stored procedures and tables are
owned by dbo, the users only need execute permissions to the stored
procedures.

There are ways to handle this without stored procedures, but I am less
of fond of these methods.

--
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|||On Mar 29, 3:03 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

raylopez99 (raylope...@.yahoo.com) writes:


Quote:

Originally Posted by

>
Do I understand this correctly that you want your user to have heavy
perms when connected through VS and your application, but not when it's
connected through Management Studio? There is no way you can assign
permissions per application. Permissions are per logins and users.
>
Of course, it's a legit requirement that a user should only be able to
access objects in the database through the application, as the application
then can control what the user can see and update. There are a couple of
ways to implement this requirement. The method that has been most tested
and rried is to use stored procedures. There are several ways that
permissions can be granted through stored procedures, whereof the most
useful is ownership chaining. If all stored procedures and tables are
owned by dbo, the users only need execute permissions to the stored
procedures.
>
There are ways to handle this without stored procedures, but I am less
of fond of these methods.
>


Thank you Erland. I see the problem is not as simple as I thought. I
also see I have two problems: one is what you addressed, the other is
more simple: how to use VS2005 from an account other than
"Administrator" when working on databases. So far I've not been able
to figure out this, and only use "Adminstrator" to code. This simple
question can be answered by an experienced user of VS2005, and is to
an extent a trivial question since I can do programming in VS as
"Administrator" (it's annoying to switch users using Windows XP Pro,
but it's only an annoyance, nothing more).

THanks for your help,

RL|||raylopez99 (raylopez99@.yahoo.com) writes:

Quote:

Originally Posted by

Thank you Erland. I see the problem is not as simple as I thought. I
also see I have two problems: one is what you addressed, the other is
more simple: how to use VS2005 from an account other than
"Administrator" when working on databases. So far I've not been able
to figure out this, and only use "Adminstrator" to code.


I did not answer that question, since I was uncertain of the scope of
your question. But it's fairly simple, although there are several options.

One is to enable SQL Server Authentication through Management Studio.
(Right-click the server itself in the Object Explorer, select Properties
and go the the Security tab. You need to restart SQL Server for the
setting to take effect.) Then you can connect as sa from VS and have
sysadmin rights. The good thing with this is that when you connect
through your application with Windows authentication, you are a plain
user and can test that you have granted that user the right permissions.

The other option is to add your Windows user to the sysadmin role:

sp_addsrvrolemember 'sysadmin', 'MACHINE\User'

(If command fails, try swapping the parameters; I may not remember the
order correctly.)
You would first have to grant MACHINE\User access to the SQL Server.

--
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|||On Mar 30, 2:29 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

raylopez99 (raylope...@.yahoo.com) writes:

Quote:

Originally Posted by

Thank you Erland. I see the problem is not as simple as I thought. I
also see I have two problems: one is what you addressed, the other is
more simple: how to use VS2005 from an account other than
"Administrator" when working on databases. So far I've not been able
to figure out this, and only use "Adminstrator" to code.


>
I did not answer that question, since I was uncertain of the scope of
your question. But it's fairly simple, although there are several options.
>
One is to enable SQL Server Authentication through Management Studio.
(Right-click the server itself in the Object Explorer, select Properties
and go the the Security tab. You need to restart SQL Server for the
setting to take effect.) Then you can connect as sa from VS and have
sysadmin rights. The good thing with this is that when you connect
through your application with Windows authentication, you are a plain
user and can test that you have granted that user the right permissions.
>


Well, turns out I don't have "Management Studio" on my system (yet
strangely I was able to create a simple SQL database and run some
commands). If you don't have "Management Studio" you don't have
"Object Explorer", even though it's possible to have SQL Server 2005
Express (a 36.5 MB file) and not the SQL Server Management Studio
Express (a 46.1 MB file) installed on your PC, as I have. Details
here: http://go.microsoft.com/fwlink/?LinkId=65110
I'll post again if I'm successful, for anybody reading this thread in
the future.

RL

Information on OE below...

Using Object Explorer

Object Explorer, a component of SQL Server Management Studio, connects
to Database Engine instances, Analysis Services, Integration Services,
Reporting Services, and SQL Server Compact Edition. It provides a view
of all the objects in the server and presents a user interface to
manage them. The capabilities of Object Explorer vary slightly
depending on the type of server, but generally include the development
features for databases, and management features for all server types.

Viewing Object Explorer

Object Explorer is visible in the Management Studio by default. If you
cannot see Object Explorer, on the View menu, click Object Explorer.

Connecting Object Explorer to a Server

To use Object Explorer you must first connect to a server. Click
Connect on the Object Explorer toolbar and choose the type of server
from the drop-down list. The Connect to Server dialog box opens. To
connect, you must provide at least the name of the server and the
correct authentication information.|||raylopez99 (raylopez99@.yahoo.com) writes:

Quote:

Originally Posted by

Well, turns out I don't have "Management Studio" on my system (yet
strangely I was able to create a simple SQL database and run some
commands). If you don't have "Management Studio" you don't have
"Object Explorer", even though it's possible to have SQL Server 2005
Express (a 36.5 MB file) and not the SQL Server Management Studio
Express (a 46.1 MB file) installed on your PC, as I have. Details
here: http://go.microsoft.com/fwlink/?LinkId=65110


I would definitely recommend that you download and install SQL Server
Management Studio Express. In the long run it will be difficult to be
without it. Particularly if you ask questions in newsgroups, because most
people answering questions will assume that you have Management Studio in
some form. :-)

--
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|||On Mar 31, 2:42 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

>
I would definitely recommend that you download and install SQL Server
Management Studio Express. In the long run it will be difficult to be
without it. Particularly if you ask questions in newsgroups, because most
people answering questions will assume that you have Management Studio in
some form. :-)
>
--
Erland Sommarskog, SQL Server MVP, esq...@.sommarskog.se


Hi Erland--it worked! Thank you very much, now I can code as a non-
Administrator with no problem...except one: http://tinyurl.com/38ssp8
(a sort of bug in VS2005 doing SQL it seems)

However, at least I did solve this problem and I appreciate your
advice.

Cheers,

Ray|||raylopez99 (raylopez99@.yahoo.com) writes:

Quote:

Originally Posted by

Hi Erland--it worked! Thank you very much, now I can code as a non-
Administrator with no problem...except one: http://tinyurl.com/38ssp8
(a sort of bug in VS2005 doing SQL it seems)


As I understand that link, it's not a bug at all. If you want to create
a procedure, you use CREATE PROCEDURE. If you want to change an existing
procedure, you use ALTER PROCEDURE. Alternatively, you drop the existing
procedure first, but then you would have to reapply permissions. Visual
Studio helps you out by changing CREATE to ALTER for you.

Also, one thing to keep in mind is that you enter things into the database,
that is not a Save operation, although unfortunately some tools use that
terminology. As with all other programming code, you save your code to disk
and then put it under version control. Regard what's in the database as
binaries.

--
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

Monday, March 12, 2012

Newbie in SQL server 2005

Good day. Is there any version of SQL server 2005(not include Express Edition) same as SQL server 2000 Personal edition ? I am planning to install new SQL server 2005 in my pc now. I am using Windows XP SP2 now. I tried to install to Entreprise Trial version, unfortunately it just works as client. Thank you in advance.Regards,Anson

SQL Server 2005 Express Edition is the replacement for MSDE & SQL Server Personal Edition.

See the following edition information:

http://www.sqlservercentral.com/columnists/bknight/comparisonofsqlserver2005editions.asp

http://www.microsoft.com/sql/editions/default.mspx

http://www.microsoft.com/technet/prodtechnol/sql/2005/msde2sqlexpress.mspx

-Aaron

|||

Have a look into this link. This contains the minimum requirements for SQL 2005. On having a look into this you can decide which version can be installed on your machine

http://www.microsoft.com/sql/prodinfo/sysreqs/default.mspx

Note : For enterprise edition the OS required is Microsoft Windows 2003 server

|||

Best is to use Sql Server 2005 Developer Edition if want to install on Windows Xp and want to use for development...

Satya

Newbie Help - Express exporting

I have been happily developing a site in Visual Express utilising SQL Express
and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
database. After some mucking around I have worked out that my App Data folder
has nothing to do with the ISP Sql Server DB.
The connection Strings neded for eth ISP do not go to the Express App_data
and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
way of converting / exporting my SQL Express info to the SQL Server DB
including the content not just the structure?
Sorry if it is a really daft question but ... I will get smarter eventually!
Hi
It is not clear if you have an user instance or not! If you are using a user
instance then you should change the connection string so that you don't have
the AttachDbFilename clause. You can either restore a backup of the database
or copy the mdf and ldf files and re-attach hem as described in
http://support.microsoft.com/kb/224071/
John
"Dajuroka" wrote:

> I have been happily developing a site in Visual Express utilising SQL Express
> and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
> database. After some mucking around I have worked out that my App Data folder
> has nothing to do with the ISP Sql Server DB.
> The connection Strings neded for eth ISP do not go to the Express App_data
> and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
> way of converting / exporting my SQL Express info to the SQL Server DB
> including the content not just the structure?
> Sorry if it is a really daft question but ... I will get smarter eventually!

Newbie Help - Express exporting

I have been happily developing a site in Visual Express utilising SQL Expres
s
and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
database. After some mucking around I have worked out that my App Data folde
r
has nothing to do with the ISP Sql Server DB.
The connection Strings neded for eth ISP do not go to the Express App_data
and it appears I have to recreate my DB in the ISP's SQL Server. Is there an
y
way of converting / exporting my SQL Express info to the SQL Server DB
including the content not just the structure'
Sorry if it is a really daft question but ... I will get smarter eventually
!Hi
It is not clear if you have an user instance or not! If you are using a user
instance then you should change the connection string so that you don't have
the AttachDbFilename clause. You can either restore a backup of the database
or copy the mdf and ldf files and re-attach hem as described in
http://support.microsoft.com/kb/224071/
John
"Dajuroka" wrote:
[vbcol=seagreen]
> I have been happily developing a site in Visual Express utilising SQL Expr
ess
> and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
> database. After some mucking around I have worked out that my App Data fol
der
> has nothing to do with the ISP Sql Server DB.
> The connection Strings neded for eth ISP do not go to the Express App_data
> and it appears I have to recreate my DB in the ISP's SQL Server. Is there
any
> way of converting / exporting my SQL Express info to the SQL Server DB
> including the content not just the structure'
> Sorry if it is a really daft question but ... I will get smarter eventually![/vbc
ol]

Newbie Help - Express exporting

I have been happily developing a site in Visual Express utilising SQL Express
and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
database. After some mucking around I have worked out that my App Data folder
has nothing to do with the ISP Sql Server DB.
The connection Strings neded for eth ISP do not go to the Express App_data
and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
way of converting / exporting my SQL Express info to the SQL Server DB
including the content not just the structure'
Sorry if it is a really daft question but ... I will get smarter eventually!Hi
It is not clear if you have an user instance or not! If you are using a user
instance then you should change the connection string so that you don't have
the AttachDbFilename clause. You can either restore a backup of the database
or copy the mdf and ldf files and re-attach hem as described in
http://support.microsoft.com/kb/224071/
John
"Dajuroka" wrote:
> I have been happily developing a site in Visual Express utilising SQL Express
> and then tried to copy to my ISP (GoDaddy). They provide a SQL Server
> database. After some mucking around I have worked out that my App Data folder
> has nothing to do with the ISP Sql Server DB.
> The connection Strings neded for eth ISP do not go to the Express App_data
> and it appears I have to recreate my DB in the ISP's SQL Server. Is there any
> way of converting / exporting my SQL Express info to the SQL Server DB
> including the content not just the structure'
> Sorry if it is a really daft question but ... I will get smarter eventually!

Saturday, February 25, 2012

Newbie - Querying SQL Server Express 2005 database from Excel

Sorry if this is a stupid question, but I created a database using SQl Server Express 2005 and I would like to query one of its tables from an Excel spreadsheet.

Here's what I want to do in pseudo code.

cell A2.value = select OLIGO_ID from table OLIGO where SEQUENCE = 'content of cell D2, a string'

In other words, I want to search the database for a string that is in a cell and retrieve its associated ID number into another cell. I need to do this on many cells.

Any help is appreciated. Thanks.

I guess you can do that with VBA.

As far as SQL is concerned I do something like that to extract data from a cube down to Excel. You will just have to build the connection string for SQL Express (get it from the macro recorder) and adjust the query to a more TSQL like query rather than OLAP. You can build any string you want.

Function to query SQL with a query string

-

Private Sub ado(Connection As String, Query As String, destination As String)
Dim cnnConnect As ADODB.Connection
Dim rstRecordset As ADODB.Recordset

Set cnnConnect = New ADODB.Connection
cnnConnect.Open Connection

Set rstRecordset = New ADODB.Recordset
rstRecordset.Open _
Source:=Query, _
ActiveConnection:=cnnConnect, _
CursorType:=adOpenDynamic, _
LockType:=adLockReadOnly, _
Options:=adCmdText

With ActiveSheet.QueryTables.Add( _
Connection:=rstRecordset, _
destination:=Range(destination))
.FieldNames = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = False
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
cnnConnect.Close
Set cnnConnect = Nothing
Set rstRecordset = Nothing
End Sub

-

-- OLAPMENU

OlapMenu = _
"Provider=MSOLAP;Integrated Security=SSPI;Persist Security Info=False;Location=analysis.onsemi.com;Initial Catalog=" & InitialCatalog & ""

--

call to the function

Query = "select" & _
"[data Switch].[Switch].members on axis(0)," & _
" Filter( [Region].[Rep Sales Region Desc].members, [Data Switch].[On] >0 ) on axis(1)" & _
"from [ST_Crawl]"
Application.StatusBar = "Now Populating Pull-down Region, please wait..."
Application.Cursor = xlWait
Call ado(OlapMenu, Query, "A3")

|||Yes, I would go as far as say write a function in Excel that accepts the input parameter, then uses ADO to fetch the data. Then you can pass in the value from the spreadsheet into the function, the function takes the parameter and uses an ADODB.Command with params to execute the SQL statement, then the function returns the output as a string.

Newbie - Help with Constraints

Dear all,
I am new to SQL Server (using the express edition.) I need to set up a
contraint that checks values from one column in three tables against
one column's value in a pending insertion. If the value that is
attempting to be inserted equals a value from either of the three
tables, the insertion should fail (throw a SQL exception').
Essentially this constraint should operate just like a "no duplicates"
constraint would operate if all the data was in a single column in a
single table and a client attempted to add a duplicate value.
Any advice is appreciated.
Thanks,
JohnnyJohnny,
You could embed the INSERT in a stored procedure and perform the table
checks (SELECTs) prior to the INSERT. Or you could create an INSERT trigger
that would ROLLBACK if the value existed in one of the tables. The former
would be better for performance.
HTH
Jerry
"Johnny Meredith" <jmeredith@.gmail.com> wrote in message
news:1148501225.921395.254460@.y43g2000cwc.googlegroups.com...
> Dear all,
> I am new to SQL Server (using the express edition.) I need to set up a
> contraint that checks values from one column in three tables against
> one column's value in a pending insertion. If the value that is
> attempting to be inserted equals a value from either of the three
> tables, the insertion should fail (throw a SQL exception').
> Essentially this constraint should operate just like a "no duplicates"
> constraint would operate if all the data was in a single column in a
> single table and a client attempted to add a duplicate value.
> Any advice is appreciated.
> Thanks,
> Johnny
>|||If I put this in a stored procedure, how could I ensure that the stored
procedure is called every time an insert statement is executed against
3 different tables? Is this a situation where a trigger is the only
choice?
Thanks,
Johnny|||Johnny,
Put the INSERT statement within the stored procedure and call the proc to
perform the INSERT.
HTH
Jerry
"Johnny Meredith" <jmeredith@.gmail.com> wrote in message
news:1148527276.838343.179960@.i39g2000cwa.googlegroups.com...
> If I put this in a stored procedure, how could I ensure that the stored
> procedure is called every time an insert statement is executed against
> 3 different tables? Is this a situation where a trigger is the only
> choice?
> Thanks,
> Johnny
>

Newbie - Help with Constraints

Dear all,
I am new to SQL Server (using the express edition.) I need to set up a
contraint that checks values from one column in three tables against
one column's value in a pending insertion. If the value that is
attempting to be inserted equals a value from either of the three
tables, the insertion should fail (throw a SQL exception').
Essentially this constraint should operate just like a "no duplicates"
constraint would operate if all the data was in a single column in a
single table and a client attempted to add a duplicate value.
Any advice is appreciated.
Thanks,
JohnnyJohnny,
You could embed the INSERT in a stored procedure and perform the table
checks (SELECTs) prior to the INSERT. Or you could create an INSERT trigger
that would ROLLBACK if the value existed in one of the tables. The former
would be better for performance.
HTH
Jerry
"Johnny Meredith" <jmeredith@.gmail.com> wrote in message
news:1148501225.921395.254460@.y43g2000cwc.googlegroups.com...
> Dear all,
> I am new to SQL Server (using the express edition.) I need to set up a
> contraint that checks values from one column in three tables against
> one column's value in a pending insertion. If the value that is
> attempting to be inserted equals a value from either of the three
> tables, the insertion should fail (throw a SQL exception').
> Essentially this constraint should operate just like a "no duplicates"
> constraint would operate if all the data was in a single column in a
> single table and a client attempted to add a duplicate value.
> Any advice is appreciated.
> Thanks,
> Johnny
>|||If I put this in a stored procedure, how could I ensure that the stored
procedure is called every time an insert statement is executed against
3 different tables? Is this a situation where a trigger is the only
choice?
Thanks,
Johnny|||Johnny,
Put the INSERT statement within the stored procedure and call the proc to
perform the INSERT.
HTH
Jerry
"Johnny Meredith" <jmeredith@.gmail.com> wrote in message
news:1148527276.838343.179960@.i39g2000cwa.googlegroups.com...
> If I put this in a stored procedure, how could I ensure that the stored
> procedure is called every time an insert statement is executed against
> 3 different tables? Is this a situation where a trigger is the only
> choice?
> Thanks,
> Johnny
>