Microsoft SQL Server 2008

49K

Solutions

17K

Contributors

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the  Always On technologies and support for unstructured data types.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi there,
   We have log shipping for 4 databases which are going well but however only Restore Jobs for two databases gets failed in DR environment occasionally. The error message says like this
Executed as user: xxxxxxxxx. The process could not be created for step 1 of job 0x867837754D077D4A9BFF608D000072BD (reason: 5).  The step failed.

I have configured the Job->Step->Advanced->output file to capture the error message but this error was not written in the output file as well. In fact this error doesn't seem to be happened at all as I can see the output file has only log which is written before the last run which was failed.

thanks
Deepak
0
Free Tool: Path Explorer
LVL 9
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

We have a BOM (Bill of Materials) table named BM_BillDetails. Within it are 2 fields named BillNo and ComponentItemCode.

We are trying to create a PHP program function to extract any top-level BOM and all of its sub-BOMs recursively and place the results into either an array or a temporary table.

In other words:

A top-level BOM contains several component items.  Each of these contain sub-BOMs of their own in addition to just plain items.  So we want to build a complete BOM array or temporary table until there are no more levels to find.

The database itself is a Microsoft SQL database running living on a Microsoft 2014 SQL Server.  We access the database for many different reasons using simply PHP.

Thank you for your help.
0
Hi,
I have insatlled my local machine 2008R2, if i have installed sql server 2014 ,it's going be a issue?
0
Hi,
I have create user "qry" and create table Sales.
I need to give access this user only sales year 2017, i don't want to show 2016<= sales.
How to do that?
Best regards
0
Hi there,
  I am in process of configuring logon trigger.
My need for this trigger is to restrict few SQL logins to only login from particular IP address:

I  got the below code from google, but when I setup the trigger, first time the user can able to login but next time when we disconnect and try again then the trigger is not letting to login the sql server even though we tried from the same machine(same IP address)

CREATE TRIGGER [TR_check_ip_address]
ON ALL SERVER
FOR LOGON
AS
BEGIN

    DECLARE @ip_addr varchar(48)

    SELECT @ip_addr = client_net_address
    FROM sys.dm_exec_connections
    WHERE session_id = @@SPID

    IF ORIGINAL_LOGIN() = 'Test' AND @ip_addr <> 'xxx.xx.xxx.xx'
        ROLLBACK;

END

thanks
Deepak
0
I have the same problem, after one year of fine work i have the error. Can help me; how i can disabled the HP program that tell is the problem
0
Hi,

I have MSSQL 2008 R2 Server that I need to reset the master key on one of the DB.  However, I cannot find the password for the current master key.  In my research to find a solution, I have found that I should be able to use;

ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'Not real password'

But I need to use the FORCE option.  Which I am not for sure how to use with the above query statement.

If this is correct, how do I use the FORCE option?

Thanks
0
I have a query that pulls records from the previous day. I would like the where clause to use the previous day's information. So in the example below, if I ran the query on 5/1/2017, I would want it to use " April of 2017" for the "MONTH" and if it was January 1st, 2018, I would want it to use the previous year for the GETDATE(). I only need this to happen on the first of the month since every other day it pulls the current month's information. Can someone assist?

SELECT blah FROM myTable
WHERE  YEAR(myDate) = YEAR(GETDATE()) 
	    AND MONTH(myDate) = MONTH(GETDATE()) 

Open in new window

0
I've inherited a linked server which drives our website. I recently discovered that not all of our replications to that linked server are complete. I'm missing sometimes thousands of records in some tables. I think what is happening is that some of the local publications never had subscriber jobs created so the snapshots are being created, but not moved to the linked server. When I try to create a new subscription job I get an error  that the "subscription to publication <xxxx> has expired or does not exist."

How do I even begin to resolve this? Google searches are only telling me how to create the subscription but doesn't really help resolve this specific issue.

I'll provide whatever additional information you need. The full error is here:
Date            6/28/2017 9:26:59 AM
Log            Job History (SQL12-ItemMaster-repl1_Cat_to_Opt-WIN-3EB9B225E5P-1069)

Step ID            2
Server            SQL12
Job Name            SQL12-ItemMaster-repl1_Cat_to_Opt-WIN-3EB9B225E5P-1069
Step Name            Run agent.
Duration            00:00:01
Sql Severity      0
Sql Message ID      0
Operator Emailed      
Operator Net sent      
Operator Paged      
Retries Attempted      0

Message
2017-06-28 14:26:59.919 Copyright (c) 2008 Microsoft Corporation
2017-06-28 14:26:59.919 Microsoft SQL Server Replication Agent: replmerg
2017-06-28 14:26:59.919
2017-06-28 14:26:59.919 The timestamps prepended to the output lines are expressed in terms of UTC time.
2017-06-28 14:26:59.919 User-specified agent parameter values:
                  -Publisher SQL12
                  -PublisherDB …
0
The Server (win 2008) name for one of our test Server was changed , however, the server hosted an SQL Database. with the change, it has resulted in us unable to connect to the SQL Database (sql 2008). the previous username does not work anymore and i even tried connecting with windows authentication and still nothing. is there anyway to resolve this?

Regards,
Grand
0
What is SQL Server and how does it work?
LVL 1
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Hello Experts,
I am trying to debug a Stored Procedure and I get the following error as soon as I Start Debugging.  Any idea what is going on?

Error Message:  Unable to start T-SQL debugging. Could not attach to sql server process on XXX.  The object exporter specified was not found.

Thank you in advance!
0
I have many columns in my report and I want to dynamically sort the columns which the user needed to sort in ascending order. How could this be done?
0
I am using MS SQL Server 2008 as my Database and I created a Stored Procedure that looks like this.

    USE [DB_Question]
    GO
   
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER Procedure [dbo].[Check_ExamID]
    @ExamID NVARCHAR(MAX)
    as
    SELECT * FROM TBL_ExamTimer WHERE ExamID = @ExamID

and here is my PHP code that suppost to be the target is to display data in my PHP site by using some criteria also.

    <html>
    <head>
   
    </head>
    <body>
    <?php
   
          include('config.php');
          include('adodb/adodb.inc.php');
          $db = ADONewConnection($dbdriver);
          $db->Connect($dsn, $username, $password);
          
          $procedure = $db->prepareSp('Check_ExamID');
          if (!$procedure)
        die ('Invalid or inaccessible stored procedure name');
          
          $parameter1Name = '@ExamID';
          $ok = $db->inParameter($procedure,$parameter1Name,'1234');
          $result = $db->execute($procedure);
     
   
    ?>
    </body>
    </html>

I am trying to display data where `ExamID =@ExamID` or `1234` for param of `@ExamID`

My Target here is to use my stored procedure to select data in my table and return it back in my php file but nothings happening. TYSM
0
Hello,

is there any way to modify chart arrowheads in SSRS? The proposed ones (Triangle, Sharp triangle, Lines) are quite ugly... I'd like to display axes with thinner and smaller arrowheads.
0
When installing SQL 2008 server R2 SP3 update it fails on the instances, here is the boot strap error

Overall summary:
  Final result:                  The patch installer has failed to update the following instance: MICROPOWER. To determine the reason for failure, review the log files.
  Exit code (Decimal):           -2068024447
  Exit facility code:            1212
  Exit error code:               29569
  Exit message:                  The patch installer has failed to update the following instance: MICROPOWER. To determine the reason for failure, review the log files.
  Start time:                    2017-05-15 23:30:06
  End time:                      2017-05-15 23:32:16
  Requested action:              Patch

Instance MICROPOWER overall summary:
  Final result:                  The patch installer has failed to update the shared features. To determine the reason for failure, review the log files.
  Exit code (Decimal):           -2068024447
  Exit facility code:            1212
  Exit error code:               29569
  Exit message:                  The patch installer has failed to update the shared features. To determine the reason for failure, review the log files.
  Start time:                    2017-05-15 23:31:41
  End time:                      2017-05-15 23:32:13
  Requested action:              Patch
  Log with failure:              C:\Program Files\Microsoft SQL Server\100\Setup …
0
I've been wrestling with these expressions for a while. I just don't know how to put these two expressions into one tidy expressions (if it's even possible).

=CSTR(First(Fields!DaysToExpiration.Value, "Revoked"))

=Fields!IsHidden.Value = "False"

Any help would be appreciated. Thanks!
0
Hello, was wondering if a new column is created in a tablix to give status of other column groups in case a row in any of the column groups gets blank. Am trying to put in an expression in that column created but it always gives me a null or error sometimes. any idea whats the best way to handle this. What i would like for the column to report is if other column groups have an empty field then write "missing information" on the created column for that row.
0
We are migrating over our ERP system to a new version. As part of migrating we are changing over from SQL 2008 to SQL 2014. When we create a view to a table in SQL 2008 and create a view to the same table in SQL 2014 and run them side by side, SQL 2008 finished producing the results in nearly half the time. We also notice that SQL 2014, while producing the results will pause every few seconds.

Any ideas on what is causing SQL 2014 to be running this data much slower than 2008?

(This slowness was originally noticed when reconnecting numerous MS Access 2010 applications to views that were created in SQL. They now run much slower when connected to the SQL 2014 Views) I don't believe the way the SQL views are created is the reason for this slowness due to the fact that we can connect directly to a table in SQL from Access and 2008 will still produce the results nearly twice as fast as connecting to SQL 2014 from access.


Thanks for any help or ideas!
0
sql server 11.0.2100

query is  



DECLARE  @FromBrCode INT =1001
DECLARE @ToBrCode INT =1637
DECLARE @Cdate DATE= '31-mar-2017'

SELECT a.PrdCd, a.Name, sum(b.Balance4) as Balance
FROM D009021 a, D010014 b
WHERE a.PrdCd=ltrim(rtrim(substring(b.PrdAcctId,1,8)))
AND substring(b.PrdAcctId,9,24)='000000000000000000000000'
AND a.LBrCode=b.LBrCode
AND a.LBrCode BETWEEN @FromBrCode AND @ToBrCode
AND b.CblDate=
(SELECT max(c.CblDate) FROM D010014 c
WHERE c.PrdAcctId=b.PrdAcctId
AND c.LBrCode=b.LBrCode
AND c.CblDate<=@Cdate)
GROUP BY a.PrdCd, a.Name
HAVING sum(b.Balance4)<>0
ORDER BY a.PrdCd

Open in new window


1.  this particular query taking too much time to complete execution
2. same problem in diffrent sql server
3. no table lock found , processor and memory usage normal while query running
4. normal "select top 1000 rows" working and showing output instantly in both table (D009021 , D010014)
5. reindex and rebuild done in both tables but problem not resolved (D009021 , D010014)
6. same query is working if we reduce number of branch
(
DECLARE  @FromBrCode INT =1001
DECLARE @ToBrCode INT =1001
)


7> same query is working if we replace any one variable and use value directly


AND a.LBrCode BETWEEN @FromBrCode AND @ToBrCode


changed to


AND a.LBrCode BETWEEN 1001 AND @ToBrCode


8> same query is working and giving output within 2 mins if we add "OPTION (RECOMPILE)" at end


9> tried to clean cache query execution plan and optimized new one but problem not resolved


10> found query estimate plan and actual execution plan is different please check screen shot


screenshot1.pngscreenshot2.png  
thanks in advance for any help.
0
SharePoint Admin?
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

HELLO...

We have an MSSQL-2008 based application.  One of our tables, the "AR_CUST" table...and, in particular, the "AR_CUST.TAX_CODE" field, has seen some very strange and inappropriate updates as of late.  In fact, in a number of instances, we are seeing "NULLs" in this field, where we *KNOW* there was valid data previously.

So, our quick question...is there any way, that we can "trap" who/what is being updated to, into this field?  Perhaps some sophisticated form of a SQL Trace...or any other method, that anyone can recommend, that is *easy* to implement for troubleshooting purposes?  We just need to get to the bottom, of why/how this (and some other) fields, are getting updated, and when.

Please help...we'd appreciate it!...Thanks!...Mark
0
With VBA, in MS Access 2013, I need to be able to read a MS SQL Server database diagram. I am working with a .accdb
0
favorite
I have 2 tables called 'table123' and 'table246'.

'table123' columns: 'ID', 'Dept_ID', 'First_Name', 'Surname', 'Salary', 'Address'.

'table246' columns: 'Dept_ID', 'Dept_Name'.

I want to find the list of employees with the lowest salary per department. Two of the ways I can do it is an Equi-Join or an Inner-Join. I've been told they can both be used to provide the desired result.

The queries I used:

Equi-Join:

SELECT First_Name, b.Dept_Name, alt.Min_Salary AS Min_Salary
FROM table123 a, table246 b,
(SELECT Dept_ID, MIN(Salary)Min_Salary
FROM table123
GROUP BY Dept_ID)alt
WHERE a.Dept_ID = b.Dept_ID
AND a.salary = alt.Min_Salary
AND a.Dept_ID = alt.Dept_ID;

Open in new window


Inner Join:

SELECT MIN(Salary)Min_Salary, Dept_Name
FROM table123 a, table246 b
INNER JOIN (SELECT First_Name, MIN(Salary)
FROM table123
GROUP BY Dept_ID)alt
ON b.Dept_ID = alt.Dept_ID;

Open in new window


The Equi-Join statement gives me the desired table, containing the columns 'First_Name', 'Dept_Name' & 'Min_Salary', with all relevant data.

However, the Inner-Join statement doesn't run because the First_Name column needs to be included in the aggregate function or GROUP BY clause. This really confuses me, as I don't know how to go about fixing it. How can I adjust the Inner-Join query, so as to give the same result as the Equi-Join query?
0
Hi,

I am not able to paragraph alighment with justify in SSRS 2014. Can you please help.
0
Hi Experts,
I need help rewriting my SQL Server query to determine whether or not to include a WHERE clause.
I have included my query below.

I want the WHERE clause to be included whenever the @Team variable is greater than 0, and exclude it if it is 0.

How can this be done?

Current Query:
Current query being used
thank you for your help,
mrotor
0
I am working on a fee collection software in multi user environment, where two users can work on same module without any conflict and clashing of data.
For example.
I am working on one computer and receipt no is 5 and same time another user is working on another computer and the receipt no is 5, and receiptno column in database is  with not null and UNIQUE features. let say if we both user want to save the records from multiple computers, how will it be allow to save. Right now it i m using locking to in C# that allow only one user can access the data from database and wont be free from locking unless I save the current records. One more thing receipt no must be consistently.

I hope u can understand my problem.


Thanks
0

Microsoft SQL Server 2008

49K

Solutions

17K

Contributors

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the  Always On technologies and support for unstructured data types.