Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Friday, March 30, 2012

How Do I Add Time with integer value in MSSQL ?

Hi, Expert

How Do I Add Time with integer value in MSSQL ??

For Example: 07:00:50 + 20 = 07:01:10

Note: 20 is in second

Thanks in advance

Check out the DATEADD function in BOL (documentation).|||

Hi,

You can play with DATEADD function for your question, for example:

SELECT dateadd(s, 20, getdate())

this one will add 20 seconds to now.

You can look up this function from Books Online to find more information. By the way, in SQL Server there is datatime data type, but not time or date only data type.

Monday, March 26, 2012

How delete BIDS "Recent Projects" projects?

When I open BIDS it displays a list of "Recent Projects". How can I edit (or delete) items from this list? (Over time the list has acquired a lot of junk\test projects that I no longer need).

TIA,

Barkingdog

It's a set of keys in the registry.

To delete the 'Recent Projects' list the key is:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList

To delete 'Recent Files' list, the key is:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\FileMRUList

Where, of course, 8.0 corresponds to your version of Visual Studio.

Friday, March 23, 2012

how could I store images in a database?!!

hi everybody,can anybody help me out by telling me how could I store images in a database, and how to insert new images at run time to a database and thanks

If you have C# .NET (Express, and probably other versions too), it comes with a "Movie Collection Starter Kit" example which has a button that loads an image into the database. Just go to File->New Project, and select the "Movie Collection Starter Kit" template. Open ListDetail.cs, and find the ImportImage method.

How connect SQL server 2000 with c#.net .....?

Hello masters,

help me yaar

i am using dotnet 2003 and SqL SERVER 2000. BUT UNABLE TO CONNECT DATABASE using dataAdaptor(design time ) or sqlconnection any can help me

gs

whats the error?

lets see the connection string.

make an empty text file called "c:\test.udl" - double click it and try to build a SQL Ole Db Provider datalink. . . can you get that to work?

Are the TCP protocols enabled in your machines client network settings and in the servers network settings?

|||Guess you don′t have the right connection string, look at www.connectionstrings.com for appropiate connection strings.

HTH, jens Suessmeyer.|||

hi i am using this code it dose not show any error as well as no output... please check it...

string conn = ("Data Source=localhost;"+

"Initial Catalog=gstest;"+

"User ID=sa;"+

"Password=logic;");

SqlConnection con = new SqlConnection();

con.ConnectionString = conn;

SqlDataAdapter da = new SqlDataAdapter("select * from tb1",con);

DataSet ds = new DataSet();

da.Fill(ds,"tb");

dataGrid1.DataSource = ds.DefaultViewManager;

|||

hello i got this error now,

what to do?

An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll

Additional information: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

|||

If this is a web project (?!) you have to rebind the grid to the data

dataGrid1.DataBind()

HTH, jens Suessmeyer.

|||

what does this do:

try
{
DataSet ds = new DataSet();
string conn = "Data Source=localhost;Initial Catalog=gstest;User ID=sa;Password=logic;";
using(SqlConnection con = new SqlConnection(conn))
{
using(SqlDataAdapter da = new SqlDataAdapter("select * from tb1",con))
{
da.Fill(ds);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

|||

hi master

it display...

Sql server dose not exist or access denied

but my sql server is running ......?

|||The using statement is doing garbage collection after the scope is funished. Fills your dataset like the first statement.

HTH, Jens Suessmeyer.|||

Jens Suessmeyer wrote:

Guess you don′t have the right connection string, look at www.connectionstrings.com for appropiate connection strings.

HTH, jens Suessmeyer.

the connection string is properly formed. whether that user/pw is correct and has permissions is another story.

Is the sql server on your development machine?

on the client, check that the TCP protocols are enabled using the Client Network Utility (cliconfig.exe) and on the server there is the Server Network Utility (svrnetcn.exe)

got windows firewall on? might try turning that off.

look at services control panel applet connected to the server.

does it show:

MSSQL or MSSQLSERVER

is it running?

|||Like it says "..or access denied". Whether you are not a default instance, then you have to suffix the instance name after the servername like localhost/instancename or you use a different port than the standard port then you have to add the port after the instancename servername/instance,Port ot you have a security problem, that the password is not valid for the sa account.

HTH, jens Suessmeyer.|||

still suffring

MSSQLSERVER is running on my pc i have also turn off the fire wall.

but the error is the same.

i like to know that after installing sql server is any process to configure with dotnet2003

if there is any pls inform me.....

pls.............

|||

Can you use integrated authentication ? If so (and you are in the adminstrative group, which should be server administrator by default int the installation) try using instead of UserID=yadayada;Password=blabla --> "Integrated Security=true"

HTH, Jens Suessmeyer-

|||

no, not really. . . did you check these:

Client Network Utility (cliconfig.exe) and Server Network Utility (svrnetcn.exe)

to make sure the tcp protocols are started?

did you make that empty udl file to check if Datalinks could connect?

|||

i am working on windows 2000 prof O/S

i have just downloaded the sqlserver 2000 form the net for installing this i have used the command in dos prompt...

C:\Program Files\Microsoft Visual Studio .NET 2003\Setup\MSDE\setup sapwd=logic securitymode=sql

after this sql server is installed in my computer and then i have downloded the Database manager(trial verson) to create the database and the tabels.

using this database and the tabels are created but

i am not able to connecte using dotnet2003

and pls tell me how to check the...

Client Network Utility (cliconfig.exe) and Server Network Utility (svrnetcn.exe)

to make sure the tcp protocols are started?

Wednesday, March 21, 2012

How concatenate members from 3 virtual dimensions using MDX

Hello,
There is a big problem - my client made 3 virtual dimensions (Year, Quarter,
Month) from single time dimension and wants to use them, because the
graphical interface in Excel is more friendly for end-users to have 3
dimensions (i.e. 3 separate tabs).
But in the same time we need to make MDX queries with time series with MDX
formulas like YTD, LastPeriod and so on. These formulas need full time
dimension.
I wonder there is possibility to concatenate all 3 members from virtual
dimension and use that aggregate as member for real Time dimension. For
example if user selects 2005 year, I Quarter and February from virtual
dimensions, we can assume, that member from real dimension could be
[2005].[I].[February], but how make that member and submit it to
formula for
later use.
In SQL we have possibility to construct SQL queries dynamically, and what
about MDX.
ErnestasJust an idea -
StrToTuple(
IIF( < original tuple >.Item(0).Dimension IS [VYear] AND < tuple
>.Item(0).Dimension IS [VQuarter] AND < tuple >.Item(0).Dimension IS
[VMonth], < Parse the unique names to create your real unique name using
VB
functions>, TupleToStr(<original tuple> ) )
)
"Ernestas" <sysojevas@.delfi.lt> wrote in message
news:efUjpNHNFHA.244@.tk2msftngp13.phx.gbl...
> Hello,
>
> There is a big problem - my client made 3 virtual dimensions (Year,
> Quarter, Month) from single time dimension and wants to use them, because
> the graphical interface in Excel is more friendly for end-users to have 3
> dimensions (i.e. 3 separate tabs).
>
> But in the same time we need to make MDX queries with time series with MDX
> formulas like YTD, LastPeriod and so on. These formulas need full time
> dimension.
>
> I wonder there is possibility to concatenate all 3 members from virtual
> dimension and use that aggregate as member for real Time dimension. For
> example if user selects 2005 year, I Quarter and February from virtual
> dimensions, we can assume, that member from real dimension could be
> [2005].[I].[February], but how make that member and submit it
to formula
> for later use.
>
> In SQL we have possibility to construct SQL queries dynamically, and what
> about MDX.
>
> Ernestas
>|||Correction:
StrToTuple(
IIF( < original tuple >.Item(0).Dimension IS [VYear] AND <
tuple.Item(1).Dimension IS [VQuarter] AND < tuple >.Item(2).Dimension IS
[VMonth], Parse the unique names to create your real unique name using
VB
functions>, TupleToStr(<original tuple> ) )
)
"Elad" <elad> wrote in message news:OZh2t9HNFHA.2372@.TK2MSFTNGP10.phx.gbl...
> Just an idea -
> StrToTuple(
> IIF( < original tuple >.Item(0).Dimension IS [VYear] AND < tuple
> [VMonth], < Parse the unique names to create your real unique name usi
ng
> VB functions>, TupleToStr(<original tuple> ) )
> )
>
> "Ernestas" <sysojevas@.delfi.lt> wrote in message
> news:efUjpNHNFHA.244@.tk2msftngp13.phx.gbl...
>

How come my SQL Server Job won't run?

Hi - I just created a job in SQL Server using Management Studio. This is the
first time I've tried to build a job. The job failed to execute at the
scheduled time and it fails when I start it manually. Looking at the Job
History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM. Login
failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The step
failed."
I tried to pick a different user from the Run as drop down in the Job step
properties window, but the drop down is empty. Does anyone know what might
be going on here?
--
Thanks,
JeffHi Jeff,
What is your job supposed to do? On the job history expand the job steps and
look for additional error messages every step. If applicable also check the
SQL Server error log.
You can also try the Advanced page on the Job Step section and specify an
output file. Then run the job again and see if you can find some additional
error information there.
Perhaps you do not need to change the 'Run as' section until you know what
the problem is.
Hope this helps,
Ben Nevarez
Senior Database Administrator
"Jeff Stroope" wrote:
> Hi - I just created a job in SQL Server using Management Studio. This is the
> first time I've tried to build a job. The job failed to execute at the
> scheduled time and it fails when I start it manually. Looking at the Job
> History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM. Login
> failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The step
> failed."
> I tried to pick a different user from the Run as drop down in the Job step
> properties window, but the drop down is empty. Does anyone know what might
> be going on here?
> --
> Thanks,
> Jeff|||Jeff,
I just ran into someone getting the same error message. Are you by any
change running something like the following TSQL step?
exec xp_cmdshell 'bcp xxx.dbo.yyy out xxx.fil -T'
In the other case, it seems that shelling out and then logging back in as a
Trusted Connection raised the error.
In their case, changing the SQL Server service from running as Local System
to running as a domain login resolved the problem. (Of course, you need to
have or create a domain account with the proper permissions.)
RLF
"Jeff Stroope" <JeffStroope@.discussions.microsoft.com> wrote in message
news:D5B0F3ED-5538-4E89-8A97-E985003A981F@.microsoft.com...
> Hi - I just created a job in SQL Server using Management Studio. This is
> the
> first time I've tried to build a job. The job failed to execute at the
> scheduled time and it fails when I start it manually. Looking at the Job
> History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM.
> Login
> failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The
> step
> failed."
> I tried to pick a different user from the Run as drop down in the Job step
> properties window, but the drop down is empty. Does anyone know what
> might
> be going on here?
> --
> Thanks,
> Jeff|||Hi Ben - the job is supposed to run a stored procedure. The job only has one
step, which is "execute sp_storedProcedure". I'll try the output file and
see what happens.
--
Thanks,
Jeff
"Ben Nevarez" wrote:
> Hi Jeff,
> What is your job supposed to do? On the job history expand the job steps and
> look for additional error messages every step. If applicable also check the
> SQL Server error log.
> You can also try the Advanced page on the Job Step section and specify an
> output file. Then run the job again and see if you can find some additional
> error information there.
> Perhaps you do not need to change the 'Run as' section until you know what
> the problem is.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
>
> "Jeff Stroope" wrote:
> > Hi - I just created a job in SQL Server using Management Studio. This is the
> > first time I've tried to build a job. The job failed to execute at the
> > scheduled time and it fails when I start it manually. Looking at the Job
> > History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM. Login
> > failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The step
> > failed."
> >
> > I tried to pick a different user from the Run as drop down in the Job step
> > properties window, but the drop down is empty. Does anyone know what might
> > be going on here?
> > --
> > Thanks,
> >
> > Jeff|||Thanks Russell - no, I'm just trying execute a stored procedure that queries
some tables in a database on a linked server and then populates tables on the
job server.
--
Thanks,
Jeff
"Russell Fields" wrote:
> Jeff,
> I just ran into someone getting the same error message. Are you by any
> change running something like the following TSQL step?
> exec xp_cmdshell 'bcp xxx.dbo.yyy out xxx.fil -T'
> In the other case, it seems that shelling out and then logging back in as a
> Trusted Connection raised the error.
> In their case, changing the SQL Server service from running as Local System
> to running as a domain login resolved the problem. (Of course, you need to
> have or create a domain account with the proper permissions.)
> RLF
>
> "Jeff Stroope" <JeffStroope@.discussions.microsoft.com> wrote in message
> news:D5B0F3ED-5538-4E89-8A97-E985003A981F@.microsoft.com...
> > Hi - I just created a job in SQL Server using Management Studio. This is
> > the
> > first time I've tried to build a job. The job failed to execute at the
> > scheduled time and it fails when I start it manually. Looking at the Job
> > History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM.
> > Login
> > failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The
> > step
> > failed."
> >
> > I tried to pick a different user from the Run as drop down in the Job step
> > properties window, but the drop down is empty. Does anyone know what
> > might
> > be going on here?
> > --
> > Thanks,
> >
> > Jeff
>
>|||Jeff,
OK, but you still have an execution context issue since you are going to
another server. A couple more questions:
1. Who is the job owner of the SQL Agent job? Your login? The 'sa'
account? NT AUTHORITY\SYSTEM? A domain login? A SQL Server login?
2. How do you have your security set on the linked server? Check the
security tab of the linked server definition. Local login impersonation?
The login's current security context? A specific login?
You might be able to manipulate the linked server definition to get this to
work for you. But, as is, I suspect that the local system account is at the
root of the problem for the job you have defined.
RLF
"Jeff Stroope" <JeffStroope@.discussions.microsoft.com> wrote in message
news:FA4BED9F-1877-4B01-ADA5-3F1B49027EC9@.microsoft.com...
> Thanks Russell - no, I'm just trying execute a stored procedure that
> queries
> some tables in a database on a linked server and then populates tables on
> the
> job server.
> --
> Thanks,
> Jeff
>
> "Russell Fields" wrote:
>> Jeff,
>> I just ran into someone getting the same error message. Are you by any
>> change running something like the following TSQL step?
>> exec xp_cmdshell 'bcp xxx.dbo.yyy out xxx.fil -T'
>> In the other case, it seems that shelling out and then logging back in as
>> a
>> Trusted Connection raised the error.
>> In their case, changing the SQL Server service from running as Local
>> System
>> to running as a domain login resolved the problem. (Of course, you need
>> to
>> have or create a domain account with the proper permissions.)
>> RLF
>>
>> "Jeff Stroope" <JeffStroope@.discussions.microsoft.com> wrote in message
>> news:D5B0F3ED-5538-4E89-8A97-E985003A981F@.microsoft.com...
>> > Hi - I just created a job in SQL Server using Management Studio. This
>> > is
>> > the
>> > first time I've tried to build a job. The job failed to execute at the
>> > scheduled time and it fails when I start it manually. Looking at the
>> > Job
>> > History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM.
>> > Login
>> > failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The
>> > step
>> > failed."
>> >
>> > I tried to pick a different user from the Run as drop down in the Job
>> > step
>> > properties window, but the drop down is empty. Does anyone know what
>> > might
>> > be going on here?
>> > --
>> > Thanks,
>> >
>> > Jeff
>>|||Hi,
Did you find the solution for this. Even I am facing similar problem.
I am trying to configure a linked server with the following settings
sp_addlinkedserver 'Linked Server Name', 'SQL Server'
sp_addlinkedsrvlogin @.rmtsrvname = 'Linked Server Name'
, @.useself = 'FALSE'
, @.locallogin = 'Domain\LoginName'
, @.rmtuser = 'DatabaseUserName'
, @.rmtpassword = 'DatabaseUSerPassword'
If I run the query against this linked server I get the perfect result.
Now I have scheduled a Job which runs on sa account. It always throws the
error:
Executed as user: NT AUTHORITY\SYSTEM. Login failed for user
'DOMAIN\MACHINENAME'. [SQLSTATE 28000] (Error 18456).
Let me know on what I am doing wrong.|||Praveen,
What you have said is, if the linked server is accessed by login
'Domain\LoginName' then log in remotely as 'DatabaseUserName' using
'DatabaseUSerPassword'. If the linked server is accessed by any other
login, then that login's security context.
If I understood correctly, you said that the job runs as 'sa', which is a
local SQL Server login and has no domain rights. You messages refer to NT
AUTHORITY\SYSTEM and 'DOMAIN\MACHINENAME', to which you do not seem to have
granted any special rights to the 'Linked Server Name' server.
Also, it appears that the SQL Server service is running as the local system
account, but a best practice is to run the SQL Server service as a domain
account and not as local system. You can see that a domain account would be
handier for accessing anything not on the local server. (If I properly
understood your setup.)
Perhaps you could add:
sp_addlinkedsrvlogin @.rmtsrvname = 'Linked Server Name'
, @.useself = 'FALSE'
, @.locallogin = 'sa'
, @.rmtuser = 'DatabaseUserName'
, @.rmtpassword = 'DatabaseUSerPassword'
FWIW,
RLF
"Praveen" <Praveen@.discussions.microsoft.com> wrote in message
news:67D35848-9BB7-49E8-B128-B26E040F7D8E@.microsoft.com...
> Hi,
> Did you find the solution for this. Even I am facing similar problem.
> I am trying to configure a linked server with the following settings
> sp_addlinkedserver 'Linked Server Name', 'SQL Server'
> sp_addlinkedsrvlogin @.rmtsrvname = 'Linked Server Name'
> , @.useself = 'FALSE'
> , @.locallogin = 'Domain\LoginName'
> , @.rmtuser = 'DatabaseUserName'
> , @.rmtpassword = 'DatabaseUSerPassword'
>
> If I run the query against this linked server I get the perfect result.
> Now I have scheduled a Job which runs on sa account. It always throws the
> error:
> Executed as user: NT AUTHORITY\SYSTEM. Login failed for user
> 'DOMAIN\MACHINENAME'. [SQLSTATE 28000] (Error 18456).
> Let me know on what I am doing wrong.
>|||Russell,
Now I have removed all the logins and had defaulted to DatabaseUserName and
DatabaseUserPassword for all the logins.
What I did was [this is in SQL Server 2005]
1. Right click Linked Servers -> New Linked Server
2. General tab:
Linked Server: Name of the SQL Server. Let us call this as 'Linked Server'
Server type: SQL Server
3. Security tab:
No Local Server Logins were added. Add selected the option "Be made using
this security context" in the list of options. Remote Login and Password are
DatabaseUserName and DatabaseUserPassword.
This setup I believe that regardless of the access account from the source
machine [machine from which i am querying the linked server] it always trys
to connect as DatabaseUserName to the linked server.
This works perfectly fine on any query made to the linked server. I can
access table objects, sysobjects of Linked Server from the Source Machine.
The same queries if I make them in the Stored Procedure and schedule to
execute the SP as a Job doesn't works.
Executed as user: NT AUTHORITY\SYSTEM. Server 'LinkedServerName is not
configured for RPC. [SQLSTATE 42000] (Error 7411). The step failed.
The difference between direct query and the job is that in direct query is
through the Window authentication mode, which is "Domain\UserName" account
whereas through job in Source machine sa account.
With the setup of Linked server I believe it should always go through the
DatabaseUserName and DatabasePassword credentials.
What is the wrong here?|||Praveen,
Yes, with a hardwired remote Login and Password I would expect all access
to be through that login. What now? Well, you are now getting the message:
Server 'LinkedServerName is not configured for RPC.
Please look at the Linked Server Properties, the Server Options tab. Make
sure the RPC settings are TRUE.
RLF
"Praveen" <Praveen@.discussions.microsoft.com> wrote in message
news:2C20479D-7A59-4910-8647-A334E8EF4A95@.microsoft.com...
> Russell,
> Now I have removed all the logins and had defaulted to DatabaseUserName
> and
> DatabaseUserPassword for all the logins.
> What I did was [this is in SQL Server 2005]
> 1. Right click Linked Servers -> New Linked Server
> 2. General tab:
> Linked Server: Name of the SQL Server. Let us call this as 'Linked
> Server'
> Server type: SQL Server
> 3. Security tab:
> No Local Server Logins were added. Add selected the option "Be made
> using
> this security context" in the list of options. Remote Login and Password
> are
> DatabaseUserName and DatabaseUserPassword.
> This setup I believe that regardless of the access account from the source
> machine [machine from which i am querying the linked server] it always
> trys
> to connect as DatabaseUserName to the linked server.
> This works perfectly fine on any query made to the linked server. I can
> access table objects, sysobjects of Linked Server from the Source Machine.
> The same queries if I make them in the Stored Procedure and schedule to
> execute the SP as a Job doesn't works.
> Executed as user: NT AUTHORITY\SYSTEM. Server 'LinkedServerName is not
> configured for RPC. [SQLSTATE 42000] (Error 7411). The step failed.
> The difference between direct query and the job is that in direct query is
> through the Window authentication mode, which is "Domain\UserName" account
> whereas through job in Source machine sa account.
> With the setup of Linked server I believe it should always go through the
> DatabaseUserName and DatabasePassword credentials.
> What is the wrong here?
>

How come my SQL Server Job won't run?

Hi - I just created a job in SQL Server using Management Studio. This is the
first time I've tried to build a job. The job failed to execute at the
scheduled time and it fails when I start it manually. Looking at the Job
History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM. Login
failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The step
failed."
I tried to pick a different user from the Run as drop down in the Job step
properties window, but the drop down is empty. Does anyone know what might
be going on here?
Thanks,
Jeff
Hi Jeff,
What is your job supposed to do? On the job history expand the job steps and
look for additional error messages every step. If applicable also check the
SQL Server error log.
You can also try the Advanced page on the Job Step section and specify an
output file. Then run the job again and see if you can find some additional
error information there.
Perhaps you do not need to change the 'Run as' section until you know what
the problem is.
Hope this helps,
Ben Nevarez
Senior Database Administrator
"Jeff Stroope" wrote:

> Hi - I just created a job in SQL Server using Management Studio. This is the
> first time I've tried to build a job. The job failed to execute at the
> scheduled time and it fails when I start it manually. Looking at the Job
> History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM. Login
> failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The step
> failed."
> I tried to pick a different user from the Run as drop down in the Job step
> properties window, but the drop down is empty. Does anyone know what might
> be going on here?
> --
> Thanks,
> Jeff
|||Jeff,
I just ran into someone getting the same error message. Are you by any
change running something like the following TSQL step?
exec xp_cmdshell 'bcp xxx.dbo.yyy out xxx.fil -T'
In the other case, it seems that shelling out and then logging back in as a
Trusted Connection raised the error.
In their case, changing the SQL Server service from running as Local System
to running as a domain login resolved the problem. (Of course, you need to
have or create a domain account with the proper permissions.)
RLF
"Jeff Stroope" <JeffStroope@.discussions.microsoft.com> wrote in message
news:D5B0F3ED-5538-4E89-8A97-E985003A981F@.microsoft.com...
> Hi - I just created a job in SQL Server using Management Studio. This is
> the
> first time I've tried to build a job. The job failed to execute at the
> scheduled time and it fails when I start it manually. Looking at the Job
> History, the error message says, "Executed as user:NT AUTHORITY\SYSTEM.
> Login
> failed for user 'domain\mycomputer$.[SQLSTATE 28000] (Error 18456). The
> step
> failed."
> I tried to pick a different user from the Run as drop down in the Job step
> properties window, but the drop down is empty. Does anyone know what
> might
> be going on here?
> --
> Thanks,
> Jeff
|||Hi Ben - the job is supposed to run a stored procedure. The job only has one
step, which is "execute sp_storedProcedure". I'll try the output file and
see what happens.
Thanks,
Jeff
"Ben Nevarez" wrote:
[vbcol=seagreen]
> Hi Jeff,
> What is your job supposed to do? On the job history expand the job steps and
> look for additional error messages every step. If applicable also check the
> SQL Server error log.
> You can also try the Advanced page on the Job Step section and specify an
> output file. Then run the job again and see if you can find some additional
> error information there.
> Perhaps you do not need to change the 'Run as' section until you know what
> the problem is.
> Hope this helps,
> Ben Nevarez
> Senior Database Administrator
>
> "Jeff Stroope" wrote:
|||Thanks Russell - no, I'm just trying execute a stored procedure that queries
some tables in a database on a linked server and then populates tables on the
job server.
Thanks,
Jeff
"Russell Fields" wrote:

> Jeff,
> I just ran into someone getting the same error message. Are you by any
> change running something like the following TSQL step?
> exec xp_cmdshell 'bcp xxx.dbo.yyy out xxx.fil -T'
> In the other case, it seems that shelling out and then logging back in as a
> Trusted Connection raised the error.
> In their case, changing the SQL Server service from running as Local System
> to running as a domain login resolved the problem. (Of course, you need to
> have or create a domain account with the proper permissions.)
> RLF
>
> "Jeff Stroope" <JeffStroope@.discussions.microsoft.com> wrote in message
> news:D5B0F3ED-5538-4E89-8A97-E985003A981F@.microsoft.com...
>
>
|||Jeff,
OK, but you still have an execution context issue since you are going to
another server. A couple more questions:
1. Who is the job owner of the SQL Agent job? Your login? The 'sa'
account? NT AUTHORITY\SYSTEM? A domain login? A SQL Server login?
2. How do you have your security set on the linked server? Check the
security tab of the linked server definition. Local login impersonation?
The login's current security context? A specific login?
You might be able to manipulate the linked server definition to get this to
work for you. But, as is, I suspect that the local system account is at the
root of the problem for the job you have defined.
RLF
"Jeff Stroope" <JeffStroope@.discussions.microsoft.com> wrote in message
news:FA4BED9F-1877-4B01-ADA5-3F1B49027EC9@.microsoft.com...[vbcol=seagreen]
> Thanks Russell - no, I'm just trying execute a stored procedure that
> queries
> some tables in a database on a linked server and then populates tables on
> the
> job server.
> --
> Thanks,
> Jeff
>
> "Russell Fields" wrote:
|||Hi,
Did you find the solution for this. Even I am facing similar problem.
I am trying to configure a linked server with the following settings
sp_addlinkedserver 'Linked Server Name', 'SQL Server'
sp_addlinkedsrvlogin @.rmtsrvname = 'Linked Server Name'
, @.useself = 'FALSE'
, @.locallogin = 'Domain\LoginName'
, @.rmtuser = 'DatabaseUserName'
, @.rmtpassword = 'DatabaseUSerPassword'
If I run the query against this linked server I get the perfect result.
Now I have scheduled a Job which runs on sa account. It always throws the
error:
Executed as user: NT AUTHORITY\SYSTEM. Login failed for user
'DOMAIN\MACHINENAME'. [SQLSTATE 28000] (Error 18456).
Let me know on what I am doing wrong.
|||Praveen,
What you have said is, if the linked server is accessed by login
'Domain\LoginName' then log in remotely as 'DatabaseUserName' using
'DatabaseUSerPassword'. If the linked server is accessed by any other
login, then that login's security context.
If I understood correctly, you said that the job runs as 'sa', which is a
local SQL Server login and has no domain rights. You messages refer to NT
AUTHORITY\SYSTEM and 'DOMAIN\MACHINENAME', to which you do not seem to have
granted any special rights to the 'Linked Server Name' server.
Also, it appears that the SQL Server service is running as the local system
account, but a best practice is to run the SQL Server service as a domain
account and not as local system. You can see that a domain account would be
handier for accessing anything not on the local server. (If I properly
understood your setup.)
Perhaps you could add:
sp_addlinkedsrvlogin @.rmtsrvname = 'Linked Server Name'
, @.useself = 'FALSE'
, @.locallogin = 'sa'
, @.rmtuser = 'DatabaseUserName'
, @.rmtpassword = 'DatabaseUSerPassword'
FWIW,
RLF
"Praveen" <Praveen@.discussions.microsoft.com> wrote in message
news:67D35848-9BB7-49E8-B128-B26E040F7D8E@.microsoft.com...
> Hi,
> Did you find the solution for this. Even I am facing similar problem.
> I am trying to configure a linked server with the following settings
> sp_addlinkedserver 'Linked Server Name', 'SQL Server'
> sp_addlinkedsrvlogin @.rmtsrvname = 'Linked Server Name'
> , @.useself = 'FALSE'
> , @.locallogin = 'Domain\LoginName'
> , @.rmtuser = 'DatabaseUserName'
> , @.rmtpassword = 'DatabaseUSerPassword'
>
> If I run the query against this linked server I get the perfect result.
> Now I have scheduled a Job which runs on sa account. It always throws the
> error:
> Executed as user: NT AUTHORITY\SYSTEM. Login failed for user
> 'DOMAIN\MACHINENAME'. [SQLSTATE 28000] (Error 18456).
> Let me know on what I am doing wrong.
>
|||Russell,
Now I have removed all the logins and had defaulted to DatabaseUserName and
DatabaseUserPassword for all the logins.
What I did was [this is in SQL Server 2005]
1. Right click Linked Servers -> New Linked Server
2. General tab:
Linked Server: Name of the SQL Server. Let us call this as 'Linked Server'
Server type: SQL Server
3. Security tab:
No Local Server Logins were added. Add selected the option "Be made using
this security context" in the list of options. Remote Login and Password are
DatabaseUserName and DatabaseUserPassword.
This setup I believe that regardless of the access account from the source
machine [machine from which i am querying the linked server] it always trys
to connect as DatabaseUserName to the linked server.
This works perfectly fine on any query made to the linked server. I can
access table objects, sysobjects of Linked Server from the Source Machine.
The same queries if I make them in the Stored Procedure and schedule to
execute the SP as a Job doesn't works.
Executed as user: NT AUTHORITY\SYSTEM. Server 'LinkedServerName is not
configured for RPC. [SQLSTATE 42000] (Error 7411). The step failed.
The difference between direct query and the job is that in direct query is
through the Window authentication mode, which is "Domain\UserName" account
whereas through job in Source machine sa account.
With the setup of Linked server I believe it should always go through the
DatabaseUserName and DatabasePassword credentials.
What is the wrong here?
|||Praveen,
Yes, with a hardwired remote Login and Password I would expect all access
to be through that login. What now? Well, you are now getting the message:
Server 'LinkedServerName is not configured for RPC.
Please look at the Linked Server Properties, the Server Options tab. Make
sure the RPC settings are TRUE.
RLF
"Praveen" <Praveen@.discussions.microsoft.com> wrote in message
news:2C20479D-7A59-4910-8647-A334E8EF4A95@.microsoft.com...
> Russell,
> Now I have removed all the logins and had defaulted to DatabaseUserName
> and
> DatabaseUserPassword for all the logins.
> What I did was [this is in SQL Server 2005]
> 1. Right click Linked Servers -> New Linked Server
> 2. General tab:
> Linked Server: Name of the SQL Server. Let us call this as 'Linked
> Server'
> Server type: SQL Server
> 3. Security tab:
> No Local Server Logins were added. Add selected the option "Be made
> using
> this security context" in the list of options. Remote Login and Password
> are
> DatabaseUserName and DatabaseUserPassword.
> This setup I believe that regardless of the access account from the source
> machine [machine from which i am querying the linked server] it always
> trys
> to connect as DatabaseUserName to the linked server.
> This works perfectly fine on any query made to the linked server. I can
> access table objects, sysobjects of Linked Server from the Source Machine.
> The same queries if I make them in the Stored Procedure and schedule to
> execute the SP as a Job doesn't works.
> Executed as user: NT AUTHORITY\SYSTEM. Server 'LinkedServerName is not
> configured for RPC. [SQLSTATE 42000] (Error 7411). The step failed.
> The difference between direct query and the job is that in direct query is
> through the Window authentication mode, which is "Domain\UserName" account
> whereas through job in Source machine sa account.
> With the setup of Linked server I believe it should always go through the
> DatabaseUserName and DatabasePassword credentials.
> What is the wrong here?
>

How come my database do not have a record id?

this is my first time used M.Access, so i not very sure is it Access do not have a record id that it will auto generate itself one when i insert a record? if i cannot find.. what is the way that i can enable it?How do i extract the record id of my access records in java?

How change the scale of x Axis?

Hi, how do I change the scale of x axis to a larger time scale than the data ?

Data is in quarters and I want that to be displayed in a line graph, but I want the labels to show hours

(it becomes messy otherwise when showing several days)

Thank You,

Regards

G?ran

You may want to take a look at the chart label section of the following article: http://msdn2.microsoft.com/en-us/library/aa964128.aspx#moressrscharts_topic3

-- Robert

|||

Thanks, a useful article.

Guess I figured it out myself, I grouped on this to avoid quarter labels:

SELECT DATEPART(DAY,QuarterDate) as DayGroup, DATEPART(HOUR,QuarterDate) as HourGroup

Monday, March 19, 2012

How can you tell who SQL 2005 components are installed?

I have a new customer who I am trying to document his SQL 2005 server only I am haveing a hard time telling what components are installed such as:

Replication, Full-Text Search, Analysis Services, Reporting Services, Notification Services, Integration Services, Ect.

Anyone know an easy way to check what was installed?

Shaun

There are several ways to accomplish this, but my suggestion would be to go to Add/Remove Programs, click on the SQL Server 2005 entry, and click on the Change button. This will bring up a new window, showing the instances and common components. For version information, you can click on the "Report" button.

Thanks,
Sam Lester (MSFT)

Friday, March 9, 2012

How can User add order from only one company at a time

tblUser
--
UserID uniqueidentifier PK (newid)
UserName varchar(MAX)

tblCompany
-
CompanyID uniqueidentifier PK newid()
CompanyName varchar(MAX)

tblUserCart
--
CompanyID uniqueidentifier FK newid()
UserID uniqueidentifier PK
Product varchar(MAX)

Asume we got 3 tables like above. Relation ship is clear: tbluser ->tblUserCart--<tblCompany

What i want is , if user gives an order from a company , sql 2005 will decline the orders from other Companies. Naturally Orders are stored in the tblUserCart table. For example, if user Arnold gives an order of CuttingTool from Company named T3 , Arnold will not be able to give another order from other than T3. I hope im clear about situation.

Happy Coding...

Do you have an application that sits on top of the database so that the tables are populated via the application? If so, that's where I'd perform your logic, rather than trying to build some trigger-based/stored procedure solution in SQL Server.|||I agree.

I would use various SELECT functions within your application to validate weather Arnold could place another order.

So, adding an order for a particular user, query the UserCart table for that user. If an order exists for that user, then flag the app user or only show products from company T3

We could write this as a procedure, put lets put the client back into Client / Server |||So answer is , do it on application. Thanks for answers.

Sunday, February 19, 2012

How can I test if Time-intelligence and its time periods for data calculation over periods are r

Hi, all experts here,

How could we test if the time intelligence and its time periods for data calculation over periods are recognized by the server and working properly? As though I implemented the time intelligence and defined the time periods for it, and it is processed successfully. But how could we actually see the testing results of these time intelligence and its data?

Hope my question is clear for your help.

I am looking forward to hearing from you shortly.

Thanks a lot.

With best regards,

Yours sincerely,

Maybe you could read this article and then try to see how the wizard modified your solution and come up with verification?

http://www.sqlmag.com/articles/index.cfm?articleid=46157&

|||

Hi, Andrew,

Thanks a lot for your help.

With best regards,

Yours sincerely,