Quantcast
Channel: Latest Questions on SQL Server Q&A from the SQL Server Central community
Viewing all 11276 articles
Browse latest View live

https://evaherbalist.com/keto-ultra/

$
0
0

keto ultra I've compare this and learned relatively a little bit on my possess by way of trial and error. I am beautiful constructive that it really works although. That you would be capable to help preserve your body from storing the meals that you just just consume via performing a brief bout of recreation after you devour. Ideally, compound exercise routines in order to result in muscular failure work ample. For example, ultimately my foods, i might drop down and rep out push americato failure, squat jumps to failure and sit down down usauntil it burned. Get your heart racing and your muscle tissue fatigued to encourage your physique to burn off the meals as a substitute of store it.

https://evaherbalist.com/keto-ultra/


pivot using 2 columns t-sql

$
0
0

hi everyone,

i have case that i have to pivot using two columns,

DECLARE @T TABLE ( sect_id int ,level_id int , time_perd_id INT NOT NULL , val DECIMAL(6,4) NOT NULL ,val_style decimal(3)NOT NULL ) insert @t values (2,1,15135,33.22,110), (2,1,15136,35.11,112), (2,1,15137,37.31,110), (2,1,15138,37.45,111), (2,1,20522,39.21,110), (2,2,15135,32.22,112), (2,2,15136,36.11,113), (2,2,15137,30.31,111), (2,2,15138,34.45,111), (2,2,20522,33.21,112), (2,3,15135,32.22,110), (2,3,15136,36.11,114), (2,3,15137,30.31,113), (2,3,15138,34.45,112), (2,3,20522,33.21,114) --

--SELECT * FROM @t

;WITH CTE AS ( SELECT sect_id , level_id , time_perd_id , val , val_style FROM @T )

SELECT sect_id , level_id ,MAX([15135]) as val1 ,MAX([110]) as val_style_1 ,MAX([15136]) as val2 ,MAX([111]) as val_style_2 ,MAX([15137]) as val3 ,MAX([112]) as val_style_3 ,MAX([15138]) as val4 ,MAX([114]) as val_style_4 ,MAX([20522]) as val5 FROM CTE

PIVOT (SUM(val) FOR time_perd_id IN ([15135],[15136],[15137],[15138],[20522])) AS pvt1

PIVOT (MAX(val_style) FOR val_style IN ([110],[111],[112],[113],[114])) pvt2

group by sect_id , level_id

i need to receive

sect_id,level_id, val_1, val_1_style, val_2,val_2_style etc.

i don't know what i'm doing wrong because i need move val_style into column which will be val_1_style etc. maybe my second pivot is not correct

I have a requirement to ensure that our service accounts (that connect to SQL) are not used by anyone but the by the APPLICATION itself also excluding access via SSMS

$
0
0

I have a requirement to ensure that our service accounts (that connect to SQL) are not used by anyone but the by the APPLICATION itself (also excluding access via SSMS)

Collation SQL Server 2017

$
0
0

Hi All,

I'm getting the following error:

Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "Latin1_General_BIN2" in the EXCEPT operation.

I've been through the usual suspects and the column is set to Latin1_General_CI_AS, the table is set to Latin1_General_CI_AS and the database is set to Latin1_General_CI_AS.

It's a simple EXCEPT statement:

        SELECT oj.[Key] AS GameType 
        FROM Staging.ETL_Holding AS eh
            CROSS APPLY OPENJSON(legalities) AS oj
        WHERE eh.legalities IS NOT NULL
        GROUP BY oj.[Key]
	EXCEPT
	SELECT gt.GameType
	FROM Cards.GameTypes AS gt

I can add COLLATE Latin1_General_CI_AS to the game type and it will work, however, I feel I shouldn't need to as the column etc is of the correct collation already.

My Google-FU isn't bringing anything back. I've dropped and re-built the DB completely several times (it's dev DB for a home lab).

The create table statement is:

CREATE TABLE Cards.GameTypes
(
    GameTypeID TINYINT IDENTITY(1, 1)
        CONSTRAINT pk_Cards_GameTypes_GameTypeID PRIMARY KEY CLUSTERED NOT NULL,
    GameType VARCHAR(50) NOT NULL,
    Created DATETIME2
        CONSTRAINT df_Cards_GameTypes_Created
            DEFAULT (SYSUTCDATETIME()) NOT NULL,
    IsActive BIT
        CONSTRAINT df_Cards_GameTypes_IsActive
            DEFAULT (1) NOT NULL
);
GO

Any thoughts, I can work around it but I really don't want to and if I do, I'll never know what the issue is!

https://evaherbalist.com/follicle-rx/

$
0
0

follicle rx What DHT sincerely does is attach to your hair follicles and reasons them to scale down unless they eventually simply fall out of your scalp. If you are able to do something to scale down the amount of DHT in your bloodstream, it can be your first-class chance to discontinue genetic hair loss.

Out of all the exclusive treatments and products to be had on the market, simplest ones with two distinct elements are truely valued at making an attempt. These are the two supplies that are authorized by means of the FDA to treat hair loss.

https://evaherbalist.com/follicle-rx/

http://www.trybionutrition.com/bone-oak-forskolin/

$
0
0

Two very different programs challenge much of contemporary thinking and he feels they are worth a Bone + oak forskolin closer evaluation. It is best to just eat your preferred foods reducing fat at the same time with little or no effort? The term fat losing foods can be confusing and gets thrown around a lot in the diet strategy plan technique strategy and fat decrease globe.

http://www.trybionutrition.com/bone-oak-forskolin/

http://www.trybionutrition.com/bone-oak-forskolin/

$
0
0

As a seller, you must know the key benefits of the product. The benefits of purchasing Celery ketone drops at common are that, you can fulfil the requirement of your customers in regular basis. A delay in the orders would probably the worst part you will want to see in your organization, so in to overcome it, you need to be well equipped with the adequate Bone + Oak Forskolin of the product. So, the thing that creates this product so special? What are the key benefits of Celery ketone? Well, this is a finish product, which has to be able to enhance your fat burning capacity while being equally efficient at the weight-loss process.

http://www.trybionutrition.com/bone-oak-forskolin/

Get the list of all authors who have submitted their papers

$
0
0

AUTHOR :{a_id,a_first_name,a_last_name,a_phone_no,a_email,a_pwd};_______________PAPER :{ paper_id, title,abstract, file_name,author_id}


how to find salary of an employee according to no. of working days based on date of joining

$
0
0

CREATE PROCEDURE salemp

( @employeeId int, @ID int, @processedon DateTime, @salary int )

As

IF EXISTS(SELECT 'True' FROM payroll WHERE employeeId=@employeeId)

BEGIN --This means it exists, return it to ASP and tell us SELECT 'This record already exists!'

END

ELSE

BEGIN --This means the record isn't in there already, let's go ahead and add it SELECT 'Record Added'

INSERTintopayroll(ID,processedon,employeeId,salary) VALUES(@ID,@processedon,@employeeId,@salary)

END

update payroll set salary = (employee.Basicsalary +employee.HRA + employee.Allowance - employee.Deductions) from employee where employee.employeeId = payroll.employeeId;

how to get column name if it has specific value

$
0
0

how to get column names if it has specific value.

I need this sentence below in the correct syntax.
select all_column_names from mytable where any.column_value=5;

Export to flat file 1500 columns

$
0
0

I have to export 1500 columns to a flat file to the analytics dept for review. Is this possible in SSMS Export Wizard or SSIS? Thanks!

Export 1500 columns from table to flat file

$
0
0

I have a need to export 1500 columns from a table in sql server 2012 to a analytics file for review. Is it possible in Export Wizard or SSIS? I got a crazy error when attempting to do this from a query in wizard. Thanks!

Using a variable for database name in select from table in a stored proc

$
0
0

Example stored Proc

I would like to select from the table ExportSettings from both within the current database & from another database on the same server

Real DATABASENAME is ST_v4051 but want to reference it as a variable

How do I resolve DATABASENAME?

Thank you & kind regards David

CREATE PROCEDURE [dbo].[MyBacgroundTask]
As
Begin
Declare @col1 nvarchar(50), 
@col2 nvarchar(50)


SELECT TOP (1)
@col1 = col1,
@col2 = col2
—FROM ST_v4051.dbo.ExportSettings
FROM DATABASENAME.dbo.ExportSettings
END





Enable TLS

$
0
0

Hi , Does enabling TLS from OS level is sufficient enough to encrypt communication between SQL server and client OR we should have certificate(CA) in both server(Force encryption=YES) and client to have more secured communication.

Choose Microsoft SQL Server 2014 Standard with SP2 or Microsoft SQL Server 2016 Standard with SP1,

$
0
0

We are using sqlserver 2008R2, but microsoft will not be supporting that version. Do I choose Sqlserver 2014 or 2016. Did anyone have any issues with either of them? Which one do you recommend I should use.


Can the Temp DB files be stored in separate drive

$
0
0

Can the temp db files be stored in different drive with the data files?

Microsoft SQLServer download from volume licensing center

$
0
0

Does this ISO file has all the files required to install sqlserver 2016 Service Pack2?

How do I convert yyyymmddhhmmss to mm/dd/yyyy in my select statement

$
0
0

Below you will find my SQL query

select campaign, startdate
from t1

I have in the column startdate values that look like this: yyyymmddhhmmss (e.g.

20170806040000).

I want that the date above shows in my query like this: mm/dd/yyyy (e.g. 08/06/2017).

Unfortunately I am not sure how I have to change my select condition. I tried hundreds of different combinations. However, it is not working. I hope that you guys can help me.

Sub Query help???

$
0
0

select y.*,

case

when Sub_count <=3 & (cast(Submitted_UW_Date as date) = cast(LAST_WEEKDAY_DATE as Date)-1) then "1 Day"

when Sub_count <=1 & Submitted_UW_Date = LAST_WEEKDAY_DATE then "1 Day"

When Sub_count >3 & Submitted_UW_Date = LAST_WEEKDAY_DATE-1 then "2 Days"

else "Days Exceed"

end as Days

from (select count(submitted_UW_Date) as Sub_count from dbo.Encompass_Main where Cond_Approval_Date is null)y, Encompass_Main, DailyStatus where Submitted_UW_Date= LAST_WEEKDAY_DATE

Users are seeing the following error when running the Diagnostic SQL query on the GBISDB on Server Bcsql250.

Viewing all 11276 articles
Browse latest View live