[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

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

Has anybody used Azure Site Recovery to protect a SQL Server 2008 standard edition cluster?

I am just trying to wrap my head around how the data gets sync'ed. Typically a hot data synchronization is an enterprise feature however this article states that ASR can be used to protect a SQL Server 2008 SE fail over cluster.

I don't see any details on how the data sync works though.
- https://docs.microsoft.com/en-us/azure/site-recovery/site-recovery-sql

Can anybody share their experience with Azure Site Recovery specific to SQL Server 2008 standard edition.

Thanks experts!
0
Protecting & Securing Your Critical Data
LVL 1
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

You receive an error message when you try to create a differential database backup in SQL Server 2008

Cannot perform a differential backup for database namedb, because a
current database backup does not exist. Perform a full database backup by
reissuing BACKUP DATABASE, omitting the WITH DIFFERENTIAL option.
BACKUP DATABASE is terminating abnormally.

We use TSM,  TDP for SQL to do the backups.
0
Hi All,

I have below code:
	 --IF OBJECT_ID('tempdb..#TEMP') IS NOT NULL 
	 if OBJECT_ID('tempdb..#TEMP') is not null
	 BEGIN
DROP TABLE  #TEMP
END

 

	if 'YASMINE 1017 1548' = ''
	BEGIN
	 
	   SELECT  
	  DISTINCT
	  BarangCode
	  INTO #TEMP
	  FROM TMSTOKBARANGDETIL2018 A
	  WHERE NoTransaksi = 'BS 20180101' 

	END
	ELSE
	BEGIN

	 

	   SELECT  
	  'YASMINE 1017 1548' AS BarangCode
	  INTO #TEMP
	   
	   		 DROP TABLE #TEMP
  
		

Open in new window


I get :

Msg 2714, Level 16, State 1, Line 31
There is already an object named '#TEMP' in the database.
Msg 102, Level 15, State 1, Line 31
Incorrect syntax near '#TEMP'.

What is the problem ?

Thank you.
0
Guys,
I have a situation where  I need to migrate / copy existing  logins from windows authentication to - sql authentication. Every windows  Logins  has specific server role, database role and attach to  schema. So  in order to copy this login and again create them as sql logins, do you guys able to recommend a method of doing this ? currently this sql server has around 2000 actives windows login that I must convert them to sql authentication.
0
I need help with the code below.

Business Need - for any procedure greater than or equal to 7, I need to look back at the procedures 1 - 6 and only use the values used in this result set for the procedures greater than or equal to 7. I am only concerned with the PatientVisitDiags1 through PatientVisitDiags9 fields.

If you look at my screenshot, it helps visualize my need better. In this screenshot, CPTCode 76000 was used and is in the 'ListOrder' = 7, so it applies for this rule. For this CPTCode, the doctor used the following:

PatientVisitDiags1 = 3
PatientVisitDiags2 = 4
PatientVisitDiags3 = 5
PatientVisitDiags4 = 8
PatientVisitDiags5 = NULL
PatientVisitDiags6 = NULL
PatientVisitDiags7 = NULL
PatientVisitDiags8 = NULL
PatientVisitDiags9 = NULL

Because "5" was not used in any of these fields in ListOrder 1 through 6, I need to eliminate it on the procedures 7 and greater.

I need 76000 to have this:

PatientVisitDiags1 = 3
PatientVisitDiags2 = 4
PatientVisitDiags3 = 8
PatientVisitDiags4 = NULL
PatientVisitDiags5 = NULL
PatientVisitDiags6 = NULL
PatientVisitDiags7 = NULL
PatientVisitDiags8 = NULL
PatientVisitDiags9 = NULL


SELECT
     pvp.ProceduresId
   , pvp.CPTCode
   , pvp.ListOrder
   , pvp.PatientVisitDiags1
   , pvp.PatientVisitDiags2
   , pvp.PatientVisitDiags3
   , pvp.PatientVisitDiags4
   , pvp.PatientVisitDiags5
   , pvp.PatientVisitDiags6
   , pvp.PatientVisitDiags7
   , pvp.PatientVisitDiags8
   , 

Open in new window

0
SQL Server 2008 R2 Developer Edition

Hello Sir,
My DBCC OPENTRAN Displays

Oldest active transaction:
    SPID (server process ID): 67s
    UID (user ID) : -1
    Name          : DELETE
    LSN           : (286474:1220:6)
    Start time    : Oct  2 2018  1:10:17:007AM
    SID           : 0x0105000000000005150000005080301bd0cce941ef8d2526df040000

How can i kill it
0
Hi All, I am running replication in one of my environment. I am facing blocking issue. I observed table size for MSmerge_tombstone is too much large. Table count is 3184806.
Is there anyway we can purge this table. Is there any dependency?

Regards
Abdul Wahab
0
Scenario:

Table : Supp
Columns:
AppUser
SQLUser
DateCreated
DateModified
SuppCode
SuppDesc
Address
SuppType

Whenever application changing 'SuppDesc' column data in 'Supp' Table, we need details include hostname (user modifying application from his desktop) through email alert.

Version : SQL Server 2008 R2.

Please help me with solution.

Thanks,
Chandra
0
Hi,
  Does anyone have experience in HP ALM Quality Center version 11?  The previous tech left so there is little info. about this setup with no support contract.
 Currently everything for Quality Center (JBOSS, Microsoft SQL Server 2008 R2, Win 2008 R2 Ent. ) is installed in one VM and it's one serves this function.

Any recommendations on a backup and restore plan should anything goes wrong with this server or on the HP ALM Quality Center version 11 application?
qc.jpg
0
I Need to alter an extended stored procedure in SQL 2008R2.  Pretty much exactly like here: https://www.experts-exchange.com/questions/21081340/Microsoft-SQL-System-Extendend-Stored-Procedure-Overwrite-sp-executesql.html 
Though that ended up without a solution.

I need to use the same name as an Existing stored procedure though.

I want to be able to test for a parameter to the Stored procedure and Exit if it contains a keyword. If it does not, then I want to execute the original SP as usual.

So something like:

sys.sp_executesql  -> sp_origexecutesql

New sys.sp_executesql  
      if @P1 = "Select * from NoNoTable" return NULL
      Else exec sp_origexecutesql @P1

I have SysAdmin Access to the SQL Server, so I can make any changes there. I can Create my Own DLL Code if needed too. I just don't have access to all of the Code that is running against the SQL Server and I want to Intercept some of the sp_executesql Commands.

Thanks,
0
JavaScript Best Practices
LVL 12
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

I had to change my login in active directory.  After doing that all of my SSRS (2008 R2) subscriptions wouldn't run because the previous AD entry didn't exist.  I had a tool to make those changes, but I still have the same issue when I create a new subscription.  It says my AD login isn't recognized.  How do I change that?  I've googled it and found some hits, but nothing quite explains how to fix the issue for new subscriptions.  Can I just go to the users table and change the old login to the new login?
0
we have sccm and scom 2012 r2 running on windows 2008 r2 as the OS. database on a different server running windows 2008 r2 and sql 2008.

we want to upgrade the OS of sccm, scom and sql servers

we want to upgrade sccm and scom to system center cb 1802 or later.

it is best to install fresh deployments of all and try and migrate data.

or look at the option of inplace upgrade.
0
Database Migration from HP Storage to DELL EMC:
After renaming of SQL Server 2008 R2 Default instance, We are unable to connect Management Studio from remotely for Windows Authentication users. It is working fine for SQL Server Authentication users.

Error: The target principal name is incorrect. Cannot generate SSPI context.

Meantime for SQL Server 2014 it is working fine.

Scenario 1:
Server : SQLCL (SQL Server 2008 R2) - We have build new server with the name as SQL2 then migrated the databases, added alias name as SQLCL. In this scenario, we faced same mentioned above error.
Server:  DBCL (SQL Server 2014): We have build new server with the name as SQL1 then migrated the databases, added alias name as DBCL. In this scenario, we have no issues.

Scenario 2:
Again We have renamed the server from SQL2 to SQLCL and SQL1 to DBCL but Still we are getting same error for SQL Server 2008 R2 version installed.

But we have no issues jobs and every thing fine. Please help us.

Thanks,
Chandra
0
Hi,

I have a DTS job that uploads some CSV data into a SQL table.

I wanted to schedual the DTS using an SQL job.

I have setup the job in SQL but when it is executed through the SQL job it fails (see error message below).

If I run the DTS directly it works ok.

I think it is something to do with the user permissions but I don't know why it fails as SQL user I have setup (web_admin) has SA rights.

Any ideas?

DTS fail
0
How would one pull out the numeric text from within a varchar field?  For example, I need to write a formula to determine overall dosage a patient could take in a given day.  The instructions for the medication is stored as one long string like;

take 1 tablet by oral route  every 4 hours as needed

Open in new window


I'd like to pull out the first numeric entry from the left and place it into a column named 'Quantity' and the first numeric entry from the right and put it in a column named 'Frequency'.
I'd then multiply this by the dose to determine the overall usage of a medication.  Here is my current query;

select distinct p.person_id as [PID], p.last_name as [Last Name], p.first_name as [First Name], CAST(p.date_of_birth as DATE) as [Date of Birth], 
pm.medication_name as [Medication],pm.sig_desc as [Sig],  pm.start_date as [Start Date] from patient_medication pm
JOIN person p ON p.person_id = pm.person_id
JOIN fdb_medication f ON f.medid = pm.medid
where medication_name  like '%hydromorphone%' and p.expired_ind <> 'Y' and  (pm.date_stopped > GETDATE() or pm.date_stopped = '')
order by p.person_id 

Open in new window


Thanks for any help!
0
Hello,
How to set a column which is [Ref] [int] IDENTITY(1,1) NOT NULL to 1 . I tried to delete all rows in the table but still
when I insert a row in the table , theRef value is 33.

Regards
0
hi experts

i have two query's
--query UNO
SELECT [ERDAT     ]
      ,A.[TRDAT     ]
	  ,[Tipo usuario contractual     ]
      ,[Texto       ]
FROM [SMI].[dbo].[01102018_01_USR02] A 
		JOIN [SMI].[dbo].[01102018_USMM] B	ON A.[BNAME       ] = B.[Usuarios    ]
		JOIN [dbo].[02102018_USR05] C ON B.[Usuarios    ] = C.[BNAME       ]
WHERE  [UFLAG] NOT IN (192,64 ) AND
		[PARID                 ] like '%BUK%'
		and [Texto       ] = 'Diálogo     '
		AND try_convert(datetime, [ERDAT     ], 103) > try_convert(datetime, '31.10.2017', 103)
order by try_convert(datetime, [ERDAT     ], 103) 

--QUERY DOS
SELECT BNAME, [BUK], [BZPNR]
FROM (
		SELECT * FROM [dbo].[02102018_USR05]
	 ) AS Data
PIVOT
(
	MAX(PARVA)
	FOR PARID IN ([BUK], [BZPNR])
) AS PVT_Data

Open in new window


How can I join the queries to have a single result?
0
Help with SQL SERVER 2008R2 view or stored procedure.

I have a view (CT_Work_Order_Warehouse_Headers_Pass_02) that the output looks like this:
BASE		LOT		SPLIT		SUB		SEQ		WAREHOUSE
CC181137.3		21		0		0		5		HOUMA
CC181137.3		21		0		0		10		TBD
CC181137.3		21		0		0		20		TBD
CC181137.3		21		0		0		30		PORT_ALLEN
CC181137.3		21		0		0		40		TBD
CC181137.3		21		0		0		50		HOUMA
CC181137.3		21		0		0		60		TBD
CC189999.3		1		0		1		10		PORT_ALLEN
CC189999.3		1		0		1		20		TBD
CC189999.3		1		0		1		30		TBD
CC189999.3		1		0		1		40		HOUMA
CC189999.3		1		0		1		50		TBD
CC181234		1		0		1		5		PORT_ALLEN
CC181234		1		0		1		10		TBD
CC181234		1		0		1		20		TBD

Open in new window


I need a view or stored procedure to make the data look like this:
BASE		LOT		SPLIT		SUB		SEQ		WAREHOUSE
CC181137.3		21		0		0		5		HOUMA
CC181137.3		21		0		0		10		HOUMA
CC181137.3		21		0		0		20		HOUMA
CC181137.3		21		0		0		30		PORT_ALLEN
CC181137.3		21		0		0		40		PORT_ALLEN
CC181137.3		21		0		0		50		HOUMA
CC181137.3		21		0		0		60		HOUMA
CC189999.3		1		0		1		10		PORT_ALLEN
CC189999.3		1		0		1		20		PORT_ALLEN
CC189999.3		1		0		1		30		PORT_ALLEN
CC189999.3		1		0		1		40		HOUMA
CC189999.3		1		0		1		50		HOUMA
CC181234		1		0		1		5		PORT_ALLEN
CC181234		1		0		1		10		PORT_ALLEN
CC181234		1		0		1		20		PORT_ALLEN

Open in new window


Note: Each starting SEQ will have a non 'TBD' warehouse for each different Base/Lot/Split/Sub
I know i need to go get the WAREHOUSE from the SEQ <= the current SEQ where it is not = 'TBD'

any help would be greatly appreciated.
0
hi experts

i have this query
SELECT
    [BNAME       ]
,      [PARID                 ]
      ,[PARVA                                   ]
  FROM [SMI].[dbo].[02102018_USR05]
  WHERE [BNAME       ] LIKE '%RLARA  %'

this is the results
BNAME             PARID                       PARVA                                  
RLARA             BUK                         1000                                    
RLARA             BZPNR                       13271                                  
RLARA             FIT_ALV_AR                  /CLIENTE EXT                            
RLARA             LE_SHP_DEL_MON_LISTT        HC                                      
RLARA             MOL                         PE                                      
RLARA             UGR                         PE                                      

but i need this
BNAME             BUK                         BZPNR                
RLARA             1000                      13271
0
Build an E-Commerce Site with Angular 5
LVL 12
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

In this app data is passed to and from the SQL server and parsed either in the DB to insert or the client for display.

The query passed to the Cursor is:

SELECT PropertyName, Property_ID, CrewChief FROM HTS.PropertyMaintenance WHERE DateOfActivity = 10-29-2018 ORDER BY  Document_ID ASC

It returns

Central Park             M3428       RC
Bryant Park              M83822      TJ
Prospect Park          B36482      WF

The string to built from this set:

'Central Park, M3428, RC, Bryant Park, M83822, TJ, Prospect Park, B36482, WF,'
(trailing comma is correct)

This SP returned a single column string successfully. When modified to return 3 column set it returns a null string? Can anyone see the error. I'm blind to it.
Thank you for any help.

CREATE PROCEDURE [HTS].[PropertyMaintenance_SELECT_DocumentsByDate]
(
      @QryByDate      varchar(300)
)
AS


declare @objcursor as cursor
 
declare
    @vsql       as nvarchar(max)
    ,@id        as int
    ,@value     as varchar(50)
   

DECLARE @list varchar(1000)
DECLARE @listTemp varchar(100)
DECLARE @description varchar(300)
DECLARE @description2 varchar(300)
DECLARE @description3 varchar(300)


set @vsql = 'set @cursor = cursor forward_only static for ' + @QryByDate + ' open @cursor; '
 
exec sys.sp_executesql
    @vsql
    ,N'@cursor cursor output'
    ,@objcursor output

fetch next from @objcursor into @description, @description2, @description3

while (@@fetch_status = 0)
begin

SET @listTemp =  …
0
Hello,

I am getting error;
Date cannot be converted to string

Please find the query below:
INSERT INTO TABLE1

SELECT IET.[In1]
   
         , ''
         , getdate()
         , ''
         , IET.[Name of Trt:]
       ,NULLIF(RTRIM(IET.[FROM]), '')      
        ,NULLIF(RTRIM(IET.[TO]), '') 
         , IET.[Trion] 
 FROM TABLE2 IET


WHERE [InvemGUID] NOT IN 
    (SELECT [InvemGUID] FROM TABLE1 )
 

Open in new window


The error is caused by
  ,NULLIF(RTRIM(IET.[FROM]), '')      
        ,NULLIF(RTRIM(IET.[TO]), '') 

Open in new window


Any suggestions?
Thanks
0
In the SQL Selects below the first one will get you an example of my data

The select unions is what I need as output

The Question Types can be literally anything and may be from 3 to 5 types
(IndividualTypeID is tied to an origin so everyone within that origin will have the same origin)

Not all Individuals will have all the Question Types
But they will all be constrained within a "set"
In this case... my example below... 2.
Marital Status and age


DECLARE @table TABLE
(
    IndividualID VARCHAR(100),
    QuestionType VARCHAR(100),
    AnswerText VARCHAR(100)
);
INSERT INTO @table
(
    IndividualID,
    QuestionType,
    AnswerText
)
VALUES
(4819540, 'MaritalStatus', 'Single'),
(4819540, 'Age', '25-75'),
(4819546, 'Age', '18-24'),
(4819599, 'MaritalStatus', 'Married');

SELECT * FROM @table



SELECT 4819540 IndividualID, 'Single' MaritalStatus, '25-75' Age
UNION ALL
SELECT 4819546, '', '18-24'
UNION ALL
SELECT 4819599, 'Married', ''

Open in new window

0
I need to set a table lock in  Microsoft SQL Server 2008 for the duration of an update process.

The end user has multiple independent applications that utilise the database all from independent vendors.

I have experimented with executing a query incorporating "WITH TABLOCKX" but this results in a hang in one of the other independent applications indicating the lock is applied but not trapped.  Attached (query1.jpg) is the result of a query on sys.dm_tran_locks that I run to test for existing locks in order to determine if my process can run.
What I need is a query to apply the locks in a way that is trapped by the other independent applications.T_SQL query on sys.dm_tran_locks
0
Hi,
 Please find attached Image.
My query
I have Created Data warehouse. For example
Dimension Table : DimSite, DimCustomer,DimSalesperson
FactTable : FactinvoiceDetails

DimSite is Include

SiteID    Sitename

1            United Kigdom
2           USA
3           France

DimCustomer
SiteID       CustomerID CustomerName
1                R001             Ryan
2                R001             Bryan
3                R001            Stephen

DimSalesperson
SiteID       SalespersonID      SalespersonName
1                S001                       Mark
2                S001                       Stacy
3                S001                       Franck


My question is

I have to connect DimCustomer and DimSalesPerson to DimSite Table also
FactTables.png
0
I have a winforms ERP software built using C# dotnet. Database is sql server. My issue is with installation at client side. It is taking huge time to install. Major time consuming is the installation of MSSQL server and its Management Studio. Is it necessary that I should install sql server at client side? Is there any option where I can copy the mdf and ldf files of the sql database to the system and connect with my application (like we do with access database)
1

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.