|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Commenting SQLCMD | |
I am writing a SQLCMD script in SSMS with SQLCMD mode. I want to add a comment as a new line in the script for other developers. What should I type for a single line comment? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
Float Issues I have this code: DECLARE @tmp1 FLOAT = 0.289; SELECT CONVERT(INT, ROUND(@tmp1, 2) * 100.0) What is returned by the SELECT? Answer: 28 Explanation: This is a strange one. 28 is actually returned as the float type imperfectly stores 0.289. This is a good reason not to use the float and real types. Ref: float - https://docs.microsoft.com/en-us/sql/t-sql/data-types/float-and-real-transact-sql?view=sql-server-ver15 |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
SQL Server rename - With SQL Server upgrade every time the server name would change and that would affect the application side of the server and need to change database connections each time. I understand that there is few options Rename the server name by sp_dropserver/sp_addserver, however this would not help since during the testing you would still need […] |
Moving an excrypted Database with always on to SQL Standard Edition - Hi Guys Have got a request to move a database from SQL Enterprise Edition to SQL Standard Edition both SQL 2017 The Database will be encrypted and part of an always on Configuration. I know sql standard edition does not support encryption so believe I will have to break the always on configuration […] |
Table Partitioning - In our environment we have columns which have null values in the column we want to partition on. do you think having null values if okay? or is there any best practice to make it as not null. Thanks |
Migration to SQL Server - I am working on migration project and doing the conversion using SSMA. Checking to see if anyone has done the migration from Sybase to SQL Server. If yes, can you list some of the issues identified. I have identified some of the issues and happy to share but just wanted to check with anyone here […] |
SQL Server 2016 - Administration |
Full Text Search - I have Full Text Search installed on 4 nodes in a SQL 2016 Cluster, I understand that it is the SQL Full-text Filter Daemon Launcher item in SSCM. It is installed but in a stopped state and I need them started. If I start them through SSCM will there be a need for a SQL […] |
Connecting to an Oracle server - Hi all We need to pull data from an Oracle server and I'm trying (and failing) to set up the linked server. The Oracle that's running is version 12c and I've installed the OLEDB drivers. I've also got the details for our login/password as well as the server name and port number. […] |
SQL Query Performance problem - Hello, I have only question about some interesting issues I tested yesterday some query, where was problem with running. Long time wasnt some problem, but last week is problem with this. Default MAXDOP is 8, there is 32 cores 64 logicals CPU, 2sockets . This is AG , I executed on Secondary server with Read […] |
MSDB110_upgrade fails - Hi rolling out the latest CU has stopped a SQL 2016 server from starting. The following was logged in the event log Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 574, state 0, severity 16. This is a serious error condition which might interfere with regular operation and the database […] |
SQL Server 2016 - Development and T-SQL |
CTE - a simpler solution? - All, I'm trying to get the average number of relatedpostid counts per postid. The following achieves the result I want: create table postlinks (postid int ,relatedpostid int) insert into postlinks(postid,relatedpostid) values (5,1) insert into postlinks(postid,relatedpostid) values (5,2) insert into postlinks(postid,relatedpostid) values(6,1) insert into postlinks(postid,relatedpostid) values(6,2) insert into postlinks(postid,relatedpostid) values(6,3) insert into postlinks(postid,relatedpostid) values(6,4) with postcount […] |
Development - SQL Server 2014 |
Can a variable set equal to a query with parameters be used in an OLEDB Source - I have an OLEDB Source that Id like to store the query in a table and set a variable with an EXEC SQL task and use that as the variable holding the query with oledb src set to SQL command from variable. The query will have parameters that Id like to pass in from the […] |
Require Recommendations | Index Rebuild - Hi Guys, I have created a script to rebuild indexes which is in the attachment- NOW - Please review the procedure and let me know if there is need for any modification or if there is anything additional to keep into consideration. Be my guest. P.S- Maintenance jobs are not working properly. Hence the script. |
@@ROWCOUNT in a Exec() with identity_insert - Hi, I have a SP to be able to archive a database ( from production to other database). i have got a problem with identity_insert. As this is very huge tables, i work with set rowcount= xx to avoid lock. Here a very simple example of my problem : CREATE TABLE [dbo].[Table_1]( [KEYU] [int] IDENTITY(1,1) […] |
SQL Server 2019 - Development |
Explicit Transaction not working - I am testing how to use explicit transactions. In my table, there is no employee with an ID of 200005, so this should generate an error, then the CATCH block should execute right? The results window says (0 rows affected) and the bottom of the results window it says 'Query executed successfully.' Why isn't this […] |
Does TSQL support natural and EQUI joins? - I am trying to find some information on this, but it seems like TSQL doesn't support natural joins and EQUI joins. Is this true? |
Integration Services |
SSIS - Data Conversion Truncation error - Hi Folks: Need help with SSIS package. I have created package using the CSV Input file (file attached). In the Input file I have the following records in the end which we don't want to load to SQL table. In the package I am using conditional split to filter those records and it works for […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |