logo
down
shadow

SQL-SERVER QUESTIONS

How can I make the legend in an SSRS chart correspond with custom chart fill colors?
How can I make the legend in an SSRS chart correspond with custom chart fill colors?
should help you out The legend you want is actually redundant for your chart because the departments are shown on the X-axis so the quick answer might be don't show the legend. However, there is a way to get the result you are after - the departments
TAG : sql-server
Date : November 28 2020, 09:01 AM , By : Ulrich Scharf
The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communica
The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communica
it fixes the issue Wow, I finally figured it out. As most people said, it MUST be some kind of network issue (and I didn't disagree). The kicker was that my PC was allowed DTC from it to SQL, but the VM running on my PC didn't. What it ended up being
TAG : sql-server
Date : November 27 2020, 09:01 AM , By : Ananda Chakkaravarth
How to retrieve all rows with a date in this and the next week? SQL Server
How to retrieve all rows with a date in this and the next week? SQL Server
wish helps you If indexing (performance) isn't a concern then it's a simple expression if your week coincides with the SQL Server setup:
TAG : sql-server
Date : November 25 2020, 09:00 AM , By : Pardeep Kumar
Visual Studio + localdb on windows 10
Visual Studio + localdb on windows 10
I wish this helpful for you I just got a new machine and put windows 10 on it. I am a student so I have a dreamspark account and obviously want to download the latest version of VS which I think with dreamspark is 2015 Community. I want to create web
TAG : sql-server
Date : November 24 2020, 09:00 AM , By : David Johns
pymssql : How to get distinct rows when a column has XML values
pymssql : How to get distinct rows when a column has XML values
may help you . I am trying to use distinct in a query for a table that has XML values. Here is my query , you could try
TAG : sql-server
Date : November 24 2020, 09:00 AM , By : Loki
How to set up a Join according to a value for one Column?
How to set up a Join according to a value for one Column?
this will help SQL Server query: , You can not use WHERE twice, also, please consider use JOIN
TAG : sql-server
Date : November 23 2020, 09:01 AM , By : zacimac
How to insert specific datetime into dataset
How to insert specific datetime into dataset
wish help you to fix your issue What's the specific data type of your date/time column? If it's datetime, for example, then 0001-01-01 00:00:00.000 is out of range, specifically 1753-01-01 through 9999-12-31.You could use a datetime2 data type instea
TAG : sql-server
Date : November 22 2020, 02:59 PM , By : LucasNoja
If-else condition in visual basic to delete a record from SQL Server if record exist
If-else condition in visual basic to delete a record from SQL Server if record exist
Any of those help As others have already mentioned, you really need to look into parameterizing your query. You should also look to encapsulate this into a stored procedure for easier reading and maintainablity. Those things aside, you can accomplish
TAG : sql-server
Date : November 22 2020, 02:42 PM , By : eashwar
Rolling calendar pivot in sql server?
Rolling calendar pivot in sql server?
Hope this helps You will have to use dynamic SQL in order to achieve this.First you must get the month name in the correct order:
TAG : sql-server
Date : November 21 2020, 07:38 AM , By : James Laforest
Subtract variable from column while variable has remaining value
Subtract variable from column while variable has remaining value
may help you . I have a column with different numerical values. And I have a numeric variable called X with a value of 50000. , You can do this with running sums:
TAG : sql-server
Date : November 21 2020, 07:38 AM , By : DonavanGullett
Error 0x80070005 Access is denied
Error 0x80070005 Access is denied
this will help I found the user by looking in Services i.e. right click My Computer, then click Manage, then click Services. There is an SQL server service that is running as a windows user. That is the windows user I was looking for.
TAG : sql-server
Date : November 20 2020, 09:01 AM , By : Yvan V.
Part of the row to columns
Part of the row to columns
wish help you to fix your issue PIVOT will help you
TAG : sql-server
Date : November 20 2020, 09:01 AM , By : Roman Zubatyuk
Sql Server Updating column by generating random number
Sql Server Updating column by generating random number
help you fix your problem I try to update my column with random number in Sql Server 2008 R2. , After the first update you can do another one like:
TAG : sql-server
Date : November 19 2020, 03:54 PM , By : J. Antonio Villalba
Delete Rows not between Min and Max dates from another column
Delete Rows not between Min and Max dates from another column
should help you out I want to delete records which don't lie between MIN and MAX from another (nullable) column in the table. , You can first select min and max dates and then do the comparison:
TAG : sql-server
Date : November 19 2020, 09:01 AM , By : Aditya Raj
How select data where they have on second difference?
How select data where they have on second difference?
wish helps you Assuming your version of SQL Server supports row_number function, you can do the following:
TAG : sql-server
Date : November 19 2020, 12:35 AM , By : Pallavi
update the table with the previous column with out any loops
update the table with the previous column with out any loops
like below fixes the issue If you only mean without a while loop, it can be done with a recursive CTE like this:Query:
TAG : sql-server
Date : November 19 2020, 12:35 AM , By : Tony Nedialkova
Output complex xml from SQL select query
Output complex xml from SQL select query
Hope that helps I am trying to generate XML from a SQL Server select Query. I would like the output to look like this: , Refer the following example XML Generation from SQL Query...
TAG : sql-server
Date : November 19 2020, 12:35 AM , By : Priyal Maheshwari
Can not insert arabic data in SQL Server
Can not insert arabic data in SQL Server
Hope that helps You should use nvarchar instead of the varchar type you are using.Beside that, are you sure you want to use varchar for price? That should probably be types like decimal(10,2) or money.
TAG : sql-server
Date : November 19 2020, 12:35 AM , By : Kalyan Sundaram
Joining SQL Tables and display columns as rows to generate a report
Joining SQL Tables and display columns as rows to generate a report
wish of those help i have three tables related to each other explained below , You can use this query:
TAG : sql-server
Date : November 18 2020, 09:01 AM , By : Habeebrahman parambi
Reduce Hash Match Cost in sql code
Reduce Hash Match Cost in sql code
I hope this helps . I think that you don't need sub-query for tables dbo.PatientVisit and dbo.Visitlookup, and cross join also can be replaced by INNER JOIN. Also, you can replace NOT IN (SELECT FIELD FROM ... WHERE {Condition})) with NOT EXISTS (SEL
TAG : sql-server
Date : November 17 2020, 09:01 AM , By : Адриан Андреев
Data Insertion from one sql server to another
Data Insertion from one sql server to another
To fix the issue you can do Use a linked server:How do I create and query linked database servers in SQL Server?
TAG : sql-server
Date : November 17 2020, 09:01 AM , By : jack dowson
Return a Hourly minimum count of column?
Return a Hourly minimum count of column?
I wish this help you I have written below code and I want to return a pqpageId, date and hour on which it has a minimum count. in advance. , You can try this code:
TAG : sql-server
Date : November 17 2020, 09:01 AM , By : nikhil dhingra
SQL Query - Year by Year Growth of Sales
SQL Query - Year by Year Growth of Sales
I wish this helpful for you I have this result set from an SQL query. This result has come up by grouping the sales of tenant per year to get the total sales in yearly basis. Table is named TENANTSALES with columns: Tenant, date, sales etc. , Try thi
TAG : sql-server
Date : November 16 2020, 09:01 AM , By : Mahantesh Kori
LINQ & SQL Server : order by from starting row
LINQ & SQL Server : order by from starting row
I think the issue was by ths following , Just keep track of what page you are on, then you can use Skip and Take to do your paging for you:
TAG : sql-server
Date : November 16 2020, 09:01 AM , By : AlptraumNas
creating access to SQL Server Native Client OLE DB provider using CoCreateInstance fails with 80040154 error
creating access to SQL Server Native Client OLE DB provider using CoCreateInstance fails with 80040154 error
will help you Thats REGDB_E_CLASSNOTREG so CLSID_SQLNCLI11 is not available, download and install the redistributable package for the Native Client (Matching the bitness of your application).Download.
TAG : sql-server
Date : November 14 2020, 06:58 AM , By : Jordan Rash
SSIS SQL task Query creating error while casting parameters (string to Datetime)
SSIS SQL task Query creating error while casting parameters (string to Datetime)
around this issue I have found a solution but still don't know how this is working :D...... Before Using CTE, i have to convert the parameters to DateTime and Date respectively.
TAG : sql-server
Date : November 13 2020, 09:01 AM , By : PSN
run query against multiple databases on different server
run query against multiple databases on different server
wish help you to fix your issue It seems that the following solution works. Credit goes to:Mutiple Variables in Foreach Loop [Powershell]
TAG : sql-server
Date : November 12 2020, 09:01 AM , By : Ilze Dombrovska
Find all rows that have changed and write old-Newvalue to different table in SQL Server 2012
Find all rows that have changed and write old-Newvalue to different table in SQL Server 2012
may help you . Need to write to a table all the rows where values have changed between 2 datacuts. This must be done in sql and not using any third party tools. , You can use UNPIVOT:
TAG : sql-server
Date : November 11 2020, 09:01 AM , By : Tenzalor
SQL Sum() Query error
SQL Sum() Query error
wish of those help Actual Data , You'll have to sum the figures before joining, something like this:
TAG : sql-server
Date : November 11 2020, 09:01 AM , By : Reactor-X Rahul Kuma
How child record overrides parent record columns?
How child record overrides parent record columns?
wish help you to fix your issue In SQL Server I have a table: , You can do this with basic recursive CTE:
TAG : sql-server
Date : November 10 2020, 09:01 AM , By : Víctor Rodríguez Nav
Calculate Type of the member in a table (Self Join/Case When or any other possible way)
Calculate Type of the member in a table (Self Join/Case When or any other possible way)
may help you . By including the CanType in the group by clause, you're getting a separate result row per distinct value of CanType (and CanId, since it's also contained in the group by clause).Instead, you should only have CanId in the group by claus
TAG : sql-server
Date : November 08 2020, 09:00 AM , By : Andi
Employee, Departments, and ManagerID Table Structures
Employee, Departments, and ManagerID Table Structures
hope this fix your issue In MS SQL, I have employees and departments tables. I need remodel the tables to allow me to assign department managers. , You could add a third table:
TAG : sql-server
Date : November 07 2020, 01:32 PM , By : Serialchiller
Stored procedures in SQL Server 2012
Stored procedures in SQL Server 2012
will help you I want to write a stored procedure in SQL Server which will accept two values mlt_sk (which is the serial key) and GroupName. , Try using xml methods,
TAG : sql-server
Date : November 06 2020, 09:01 AM , By : Jill Rivas
How retrieve collection of objects from stored procedure which are in database connected with foreign key
How retrieve collection of objects from stored procedure which are in database connected with foreign key
Any of those help You need "multiple result sets" from your procedure.https://msdn.microsoft.com/en-us/data/jj691402.aspx
TAG : sql-server
Date : November 06 2020, 09:01 AM , By : Craig Kossow
Microsoft SQL Server 2014 no server
Microsoft SQL Server 2014 no server
I wish this help you I think you have not completed the installation of sqlserver , if full installation is complete you can find sql server in (win+R)and search ssms after that you can open through it.
TAG : sql-server
Date : November 06 2020, 09:01 AM , By : Matthew
How to SUM up 2 Columns into 1 Column SQL Server
How to SUM up 2 Columns into 1 Column SQL Server
Any of those help I think you are looking for a computed column:https://msdn.microsoft.com/en-us/library/ms188300.aspx
TAG : sql-server
Date : November 06 2020, 03:59 AM , By : Shahab Najmosadaty Y
Best approach to merge three distinct TSQL select statments
Best approach to merge three distinct TSQL select statments
Any of those help You can select them all together by doing a CROSS JOIN by not specifying any join criteria between the three tables as follows:
TAG : sql-server
Date : November 04 2020, 04:02 PM , By : Ankit Rastogi
How to display multiple data from the same table depending on one column value
How to display multiple data from the same table depending on one column value
this one helps. A where statement is evaluated by ROW so consider the following example:
TAG : sql-server
Date : November 04 2020, 04:02 PM , By : Raspberrypie
How to create sequential numbering against two select statements that are unioned?
How to create sequential numbering against two select statements that are unioned?
fixed the issue. Will look into that further You can enclose your sql in a common table expression and then number them:
TAG : sql-server
Date : November 04 2020, 04:02 PM , By : Tan Yun Shen
SQL Server : Second maximum value per group
SQL Server : Second maximum value per group
I wish did fix the issue. While Joe's answer is going to work, I'd strongly suggest using ranking functions in this case, you won't have to join your table twice and this is a perfect use-case for them. This would be the following query:
TAG : sql-server
Date : November 04 2020, 04:00 PM , By : sathiswaran
T-SQL : xml how to add default namespace and root path with inner join
T-SQL : xml how to add default namespace and root path with inner join
it should still fix some issue If I understand the question correctly, you can do CROSS APPLY on /Doc/DocumentProperties to make it the context of the column XPath expressions, for example :
TAG : sql-server
Date : November 04 2020, 04:00 PM , By : sunteam
T-SQL - Using a parameter in where and clause
T-SQL - Using a parameter in where and clause
may help you . I want to pass a parameter and depending on its value I want to evaluate a condition like this: , You cannot have condition after THEN.You can use OR:
TAG : sql-server
Date : November 04 2020, 08:17 AM , By : Arsh Fatima
SSPI and SQL Server Windows Authentication
SSPI and SQL Server Windows Authentication
I hope this helps . With WinAPIOverride I found that authentication uses Bindings (see QueryContextAttributes SECPKG_ATTR_UNIQUE_BINDINGS) retrieved from SSL handshake in negotiation InitializeSecurityContext as SECBUFFER_CHANNEL_BINDINGS member. So
TAG : sql-server
Date : November 04 2020, 08:17 AM , By : yousef khodaei
Do I NEED a subquery on this OVER example?
Do I NEED a subquery on this OVER example?
fixed the issue. Will look into that further Problem here was I wasn't using DESC as I should on the OVER clause - so even if the query had ordering year/month DESC, the OVER clause didn't.Now, this query, works as it should:
TAG : sql-server
Date : November 03 2020, 09:01 AM , By : Nitin Rao
Check constraint to allow only one combination of two columns
Check constraint to allow only one combination of two columns
With these it helps I have a table to store person's phone numbers. There is a flag (IsDefault) to mark a phone as the default one. There should be only one phone per person flagged as default phone. Is it possible to create a check constraint to onl
TAG : sql-server
Date : November 02 2020, 09:01 AM , By : Dave Khan
How to id with foreign key in my table in SQL Server?
How to id with foreign key in my table in SQL Server?
I wish this help you Add a field in studentresult table to point student table (i.e. idstudent), so add a foreign key constraint.You can add a foreign key constraint using GUI (right click with mouse and choose Relations), or by script as follow:
TAG : sql-server
Date : November 01 2020, 03:09 PM , By : Raymundo Castillo
Unpivoting multiple columns displaying incorrect data and duplicates
Unpivoting multiple columns displaying incorrect data and duplicates
should help you out I have a books table which has subject and chapterwise total pages and entered pages. Below is the screenshot of my table. , You can use the APPLY-Operator instead of UNPIVOT.For example:
TAG : sql-server
Date : November 01 2020, 01:05 PM , By : venturoso
Unable to store value in a variable
Unable to store value in a variable
like below fixes the issue 1) You need to declare the @guidId variable2) You cannot assign value to variable inside the EXISTS.
TAG : sql-server
Date : November 01 2020, 09:01 AM , By : Imran Khan Rehaan
Wildcard in ContainsTable of full-text search
Wildcard in ContainsTable of full-text search
it fixes the issue Star(*) in FTS is used for wild card the same concept as normal query. So when you search blah, it search the word comes with blah. When you use blah*, it search the word starting with blah whatever written after that.
TAG : sql-server
Date : October 31 2020, 05:43 PM , By : Shubhangi Jain
SQL count where between dates by month
SQL count where between dates by month
wish helps you This is very logical question, finally I created the sql which gives the desired result.. I verified every date and month count and its all ok.
TAG : sql-server
Date : October 31 2020, 05:43 PM , By : jongler
Datatier applications not deploying filegroups on creation of database, only upgrade process
Datatier applications not deploying filegroups on creation of database, only upgrade process
I wish this help you Known issue with dacpac apparently. I went with the approach of deploying a db project to master prior and creating the db's if they didn't exist in post scripts for that db. Not the cleanest but it'll do for now.
TAG : sql-server
Date : October 31 2020, 05:41 PM , By : Paul Baloo Johnson
Azure SQL Server VM OR Azure Windows Server with SQL Server install
Azure SQL Server VM OR Azure Windows Server with SQL Server install
I wish this helpful for you I believe that you're comparing using the SQL Server Gallery images in the portal vs using a Windows Server image and manually installing SQL Server using your own license.With regards to cost, you answered the question. T
TAG : sql-server
Date : October 31 2020, 05:41 PM , By : Priyanka Rao
Convert from 4 digit Military time to Standard time
Convert from 4 digit Military time to Standard time
To fix the issue you can do Assuming your data is stored as an integer, and also assuming there is not invalid time stored (i.e. values above 2400 or below 0) you can use the following:
TAG : sql-server
Date : October 31 2020, 01:47 PM , By : Dokaro LLC
SQL inner join on Microsoft SQL server
SQL inner join on Microsoft SQL server
will be helpful for those in need You need to join the results of the first and second queries. You also need to have the aliases (w and p) outside of sub query. Try this:
TAG : sql-server
Date : October 31 2020, 10:01 AM , By : motom
Deny Read-Only Users to see DDL of a Stored Procedure MS SQL
Deny Read-Only Users to see DDL of a Stored Procedure MS SQL
hop of those help? Another option is to deny VIEW DEFINITION permission. The following post goes into detail on this feature.https://www.mssqltips.com/sqlservertip/1828/options-for-hiding-sql-server-code/
TAG : sql-server
Date : October 31 2020, 10:01 AM , By : YuanYe
How do I exclude rows when an incremental value starts over?
How do I exclude rows when an incremental value starts over?
I wish did fix the issue. Not sure what ModuleID was supposed to be used, but I guess you're looking for something like this:
TAG : sql-server
Date : October 31 2020, 10:01 AM , By : Eric Christensen
TSQL - compare adjacent rows
TSQL - compare adjacent rows
wish of those help Assuming that the request and response will always be next to each other, get the responses and join to the requests based on the ID+1:
TAG : sql-server
Date : October 31 2020, 05:57 AM , By : Gavin
MSSQL DataBase Backup without a specific table
MSSQL DataBase Backup without a specific table
seems to work fine You can setup a separate file group for this one table, apart from the PRIMARY file group. This will give you the ability to create a backup that omits your large table. Below is an example that steps out the process.1) Create a ne
TAG : sql-server
Date : October 31 2020, 05:57 AM , By : kavacs
Find All Empty Tables Named MAP_ALERT In All Databases On Server
Find All Empty Tables Named MAP_ALERT In All Databases On Server
should help you out You can use dynamic sql here to help you out. This is querying the system tables for each database. This will even properly handle databases that don't have that table.
TAG : sql-server
Date : October 30 2020, 10:01 AM , By : mustafa
Ugly table query
Ugly table query
I hope this helps . I have inherited this table and trying to optimize the queries. I am stuck with one query. Here is the table information
TAG : sql-server
Date : October 29 2020, 11:32 PM , By : derEisbaer

shadow
Privacy Policy - Terms - Contact Us © animezone.co