Thursday, March 29, 2012
Default name for domain
windows machine, and I want to know if there's a way for me not to have to
specify the machine domain name.
Something like the '.\sqlexpress' name to identify the sqlexpress instance
in running in the local machine:
CREATE LOGIN [.\O2 - Viewer] FROM WINDOWS
Does something like this exist?
Regards,
Pablo MontillaOne option is to use variables and dynamically build the
SQL statements to create the logins. You can get the server
name using
select @.@.servername
You can use that to build the login names specific for a
machine.
-Sue
On Wed, 21 Mar 2007 18:31:41 -0300, "Pablo Montilla"
<melkor@.odyssey.com.uy> wrote:
>Hello, I'm creating a script that will create logins for groups of a
>windows machine, and I want to know if there's a way for me not to have to
>specify the machine domain name.
>Something like the '.\sqlexpress' name to identify the sqlexpress instance
>in running in the local machine:
>CREATE LOGIN [.\O2 - Viewer] FROM WINDOWS
>Does something like this exist?
>Regards,
>Pablo Montilla
>|||Many thanks, I'll try that.
Pablo
On Wed, 21 Mar 2007 22:00:19 -0300, Sue Hoegemeier <Sue_H@.nomail.please>
wrote:
> One option is to use variables and dynamically build the
> SQL statements to create the logins. You can get the server
> name using
> select @.@.servername
> You can use that to build the login names specific for a
> machine.
> -Sue
> On Wed, 21 Mar 2007 18:31:41 -0300, "Pablo Montilla"
> <melkor@.odyssey.com.uy> wrote:
>
>
DEFAULT INSTANCE INSTALLATION PROBLEM ON SQL2005
I have an installed instance which is FENERMARKET\ALISVERISSAATI.
I installed sp1 and sp2 too.
When i try to install default instance as another instance the setup process
give the error.Im sure that my Sa password is true. I choose windows
authentication as aut type.
SQL service MSSQLSERVER started successfully waiting for SQL service to
accept client connections
Service MSSQLSERVER started at Mon Feb 04 19:18:21 2008
Loaded DLL:
C:\WINDOWS\system32\Odbc32.dll
Version:
3.526.3959.0
SQL_ERROR (-1) in OdbcConnection::connect
sqlstate=28000, level=-1, state=-1, native_error=18456, msg=[Microsoft][SQL
Native Client][SQL Server]Login failed for user 'sa'.
Error Code: 0x80074818 (18456)
Windows Error Text: Source File Name: lib\odbc_connection.cpp
Compiler Timestamp: Fri Jul 29 01:13:53 2005
Function Name: OdbcConnection::connect@.connect
Source Line Number: 148
-- Context ---
Connecting to SQL Server
ExecuteSqlCommands
Originial error was 80074818 (18456)
ipt
SqlScriptHlpr
Error Code: 18456
Where do you need the "sa" Login and it's password if you use Windows
Authentication in SQL Server Setup?
In this error, the key thing is to see the "State number" in Login Failed
error message. Here is a nice blog about this error:
http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx
Ekrem nsoy
"in da club" <s> wrote in message
news:umNJdQ1ZIHA.1164@.TK2MSFTNGP02.phx.gbl...
>I have win2003 machine which is named fenermarket.
> I have an installed instance which is FENERMARKET\ALISVERISSAATI.
> I installed sp1 and sp2 too.
> When i try to install default instance as another instance the setup
> process give the error.Im sure that my Sa password is true. I choose
> windows authentication as aut type.
>
> SQL service MSSQLSERVER started successfully waiting for SQL service to
> accept client connections
> Service MSSQLSERVER started at Mon Feb 04 19:18:21 2008
> Loaded DLL:
> C:\WINDOWS\system32\Odbc32.dll
> Version:
> 3.526.3959.0
>
> SQL_ERROR (-1) in OdbcConnection::connect
> sqlstate=28000, level=-1, state=-1, native_error=18456,
> msg=[Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'.
> Error Code: 0x80074818 (18456)
> Windows Error Text: Source File Name: lib\odbc_connection.cpp
> Compiler Timestamp: Fri Jul 29 01:13:53 2005
> Function Name: OdbcConnection::connect@.connect
> Source Line Number: 148
>
> -- Context ---
>
> Connecting to SQL Server
> ExecuteSqlCommands
> Originial error was 80074818 (18456)
> ipt
> SqlScriptHlpr
>
> Error Code: 18456
>
|||i have choosen mixed mode. I know the url but i couldnt find any info about
my stuation . my error state id is not listed here.
sql
DEFAULT INSTANCE INSTALLATION PROBLEM ON SQL2005
I have an installed instance which is FENERMARKET\ALISVERISSAATI.
I installed sp1 and sp2 too.
When i try to install default instance as another instance the setup process
give the error.Im sure that my Sa password is true. I choose windows
authentication as aut type.
SQL service MSSQLSERVER started successfully waiting for SQL service to
accept client connections
Service MSSQLSERVER started at Mon Feb 04 19:18:21 2008
Loaded DLL:
C:\WINDOWS\system32\Odbc32.dll
Version:
3.526.3959.0
SQL_ERROR (-1) in OdbcConnection::connect
sqlstate=28000, level=-1, state=-1, native_error=18456, msg=[Microsoft][SQL
Native Client][SQL Server]Login failed for user 'sa'.
Error Code: 0x80074818 (18456)
Windows Error Text: Source File Name: lib\odbc_connection.cpp
Compiler Timestamp: Fri Jul 29 01:13:53 2005
Function Name: OdbcConnection::connect@.connect
Source Line Number: 148
-- Context ---
Connecting to SQL Server
ExecuteSqlCommands
Originial error was 80074818 (18456)
ipt
SqlScriptHlpr
Error Code: 18456Where do you need the "sa" Login and it's password if you use Windows
Authentication in SQL Server Setup?
In this error, the key thing is to see the "State number" in Login Failed
error message. Here is a nice blog about this error:
http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx
--
Ekrem Önsoy
"in da club" <s> wrote in message
news:umNJdQ1ZIHA.1164@.TK2MSFTNGP02.phx.gbl...
>I have win2003 machine which is named fenermarket.
> I have an installed instance which is FENERMARKET\ALISVERISSAATI.
> I installed sp1 and sp2 too.
> When i try to install default instance as another instance the setup
> process give the error.Im sure that my Sa password is true. I choose
> windows authentication as aut type.
>
> SQL service MSSQLSERVER started successfully waiting for SQL service to
> accept client connections
> Service MSSQLSERVER started at Mon Feb 04 19:18:21 2008
> Loaded DLL:
> C:\WINDOWS\system32\Odbc32.dll
> Version:
> 3.526.3959.0
>
> SQL_ERROR (-1) in OdbcConnection::connect
> sqlstate=28000, level=-1, state=-1, native_error=18456,
> msg=[Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'.
> Error Code: 0x80074818 (18456)
> Windows Error Text: Source File Name: lib\odbc_connection.cpp
> Compiler Timestamp: Fri Jul 29 01:13:53 2005
> Function Name: OdbcConnection::connect@.connect
> Source Line Number: 148
>
> -- Context ---
>
> Connecting to SQL Server
> ExecuteSqlCommands
> Originial error was 80074818 (18456)
> ipt
> SqlScriptHlpr
>
> Error Code: 18456
>|||i have choosen mixed mode. I know the url but i couldnt find any info about
my stuation . my error state id is not listed here.
Wednesday, March 21, 2012
Dedicated server config
configuring a server which will be a dedicated SQL
Server 2000 machine? I'm going for performance.
Thanks,
Andrewhttp://www.sql-server-performance.com
--
David Portas
--
Please reply only to the newsgroup
--
"Andrew" <a@.b.com> wrote in message
news:2781c01c38f76$65d7f2f0$a601280a@.phx.gbl...
> Could someone direct me to a good online resorce for
> configuring a server which will be a dedicated SQL
> Server 2000 machine? I'm going for performance.
> Thanks,
> Andrew
>
Sunday, March 11, 2012
Declaring USER_NAME() as SQL Variable
I have a User-defined function "Concatenate_NoteTexts" which I use in a
query (SQL Server 2000). On my local development machine it is called like
this:
SELECT
dbo.Concatenate_NoteTexts(Introducers.IntroducerID ) as NoteTexts
FROM tblIntroducers
I want to run the same code on a shared remote server where I am user "JON"
instead of "dbo". I don't want to hard-code the User Name into the SQL, but
when I tried to put the user name into a variable as here:
DECLARE @.USER_NAME VarChar(30)
SET @.USER_NAME = USER_NAME()
SELECT
@.USER_NAME.Concatenate_NoteTexts(Introducers.Intro ducerID) as NoteTexts
FROM tblIntroducers
I get the following error:
Server: Msg 170, Level 15, State 1, Line 4
Line 4: Incorrect syntax near '.'
Any advice?
TIA,
JON
PS First posted earlier today to AspMessageBoard - no answers yet.
http://www.aspmessageboard.com/foru...=626289&F=21&P=
1"Jon Maz" <jonmaz@.NOSPAM.surfeu.de> wrote in message
news:bj4s3n$kh5$1@.online.de...
> Hi,
> I have a User-defined function "Concatenate_NoteTexts" which I use in a
> query (SQL Server 2000). On my local development machine it is called
like
> this:
> SELECT
> dbo.Concatenate_NoteTexts(Introducers.IntroducerID ) as NoteTexts
> FROM tblIntroducers
> I want to run the same code on a shared remote server where I am user
"JON"
> instead of "dbo". I don't want to hard-code the User Name into the SQL,
but
> when I tried to put the user name into a variable as here:
> DECLARE @.USER_NAME VarChar(30)
> SET @.USER_NAME = USER_NAME()
> SELECT
> @.USER_NAME.Concatenate_NoteTexts(Introducers.Intro ducerID) as NoteTexts
> FROM tblIntroducers
> I get the following error:
> Server: Msg 170, Level 15, State 1, Line 4
> Line 4: Incorrect syntax near '.'
> Any advice?
Beg for your own database.
Development as a non-dbo is really a hastle.
You can have your own database without being a SystemAdministrator. Just
have a SystemAdministrator to run this code:
create database jon_dev
go
use jon_dev
go
sp_addalias 'jon', 'dbo'
David|||Hi David,
Thanks, nice idea, I'll have to see if the webhosts will do that.
But there must also be a way to code what I want *without* being a SysAd!
JON|||What are you trying to do with the variable? Concatenate? Or return it in
the select statement as a column? If the latter, change the period to a
comma.
DECLARE @.USER_NAME VarChar(30)
SET @.USER_NAME = USER_NAME()
SELECT
@.USER_NAME,Concatenate_NoteTexts(Introducers.Intro ducerID) as NoteTexts
FROM tblIntroducers
"Jon Maz" <jonmaz@.NOSPAM.surfeu.de> wrote in message
news:bj4s3n$kh5$1@.online.de...
> Hi,
> I have a User-defined function "Concatenate_NoteTexts" which I use in a
> query (SQL Server 2000). On my local development machine it is called
like
> this:
> SELECT
> dbo.Concatenate_NoteTexts(Introducers.IntroducerID ) as NoteTexts
> FROM tblIntroducers
> I want to run the same code on a shared remote server where I am user
"JON"
> instead of "dbo". I don't want to hard-code the User Name into the SQL,
but
> when I tried to put the user name into a variable as here:
> DECLARE @.USER_NAME VarChar(30)
> SET @.USER_NAME = USER_NAME()
> SELECT
> @.USER_NAME.Concatenate_NoteTexts(Introducers.Intro ducerID) as NoteTexts
> FROM tblIntroducers
> I get the following error:
> Server: Msg 170, Level 15, State 1, Line 4
> Line 4: Incorrect syntax near '.'
> Any advice?
> TIA,
> JON
>
> PS First posted earlier today to AspMessageBoard - no answers yet.
http://www.aspmessageboard.com/foru...=626289&F=21&P=
> 1
>
>
>|||Sorry... misread your message - you need access to the function.
"Morgan" <mfears@.spamcop.net> wrote in message
news:OCNLY9icDHA.1280@.tk2msftngp13.phx.gbl...
> What are you trying to do with the variable? Concatenate? Or return it in
> the select statement as a column? If the latter, change the period to a
> comma.
> DECLARE @.USER_NAME VarChar(30)
> SET @.USER_NAME = USER_NAME()
> SELECT
> @.USER_NAME,Concatenate_NoteTexts(Introducers.Intro ducerID) as NoteTexts
> FROM tblIntroducers
> "Jon Maz" <jonmaz@.NOSPAM.surfeu.de> wrote in message
> news:bj4s3n$kh5$1@.online.de...
> > Hi,
> > I have a User-defined function "Concatenate_NoteTexts" which I use in a
> > query (SQL Server 2000). On my local development machine it is called
> like
> > this:
> > SELECT
> > dbo.Concatenate_NoteTexts(Introducers.IntroducerID ) as NoteTexts
> > FROM tblIntroducers
> > I want to run the same code on a shared remote server where I am user
> "JON"
> > instead of "dbo". I don't want to hard-code the User Name into the SQL,
> but
> > when I tried to put the user name into a variable as here:
> > DECLARE @.USER_NAME VarChar(30)
> > SET @.USER_NAME = USER_NAME()
> > SELECT
> > @.USER_NAME.Concatenate_NoteTexts(Introducers.Intro ducerID) as
NoteTexts
> > FROM tblIntroducers
> > I get the following error:
> > Server: Msg 170, Level 15, State 1, Line 4
> > Line 4: Incorrect syntax near '.'
> > Any advice?
> > TIA,
> > JON
> > PS First posted earlier today to AspMessageBoard - no answers yet.
http://www.aspmessageboard.com/foru...=626289&F=21&P=
> > 1|||Jon Maz (jonmaz@.NOSPAM.surfeu.de) writes:
> I have a User-defined function "Concatenate_NoteTexts" which I use in a
> query (SQL Server 2000). On my local development machine it is called
> like this:
> SELECT
> dbo.Concatenate_NoteTexts(Introducers.IntroducerID ) as NoteTexts
> FROM tblIntroducers
> I want to run the same code on a shared remote server where I am user
> "JON" instead of "dbo". I don't want to hard-code the User Name into
> the SQL, but when I tried to put the user name into a variable as here:
> DECLARE @.USER_NAME VarChar(30)
> SET @.USER_NAME = USER_NAME()
> SELECT
> @.USER_NAME.Concatenate_NoteTexts(Introducers.Intro ducerID) as NoteTexts
> FROM tblIntroducers
The question is slightly more interesting than it may look like.
Say that you instead had had a stored procedure, call it notetext_sp.
This would not have constituted any problem, because you could have
called it as:
EXEC notetext_sp
When you are logged in as JON on the remote server, SQL Server would
have found the notetext_sp owned by you. This works for any other
SQL Server object as well. Except scalar user-defined functions, because
you must refer to them with a two-part name. The reason for this is
syntactical, so that the parser can distinguish between UDF and built-in
functions.
However, there is an exception to the exception. This works:
ALTER FUNCTION nisse_fun (@.a int) returns varchar(90) as
BEGIN
RETURN (SELECT replicate('nisse', @.a))
END
go
declare @.g varchar(90)
exec @.g = nisse_fun 8
select @.g
That is you can invoke a scalar UDF with EXEC as well, and in this case
you don't need the two-part name. Whether this actually helps you, I
don't know.
However, as noted by David Browne, getting your database makes life a
lot easier.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Friday, February 24, 2012
Debugging SP On server from workstation using Query Analyzer
Hai .....,
I 'm able to debug a Stored Procedure directly on the server, but I 'm not able to debug the same stored procedure from my machine. What should i do in order to debug the stored procedures on the server from my workstation.
(I can debug the stored procedures of my local sql server)
Please take a look at the "Troubleshooting the Transact-SQL Debugger" topic in BOL. The url is below:mk:@.MSITStore:C:\Program%20Files\Microsoft%20SQL%20Server\80\Tools\Books\trblsql.chm::/tr_servtools_5cfm.htm
There are also additional KB articles that you can find in Technet on this topic.|||Hello Umachandran,
The Sql Server 2000 (on the server SP3 is not installed) runs on Win XP. Using the help file address that you have given me, I made the following adjustment but still the cursor does not wait on the first statement, Instead it waits for some time (Displaying wait for user input in the status bar) and returns with @.RETURN_VALUE = 0. I have did the following adjustment;
Start -> Run -> dcomcnfg -> Component Services -> Computers -> My Computer -> DCOM Config -> sqldbreg -> Right clicked and selected properties -> Security Tab and for Access Permission -> Edit -> Added System and Everyone and gave them both Local and Remote Access. Still no luck. Any other suggestion|||Please take a look at the KB article below
http://support.microsoft.com/default.aspx?scid=kb;en-us;280101
This has additional information than BOL. You should also try this from a different client so you can start with a default configuration and see.
Sunday, February 19, 2012
Debugging acting weird
I have VS2005 RC1 and SQL Server 2005 September CTP installed on the same machine.
I'm writing some pretty simple C# stored procedures and I'd like to be able to debug them with with the VS2005 IDE. However, something's not working.
When I set a breakpoint and I run the code (F5), it turns white with a red border informing me that "the breakpoint will not currently be hit. No symbols have been loaded for this document". Obviously, those breakpoints are not hit and I cannot debug exceptions either.
I made sure the connection the project is linked to has "ApplicationDebugging" and "Allow SQL/CLR Debugging" turned on.
I'm probably missing a very simple step to get this working, but Google didn't help me this time. So that's why I come here begging for your help!

Thanks in advance!
Carl
Hi Carl,
Have you executed the following TSQL code to enable SQLCLR on the server?
Create a new Stored Procedure in VS, then add the following:
exec sp_configure 'clr enabled',1
reconfigure
If this doesnt work, could you answer the following questions:
1, Are you the running as the machine admin?
2, Are you able to debug a regular TSQL Stored Procedure?
3, Could you send me the text from the output window.
Thanks
Richard Cook
VS SQL Debugger QA
Debugging acting weird
I have VS2005 RC1 and SQL Server 2005 September CTP installed on the same machine.
I'm writing some pretty simple C# stored procedures and I'd like to be able to debug them with with the VS2005 IDE. However, something's not working.
When I set a breakpoint and I run the code (F5), it turns white with a red border informing me that "the breakpoint will not currently be hit. No symbols have been loaded for this document". Obviously, those breakpoints are not hit and I cannot debug exceptions either.
I made sure the connection the project is linked to has "ApplicationDebugging" and "Allow SQL/CLR Debugging" turned on.
I'm probably missing a very simple step to get this working, but Google didn't help me this time. So that's why I come here begging for your help!

Thanks in advance!
Carl
Hi Carl,
Have you executed the following TSQL code to enable SQLCLR on the server?
Create a new Stored Procedure in VS, then add the following:
exec sp_configure 'clr enabled',1
reconfigure
If this doesnt work, could you answer the following questions:
1, Are you the running as the machine admin?
2, Are you able to debug a regular TSQL Stored Procedure?
3, Could you send me the text from the output window.
Thanks
Richard Cook
VS SQL Debugger QA
Friday, February 17, 2012
Debugger on remote machine
user connecting locally vs the user connecting remotely.
This might give you some clue.
HTH.
Obaid.
>--Original Message--
>We have a remote server (w 2000, sql 2000) where we can
debug stored procedures locally but cannot debug stored
procedures remotely. Has anyone encountered this?
>.
>It's the same user.
What I'm noticing is that when debugging is done localy, the debugger pause
s on the first line. All of the debugging icons are active. In profler ther
e are two calls to sp_sdidebug (the first passes a 'check', parm the second
passes an 'on' parm) and s
et implicit transactions statement. If you then press F5 the code executes.
In profiler the procedure is executed and then there is a call to sp_sdide
bug (passes an 'off' parm).
When debugging locally, the code appears to immediately execute and the debu
gging icons are grayed out. This is confirmed in profiler where there are t
he two calls to sp_sdidebug, the procedure is executed and there is the call
to sp_sdidebug with the of
f parameter. So the code appears to execute immediately rather than being pa
used, and the debugger is disabled.|||KB article 328151 had the solution to our problem. The T-SQL Debugger is tu
rned off for non-sp3 clients after you install sp3. We're having our develo
pers upgrade their client tools to sp3. You can also run sp_sdidebug 'legacy
_on' each time you reboot t
he server.
Debugger on remote machine
user connecting locally vs the user connecting remotely.
This might give you some clue.
HTH.
Obaid.
>--Original Message--
>We have a remote server (w 2000, sql 2000) where we can
debug stored procedures locally but cannot debug stored
procedures remotely. Has anyone encountered this?
>.
>
It's the same user.
What I'm noticing is that when debugging is done localy, the debugger pauses on the first line. All of the debugging icons are active. In profler there are two calls to sp_sdidebug (the first passes a 'check', parm the second passes an 'on' parm) and s
et implicit transactions statement. If you then press F5 the code executes. In profiler the procedure is executed and then there is a call to sp_sdidebug (passes an 'off' parm).
When debugging locally, the code appears to immediately execute and the debugging icons are grayed out. This is confirmed in profiler where there are the two calls to sp_sdidebug, the procedure is executed and there is the call to sp_sdidebug with the of
f parameter. So the code appears to execute immediately rather than being paused, and the debugger is disabled.
Debug SProcs
am able to step in / debug stored procedures in dbs on Express just fine.
Stepping into a stored procedure from within Visual Studio 2005 under the
full version of SQL on the local machine pops up the "run stored procedure"
dialog box under which I enter my parameters but then things just seem to
hang, never reaching my breakpoint. When I click on the "Stop Debugging"
button, control is returned to VS.
Any ideas?
The output window contains the following:
Auto-attach to process '[1168] [SQL] webdev1' on machine 'webdev1'
succeeded.
The thread 'webdev1 [56]' (0xdd0) has exited with code 0 (0x0).
The thread 'webdev1 [56]' (0xdd0) has exited with code 0 (0x0).
The thread 'webdev1 [56]' (0xdd0) has exited with code 0 (0x0).
The thread 'webdev1 [56]' (0xdd0) has exited with code 0 (0x0).
Running [dbo].[CartToOrder] ( @.BrowserID = 5).
(Click on the stop debugging button).
The thread 'webdev1 [56]' (0xdd0) has exited with code 0 (0x0).
The program '[1168] [SQL] webdev1: webdev1' has exited with code 0 (0x0).
Batch execution is terminated because of debugger request.
No rows affected.
(0 row(s) returned)
@.RETURN_VALUE =
Finished running [dbo].[CartToOrder].
Andrew RobinsonHello Andrew,
You may want to run the SP directly in SSMS to see if it hangs. Also, you
may try to create a new simple SP on a new database to test the situation.
To find out the root cause of this issue we may need to analyze memory
dumps, this work has to be done by contacting Microsoft Product Support
Services. Therefore, we probably will not be able to resolve the issue
through the newsgroup. I recommend that you open a Support incident with
Microsoft Product Support Services so that a dedicated Support Professional
can assist with this case. If you need any help in this regard, please let
me know.
For a complete list of Microsoft Product Support Services phone numbers,
please go to the following address on the World Wide Web:
http://support.microsoft.com/directory/overview.asp
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.