Quantcast
Channel: Forum Getting started with SQL Server
Viewing all 8979 articles
Browse latest View live

How to take Windows Server Backup logs and put them into a file readable in SQL?

$
0
0

Hi

First time poster but I can not for the life of me find the answer to my question. I asked in the Windows server forum and they pointed me over here, hopefully this is the correct place to ask. 

I am attempting to take all the log files from Windows Server backup and get them into a format that I can add to our SQL database.

Any help on how to do this would be great. 

I need a way to do it for Server 2008 and 2016 if possible. 

Thank you in advance.


Can I Use SQL Server 2017 Deploy On A Windows 7 Client?

$
0
0
I developed my program with the SQL 2017 and I know that SQL 2017 cannot be used in the Windows 7 but even though i deploy my program with 2017, can't I use it on a Windows 7 client?

YTD and MTD

$
0
0

I have build something as below

 IF month is Jan 2019

then

Sales should be for 20180101 to 20181231

if Feb 2019

then 

Sales should be of 20190101 to 20190131

if March 2019 

Sales should be of 20190201 to 20190228

So i need to make View/Custom SQL to obtain these date ranges 

Kindly suggest a way to achieve


AJ

ResultSet property not set correctly?

$
0
0

Using the SSMS Import and Export Wizard, I am trying to export tables from one database into another within the same sql server instance but am getting the error message below. I tried exporting one table; still doesn't work. I copied the wizard generated CREATE TABLE sql statement and ran it in a query in SSMS without incident. I looked up ResultSet property in BOL but there is no entry for it; just ResultSets and ResultSetType. How does one set ResultSet? I have frequently exported to text files without this problem. Can anybody help resolve this?

 

- Execute the transfer with the TransferProvider. (Error)

Messages

ERROR : errorCode=-1073548784 description=Executing the query "" failed with the following error: "Retrieving the COM class factory for component with CLSID {7816B7A3-CD60-4539-BD38-C35AFC61F200} failed due to the following error: 80040153.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

ERROR : errorCode=-1073548784 description=Executing the query "" failed with the following error: "Retrieving the COM class factory for component with CLSID {7816B7A3-CD60-4539-BD38-C35AFC61F200} failed due to the following error: 80040153.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC} (Microsoft.SqlServer.DtsTransferProvider)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

Cannot get SUBSTRING and CHARINDEX combination to return value

$
0
0

Given this data:

     AAAA (1111-A)

     BBBB (0000)  - these are four zeroes

and using this t-sql:

select 
CASE 
	WHEN CHARINDEX('(',myColumn) > 0  
	THEN 
	     SubString(myColumn,(CHARINDEX('(',myColumn)+1),(CHARINDEX(')',myColumn) - (CHARINDEX('(',myColumn)+1))) ELSE myColumn END AS myColumn
from myTable where myColumn like '%BBBB%'

an error is returned when the above is run:

Invalid length parameter passed to the LEFT or SUBSTRING function.

But when changed to ...like '%AAAA%', it returns the expected result. 

The expected result for AAAA (1111-A) is 1111-A.

The expected result for BBBB (0000) is 0000.

I took the SUBSTRING out of the tsql:

select 	
CHARINDEX('(',myColumn)+1,
CHARINDEX(')',myColumn) - CHARINDEX('(',myColumn)+1
from myTable
where myColumn like '%AAAA%'
This did not return an error.

This is part of a query that has been running successfully for many months.  It decided to stop working today for some reason.  As far as I can tell it doesn't like the four zeroes.  But it has in the past.

Thanks for any help or advice

How to check rebuild indexes on database performance

$
0
0

Hello,

I'm going to rebuild indexes on my quite big database and then put it on a schedule.

I'd like to know if I could somehow verify the impact of index rebuild.

I expect that it should improve performance as well i.e. it should take less time to perform 'expensive' queries or etc.

My questions:

1. are there any 'standard' way of proving that index rebuild impacted database performance ?

2. could I run some 'expensive' i.e. slow query, then rebuild indexes , run the same query again and expect that it took less time than before?

Thanks


susja

Meaning of COUNT(1) in Sqlserver

$
0
0

Hi

LinQ to entities creates the following query..

SELECT 
            [Extent1].[nombre_sede] AS [K1], 
            [Extent1].[direccion] AS [K2], 
            [Extent1].[distrito] AS [K3], 
            [Extent1].[provincia] AS [K4], 
            [Extent1].[departamento] AS [K5], 
            COUNT(1) AS [A1], 
            COUNT(1) AS [A2]
            FROM [PROYECTO].[ProyectoSeguimientoCDs] AS [Extent1]
            GROUP BY [Extent1].[nombre_sede], [Extent1].[direccion], [Extent1].[distrito], [Extent1].[provincia], [Extent1].[departamento]

What is the meaning of (1) in COUNT(1) AS [A1]

Is it the first colum of the table or the first field in the query?

How to unset default value in “Connect to Database” in SSMS?

$
0
0

Once I thought it would be a great idea to set this field to the database I am working mostly with. I was wrong. Since this database is dropped and restored rather often, each time I am forced to reconnect after the drop.

I have found some recommendations, like setting this value via sql command, but nothing works.

Reset All every time is not option cause I am not thinking about it so much and this is annoying too.

Does anyone know where this value is stored to try to unset it: master DB, registry, some file?

Deleting item from combo doesn't work in 2014.

Why does MS add a feature to change something without possibility to reset it back? (rhetoric)



I have uninstalled SQL Server, though a lot of components remained in the system:

Uninstalled all of them, installed SQL Server from scratch, this issue still remains...

Can anybody help me here?

Thank you!


transfer data from a database to another using a stored procedure

$
0
0

I need to transfer data  from a database to another using a stored procedure in a C# application. I have some tables in the first database and I need to transfer data from them in others tables from the second database, not all columns but few of them.

How should I do that?

 

Thank you for your time!

 


ucsel

Are there any Invalid characters for an SQL Server authenticated Login name and/or password?

$
0
0

I'm working on series of SQL 2008 R2 server/client apps. In the Configuration/Maintenance app, it provides the ability to create/modify a "database administrator level" and a "database user level" SQL server authenticated logins on the server that the other client apps will use to connect to the server/database. Before I go and attempt to create/modify the login, I want to check both the login name and the password for invalid characters. Browsing SQL Server Books Online, found this article on Strong Passwords. From my reading of it, other than the caveats regarding quoting login names and passwords that start with/have embedded spaces or start with a $ or @ character and to using the  characters []{}(),;?*!@ in an OLE DB or ODBC connection string, it seems that any character is valid for use in a login name or password. 

Is this correct?

Thanks in advance,

PMB


updating indicies and statistics

$
0
0

Does updating indicies and statistics, prevent users from reading and writing to the database?

When I research this, it seems to me all the answers are ambiguous at best, Microsoft makes it hard to find any answers to simple questions as this.

also will it slow them down. I am using sql standard edition.



How to Apply a Order to a Number of SQL Software?

$
0
0

The data extraction tool currently widely available on the market is Sqli80, Sqli85, ... originating from people who can say ... very kara… “Oke” about extract data. And it also has a few improvements to have satisfactory results, such as running smoother, not so heavy Restart or Disconnect, as a first version number.

I now know two types of data extraction Sqli80 or Sqli85, I can understand the built-in structure and commands into the software. Although there are any adjustments that I can impose on that tool to get more data if I don't apply when running that program? Does anyone have experience about this tool? I just want to learn to be able to use it to help my SEO work better. Especially at the present time, an employee is working in this field, if not applying those extraction tools, I think he is planning to change jobs.

is it possible to insert into a table from a variable?

$
0
0

Suppose i have two tables:

Table 1 ($SYSTEM.DISCOVER_SESSIONS) has columns A, B, C

Table 2 has columns A, C, D

I query table 1 to select data from columns A and C

I save that query result in a variable called: $result

essentially it looks like this:

$result = 'SELECT [A],[C] FROM $SYSTEM.DISCOVER_SESSIONS'

Now i want to INSERT $result in table 2, with columns automatically matching (A, C) since these were the ones stored in $result

I realized I could potentially use JOINS for this, but I am unsure how I can formulate the correct syntax for what Im trying to do.

INSERTINNERJOINSELECT *INTO table2 FROM $result  

Is the approach Im trying to do possible?

What Conditions and Data Are Needed When Starting SQL Server Deployment

$
0
0

As the content of the Topic told, what do I need to prepare before starting to deploy SQL Server? Because, "like water off a duck's back" if I only get instructions, for those who have ever gone to school or to class.

I have downloaded the SQL 2008 software. (I'm using Windows 7). And when I extract the software, it's great ... I don't know what to do next. And 2 days ago, I was fortunate to find SQL statements, available on a school website. There is also an example to practice for each statement. But as you know, that is not enough. And it will be enough if I have ... money: D. I took advantage of all that was available. I feel like I'm also gifted, when I study by myself. However, after that thought, I asked myself: Where do I do it now? in Notepad, or in Word, Excel? You know how good my knowledge is, and how vast?

Don't tell me, I need to have a baseline then be able to do it. Because I know that the basics can only be halfway through. If there is that basis, I also learned it before memorizing the commands. Obviously, there is no such thing. It's just that I don't have a guide. And here is where I found him. I was not lucky to go to school and class. But I was fortunate to know this place, where many people may not know, or be ashamed to dare to show up like me, guide the lesson, and it will help many people ... like me now.

 You also understand, I ask you to give detailed instructions, but that's exactly what started using, deploying SQL, not all. If all, I believe I already have it.When you bring something good to anyone, you first eliminate an enemy. And you will not die of starvation if at that time he is near you ... I fear death becomes a hungry ghost, and a ghost. So I need to remove it slowly. : D  Tôi thực sự rất biết ơn vì điều này . Chân thành cảm ơn các bạn .

Encryption on premises database

$
0
0

Dear experts.

i am asked to encrypt on prem sql server 2014 database server,

kindly guide the direction, what are the options i have?


k


SQL Server 2008 Install failure - Reporting Services Rule Failures

$
0
0

I'm installing SQL Server 2008 on Windows 7.  I'm going through the install and on the "Installation Rules" page I have two failures:

Reporting Services Catalog Database File Existance
Reporting Services Catalog Temporary Database File Existance

Clicking on each of the failures they both say that each file exists "Select a reporting services file-only mode installation"

Clicking the "Help" button tells me to "Rename, move, or delete the files"

This is the only information I can find on this exact failure.  I'm not technical enough to know exactly where these files are or what they are named.  I cannot proceed any further without correcting this issue.  I'll include some of the shorter summary log files.  I can include other detail log files if that would help.

Thank you so much for any help.

Select Log Files:

SUMMARY GLOBAL RULES LOG:

Overall summary:
  Final result:                  Passed
  Exit code (Decimal):           0
  Exit message:                  Passed
  Start time:                    2010-08-17 19:13:40
  End time:                      2010-08-17 19:14:10
  Requested action:              RunRules

Machine Properties:
  Machine name:                  TONY-PC
  Machine processor count:       8
  OS version:                    Windows Vista
  OS service pack:              
  OS region:                     United States
  OS language:                   English (United States)
  OS architecture:               x64
  Process architecture:          64 Bit
  OS clustered:                  No

Product features discovered:
  Product              Instance             Instance ID                    Feature                                  Language             Edition              Version         Clustered

Package properties:
  Description:                   SQL Server Database Services 2008
  SQLProductFamilyCode:          {628F8F38-600E-493D-9946-F4178F20A8A9}
  ProductName:                   SQL2008
  Type:                          RTM
  Version:                       10
  SPLevel:                       0
  Installation location:         D:\x64\setup\
  Installation edition:          EVAL

User Input Settings:
  ACTION:                        RunRules
  CONFIGURATIONFILE:            
  FEATURES:                     
  HELP:                          False
  INDICATEPROGRESS:              False
  INSTANCENAME:                  <empty>
  MEDIASOURCE:                   D:\
  QUIET:                         False
  QUIETSIMPLE:                   False
  RULES:                         GlobalRules
  X86:                           False

  Configuration file:            C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20100817_191339\ConfigurationFile.ini

Detailed results:

Rules with failures:

Global rules:

There are no scenario-specific rules.

Rules report file:               C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20100817_191339\SystemConfigurationCheck_Report.htm

SUMMARY COMPONENT UPDATE LOG:

Overall summary:
  Final result:                  Passed
  Exit code (Decimal):           0
  Exit message:                  Passed
  Start time:                    2010-08-17 19:14:12
  End time:                      2010-08-17 19:19:07
  Requested action:              ComponentUpdate

Machine Properties:
  Machine name:                  TONY-PC
  Machine processor count:       8
  OS version:                    Windows Vista
  OS service pack:              
  OS region:                     United States
  OS language:                   English (United States)
  OS architecture:               x64
  Process architecture:          64 Bit
  OS clustered:                  No

Package properties:
  Description:                   SQL Server Database Services 2008
  SQLProductFamilyCode:          {628F8F38-600E-493D-9946-F4178F20A8A9}
  ProductName:                   SQL2008
  Type:                          RTM
  Version:                       10
  SPLevel:                       0
  Installation location:         D:\x64\setup\
  Installation edition:          DEVELOPER

User Input Settings:
  ACTION:                        ComponentUpdate
  CONFIGURATIONFILE:            
  HELP:                          False
  INDICATEPROGRESS:              False
  MEDIASOURCE:                   D:\
  PID:                           *****
  QUIET:                         False
  QUIETSIMPLE:                   False
  X86:                           False

  Configuration file:            C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20100817_191339\ConfigurationFile.ini

Detailed results:

Rules with failures:

Global rules:

There are no scenario-specific rules.

Rules report file:               C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20100817_191339\SystemConfigurationCheck_Report.htm

Variable formatting change

$
0
0

Hi,

I have a variable call 'New_in' with the values being 1 and 0.

If an account has both values, I get 2 lines which in turn, duplicates the values. 

Is there any way to say if the account has both a 1 and a 0 I could create 2 columns, one which will show the 1, the other will show the 0 and if it only has say a 1, then the other column will be blank

This is how I currently see it

Account   New_In   Value

123            1          £7,100

123            0          £7,100

This is what I would like to see (unless there is a better way)

Account    New_In_Yes      New_In_No    Value

123                  1                    0              £7,100

if there isn't a value in one of them (or vice-versa)

Account    New_In_Yes      New_In_No    Value

123                  1               (blank)             £7,100



Cross Join subset A with subset B, return null if no matches

$
0
0

Hello, I'm a beginner at SQL

I would like to add this subset A

+---------------+
| ReferenceDate |
+---------------+
| RefDate1      |
+---------------+
| RefDate2      |
+---------------+

With subset B

+---------------+------------+-------------+
| ReferenceDate | EntityName | EntityState |
+---------------+------------+-------------+
| RefDate1      | EntityA    | StateX      |
+---------------+------------+-------------+
| RefDate2      | EntityA    | StateX      |
+---------------+------------+-------------+
| RefDate1      | EntityB    | StateY      |
+---------------+------------+-------------+
| RefDate2      | EntityC    | StateX      |
+---------------+------------+-------------+

Which should return this final set

+---------------+------------+-------------+
| ReferenceDate | EntityName | EntityState |
+---------------+------------+-------------+
| RefDate1      | EntityA    | StateX      |
+---------------+------------+-------------+
| RefDate2      | EntityA    | StateX      |
+---------------+------------+-------------+
| RefDate1      | EntityB    | StateY      |
+---------------+------------+-------------+
| RefDate2      | NULL       | NULL        |
+---------------+------------+-------------+
| RefDate1      | NULL       | NULL        |
+---------------+------------+-------------+
| RefDate2      | EntityC    | StateX      |
+---------------+------------+-------------+

So, basically It would do a cross JOIN for each entity and if a certain entity didn't have that RefDate it should only return the RefDate(subset A) and null for the other fields (subset B).

I'm trying to create this because I need to build a table with those records, the columns will be fixed (the RefDates) but since the rows are each entity, they can or cannot have both RefDates. So when they don't have one of them that specific cell should stay null.

I tried to LEFT JOIN the subset A, but since the subsetB will always have those two RefDates, it never returns null on the final set.

Is there a better way to tackle this problem?

Thank you!!



how many SQL Server license required

$
0
0

Hi,

I have one SQL Database Server which act as Primary Server. Backup Server will reside on the Backup Site.Backup Server shall be used to keep back up.

pls guide do i required SQL Server License for Backup server.

Thanks.


iffi

SQL server License keys

$
0
0

Hi, 

Quick question. I have installed SQL servers for several non related customers and have recieved keys from them which they have downloaded from MSDN. I find some of these keys to be similar - is that correct. Does every customer not have their own private keys or are the keys the same for all installs of SQL server ? 

thanks 

Viewing all 8979 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>