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,

is it possible to connection Oracle OLAP , Oracle application server, Oracle BI answer and BI server to MS SQL ?

we are thinking about what if we just migrate Oracle DB to MS SQL DB and left the rest untouched.
0
Hello!

I have some performance problems with the following query:

exec DBP_Obtener_Reporte_Productividad_Trabajador @pcodi_operacion=N'02',@pcodi_lugar=N'',@pfech_inicio=N'2017/04/01',@pfech_termino=N'2018/04/30',@codi_usuario=N'SISTEMAS'

Open in new window


USE [PACKING]
GO

/****** Object:  StoredProcedure [dbo].[DBP_Obtener_Reporte_Productividad_Trabajador]    Script Date: 05/23/2018 12:34:14 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

  
 
  
CREATE PROCEDURE [dbo].[DBP_Obtener_Reporte_Productividad_Trabajador] (      
@PCODI_OPERACION   VARCHAR(3),      
@PCODI_LUGAR       VARCHAR(3),      
@PFECH_INICIO      VARCHAR(20),      
@PFECH_TERMINO     VARCHAR(20) ,      
@CODI_USUARIO      VARCHAR(100)    
)      
AS      
BEGIN       
    
SELECT A.*     
  INTO #DETALLE_ORDEN_PDT    
  FROM DETALLE_ORDEN_PDT  A  
    
    INNER JOIN  (    
    SELECT DISTINCT CODI_OPERACION,CODI_LUGAR  
    FROM BDGESTIONUSR.DBO.INFORMACION_USUARIO     
    WHERE  CODI_OPERACION = @PCODI_OPERACION    
    AND CODI_LUGAR    LIKE '%' + @PCODI_LUGAR +'%'       
    AND CODI_USUARIO  = @CODI_USUARIO ) USER_    
  ON A.CODI_OPERACION = USER_.CODI_OPERACION    
  AND A.CODI_LUGAR = USER_.CODI_LUGAR      
  WHERE CODI_COMPANIA IS NOT NULL AND     
 A.CODI_OPERACION =  @PCODI_OPERACION  AND     
 A.CODI_LUGAR  LIKE '%' + @PCODI_LUGAR +'%'      AND    
  CODI_SECTOR IS NOT NULL AND     
  LOTE_KEY IS NOT NULL AND     
  CODI_LINEA IS NOT NULL AND     
  CODI_TRABAJADOR IS NOT

Open in new window

0
Hi, I have a sample SQL Server 2016 database back up and would like to restore it on Azure SQL Database. Any ideas?

Thank you in advance.
0
Question - How do I use a variable for a table in the below SQL
      (The below errors out on -->  set @vcSQL)
      declare @intNewRecords_OutPut AS int
      declare  @vcTemp_Table  as varchar(50), @vcSQL  AS  varchar(max)      
      set @vcTemp_Table= 'tbl_zr_Invoice_LineItems_Add_Products'
      set @vcSQL= 'Select ' +  @intNewRecords_OutPut + ' = Sum(QuantitySold) from  tbl_zr_Invoice_LineItems_Add_Products'
      exec (@vcSQL)
      print @intNewRecords_OutPut

This Works
      declare @intNewRecords_OutPut AS int
      Select  @intNewRecords_OutPut = Sum(QuantitySold) from  tbl_zr_Invoice_LineItems_Add_Products
      print @intNewRecords_OutPut

Why do I want to do this
I have a stored proc that I use a temp table (#tbl_Temp).  But in case I want to do some debugging in the future, I want to be able to use a real table.  Hence send a parameter that would allow me to change tables on the above.  I know I can use an If statement with two statements, but I like to know the above.

Thanks in advance for any help.
LJG
0
Hi all,

firstly thank you for taking a look at my question - your help is invaluable!!

basically if I have the following table called a_debt:

row_id      de_account_number      de_listed_date
1      123    1/01/2018
2      124    1/01/2018
3      126    1/01/2018
4      128    1/01/2018
5      129    1/01/2018
6      123    2/01/2018
7      124    2/01/2018
8      126    2/01/2018
9      128    2/01/2018
10      129    2/01/2018
11      123    3/01/2018
12      124    3/01/2018
13      126    3/01/2018
14      129    3/01/2018
15      130    3/01/2018
16      131    3/01/2018
17      132    3/01/2018
18      123    4/01/2018

The data I am trying to pull is this.

column 1: count of the different account numbers loaded for each date
column 2: the date that has been counted
column 3: a count of the files for each date, that do not have a prior listed date, ie for the 4/1/2018 this column would = 1, for the 1/1/2018 the value would be 5, the 2/1/2018 would be 0 etc.

Is this something I could get help with?

many thanks!!

cheers
0
hi,

Anyone know how to scale out R server/service in MS SQL 2016 and later?
0
Hi,

I have few tables in the database which needs to be marked as read only , rest all should be read write for the a login user ,how can i create such login user which has login access of the few tables as r/w, some tables as Read only. This user can should also posses sys admin rights also.
0
If I have a list of 8 statuses...
They would have an ID and a code returned based on that id

Which has the least impact on performance
Create a scalar function that I feed in an integer of 1 - 8 and get text the code returned

Or
Create a permanent table with 8 data rows
0
My first time working with Service Broker.

We have a trigger with this section of the code. I've noted where we get an error

  BEGIN DIALOG CONVERSATION @ch  
            FROM SERVICE [//CILW/GeneralInitiatorService] 
            TO SERVICE N'//CILW/EventManagementTargetService' 
            ON CONTRACT [//CILW/EventManagementContract] 
            WITH ENCRYPTION = OFF; 

			

            SEND ON CONVERSATION @ch 
            MESSAGE TYPE [//CILW/EventManagementRequest] ( @msg );  -- ***** we get an error here

Open in new window


2. The error is this

The message body may not be NULL.  A zero-length UNICODE or binary string is allowed.

3. I turned on the Profiler and I see another line of SQL being executed

exec sp_executesql N'WAITFOR (RECEIVE conversation_handle,message_type_name,service_contract_name,message_body FROM [dbo].[//CILW/ExternalActivatorQueue]), TIMEOUT @timeout',N'@timeout int',@timeout=300

Open in new window


4. The line in step 3 doesn't bring any rows. One of the columns is "message_body".

I'm guessing the error is because we don't get data back from the line in step 3. What does that line even mean? where is it looking to get data?
0
Good Day,
can someone help me with a joint statement.
with below union,  I'm getting multiple results for same Accountnumber.
I need to see only one line.
your help is appreciated.

Select Accountnumber, (Select Name from Clients where Clients.Accountnumber = ActiveOrders.Accountnumber) AS [Client],
(Select LastInvoiceDate from Clients where Clients.Accountnumber = ActiveOrders.Accountnumber) AS [LastInvoiceDate],
sum(SubTotalAmount) AS [SubTotalAmount]
From ActiveOrders  Where primarysalespersonuserid = 208
Group By Accountnumber
UNION ALL
Select Accountnumber, (Select Name from Clients where Clients.Accountnumber = FinalizedOrders.Accountnumber) AS [Client],
(Select LastInvoiceDate from Clients where Clients.Accountnumber = FinalizedOrders.Accountnumber) AS [LastInvoiceDate],
sum(SubTotalAmount) AS [SubTotalAmount]
From FinalizedOrders Where primarysalespersonuserid = 208  
Group By Accountnumber
0
Hi Experts,
I am trying to create a recursive SQL query for an SSRS report. I need to be able to roll up some values into the parents. However I am struggling to get the parents since it is backwards to how I would normally create a recursive hierarchy.  I usually have a parentId rather than a childId. I have created many before when there is a ParentId. I haven't had a lot of time to think about this. However when searching for an example on the internet I seem to only get examples where there is a ParentId. Please send me in the right direction with a link to an example how this might be done or tips on how I can do this. If I can generate the ParentId from the bottom up I should be ok.  
Many thanks in advance!
0
What are the recommended steps to completely uninstall Ms Sql 2005 and 2008 from a server and also delete any related files.
(Note, we have ran control panel add-remove programs ans IObit Uninstaller)
0
I monitor my mssql express' Granted Memory State..  Randomly throughout the day it's having to grant between...  Not alot but between 1024 and 5300k.  The max memory size of the mssql instance is 4000 MB's, however, only 380 MBs is currently being used.  How am I supposed to force the mssql instance to allocate enough to not have to grant any?  Or is this just normal behavior?
0
1. I have two sql instances (named and default) on same DB server machine, server is having 12 logical processors. Do I need to create 12 secondary tempdb files (ndf) on default and named sql instance? or is it sufficient if i create 12 tempdb ndf files on only default sql instance?

2. server is having 12 logical processors and I have created 12 tempdb files with equal size. As per below article is there any changes required on number of secondary tempdb files?

"
As a general rule, if the number of logical processors is less than or equal to 8, use the same number of data files as logical processors. If the number of logical processors is greater than 8, use 8 data files and then if contention continues, increase the number of data files by multiples of 4 (up to the number of logical processors) until the contention is reduced to acceptable levels or make changes to the workload/code.


https://support.microsoft.com/en-us/help/2154845/recommendations-to-reduce-allocation-contention-in-sql-server-tempdb-d
0
I am using Dynamics SL 2011 & SQL 2008 R2.  All the transaction logs keep growing even after backups. Every so often, I have to change the recovery model to simple in order to reduce the transactions log file size, then set it back to Full. Any ideas?
0
Hi,

I need to identify what all records are inserted in various tables in past 10 days,can you please help out in writing query for the same.
0
My SQL Server time is EST + 4

How would I select * from Individuals where DateAdded >= (8am local time)
0
Hi EE
I would like some advice with a Like search. I have an address field in a customer table, the address is combined Number and street (32 Smith Street) using the following
Search = "SELECT Address FROM qryCitySearchLeads WHERE [Address] Like " & Chr$(34) & "*" & Me!txtAddress & "*" & Chr$(34)

I would like to search for smith without the number because sometimes the number is not known.
Using the above I get not found unless I include the number

I have used “*” both ends Left only and right only. I have found a work around but curious to why the above won’t work.
Any help appreciated

Chestera
0
After restoring several SQL DBs to my instance of SQL Server, is there any way to query the DBs to determine what version they came from before I restored them?

The query "select @@Version" appears to query my instance rather than the individual DB, but I'd like to know which DBs came from Express, the past version, etc.

Is that even possible?
0
Hi Experts

Could you confirm if the overall Visual Studio 2008 OLAP project concepts  (BIDS) are still useful nowadays?

I'm following a video course I obtained using this OLAP version.

I couldn't find any more apropriated topis for this question.

Thanks in advance
0
I am just writing a simple python script to connect to sql server .  SQL server that  I am trying to connect does not have trusted connection and so i have to login using integrated authentication. so in my script  i  try to login using the username and password that i use to login into management studio. but when i execute the script it gives me an error message saying login failed for user "it shows my windows username" and just ignores the username that I am passing in my script.
Below is my script.


server = "xxxxxxx.svr.us.xxxxxx.net\\Servername"
database = "MyDatabase"
username = "username"
password = "password"

con = pyodbc.connect('DRIVER={SQL Server};Server='+server+';Database='+database+';username='+username+';password='+password)
print (con)
con = conStr
cur = con.cursor()   #Generates error on this line
cur.execute("SELECT top 10 * from mytable;")

error that i get

pyodbc.Error: ('28000', "[28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'OVER HERE I SEE MY WINDOWS USERNAME. (18456) (SQLDriverConnect)")
0
Hello All,
I am getting bulk of errors on one of my server Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' . I have put some research and found something wrong with Kerberos. Can some tell me how can I fix this issue?
0
Hello ,

Could you please help me with this problem ?

Somebody change the Temp DB size and I want to know if is any method to find  that person .(sql log not help )

Thank you !

C.
0
Hi,

  I have an issue when executing select user_name() function from SQL SERVER.  

     select user_name()

  In some instances it returns dbo and in others instances it returns the user that is connected.    

  Is there a reason for this ? ,

 Am i missing some settings ?

 This has to be because of the SQL Version ? SQL Express ?

 Thanks for the help.

  Regards,

   Joe Echavarria.
0
I have created a link to a SQL report and passing a parameter that is hard coded.
The URL is working and the parameter is being passed successfully.
rs:Command=Render&username=NHC

Instead of hard coding the username I want the userID to be picked up automatically.
Then the link will work for any of my users.
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.