sql-server-2008's questions - English 1answer

3.730 sql-server-2008 questions.

I'm trying to figure out an easy query I can do to test if a large table has a list of entries that has at least ONE blank (NULL / empty) value in ANY column. I need something like SELECT * FROM ...

Trying to get the max date from my table, i can't retrieve the value when the date is null. Sample : the following table : +----+--------+------+------------------------+ | id | parent | Date ...

We have four different databases on a SQL Server 2008 (not SP2 - don't ask me why) database server that have an odd problem. When listed from sys.databases, these databases report that their ...

I follow all your blogs all helped me in my real-time issues. From last 2 days I'm facing connectivity issues to SQL server even though all the parameters are correct and cross verified with your ...

I have to use Indexed views to reach performance. As I can see from this comparison table standard edition does not support indexed views. But BOL says: Indexed views can be created in any ...

I'm still learning a lot about SQL Server and pretty green, but doing the best I can as an accidental DBA. We have recently purchased a SQL monitoring software package, and after adjusting the ...

I'm connecting to an SQL Server 2008 database using pdo and the ODBC Driver 13 for SQL Server. I'm trying to run the following query which searches the database for Chinese characters: SELECT TOP (...

I was asked by Ola to post my question I emailed on here. I have a batch file which restarts SQL services but disconnects the application when this is done. @ECHO OFF NET STOP SQLSERVERAGENT NET ...

I have setup a server that runs Windows Server 2008, and has SQL Server 2008 Express installed. I can connect to the machine's SQL Server Express database via the MACHINENAME/SQLEXPRESS. However ...

I turned down the Maximum Memory of the my SQL Server instance to 15 MB... Now I can't log in to increase it. How can I increase the maximum memory without logging in? Version is SQL 2008 R2

I have an Sql servers of 2008/2012. Some users run very expensive queries, such as updating 1G rows in one transaction or cross join several very big tables, and it causes the server no response from ...

I want to get the date in DDMMYYY format from a field that stores date in YYYY-MM-DD Timestamp format. (For example, '2018-11-09' should display '09Nov2018'). I know that one way is to use the ...

Is there something inherently unparallelisable about the table spool operator in SQL Server? I've got several queries that use parallel operators throughout due to the size of the tables, but by ...

I am currently using transactional replication from several SQL 2008 publishers to a central 2014 subscriber/distributor. I need to replicate this data to a 2017 server, which would require a 2017 ...

I enter the following command into the SQL Server Management Studio insert into testtable ([product_name], [price], [expire_date], [expire_time]) values ('Teapot', 10.00, 23/12/2012, '12:35:00') ...

I have four global temp tables (##A,##B,##C,##D) on which I want to perform a left join in SQL Server 2008. By global temp tables I mean I created them using a code like this: SELECT * INTO ##A ...

We did a disk expansion for VM DB server. However, after this operation the DB became suspect mode and cannot be open. Then we tried somethings like that; https://www.sqlrecoverysoftware.net/blog/...

I'm having a problem converting rolling SUM by month (monthly year to date) back to only that month's numbers. For example, see table below. Periods are (YYMM) and a monthly period per year starts ...

I have a 4000000 lines table (SQL Server 2008). This table has a private key composed of two int columns. One corresponds to a PK in another table of the same database. There is a relation between ...

I want to use the functionality that PROC FREQ provides in SAS. PROC FREQ helps in giving the statistics such as frequency, percent, cumulative frequency etc. of a variable or variables. The link ...

Some of my SQL Server's log files (ldf) are huge, like 5GB. I Found an article about shrinking, but am not sure why the author repeated DBCCSHRINKFILE 6 times. Can someone please confirm and suggest ...

Imagine you have two different tables/queries that are supposed to have/return identical data. You want to verify this. What's an easy way to show any unmatched rows from each table just like the ...

I want to remove temp tables that I was using in my script in SQL Server 2008. I can't find a way to remove it without writing a few lines of code. I have not been able to find code that works ...

I am trying to import a CSV file in SQL Server 2008. BULK INSERT is a way to go but it is applicable for CSV from SQL Server 2014 onwards. What would be an alternative way to achieve this goal? Any ...

I want to run the following query: CREATE TABLE dummy AS SELECT x, y, z FROM table1 WHERE y!=0 then I want to do the following: if z column has a non-null entry do: 1. copy the content of z into A ...

I am using BULK INSERT to read a csv file in SQL Server. Is there a way to keep the first row as column name while I am reading the file? If not, after reading the data from the csv (from second row),...

I'am facing some difficulties regarding my Sql Backup method, i am not sure if my method is correct, i am using a backup method described below; Created a Full backup named Xbackup in Maintenance ...

I am trying to read a csv file in my SQL Server Script. In SAS, I can read it using the infile option. (http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm) ...

I have a SQLSERVER 2008 instance with a standby configuration using log shipping. The production server runs a LSBACKUP job every 30 minutes, ships it to the standby server and the standby will then ...

I want to define a macro in my SQL script and later based on my conditional query I want to create a new variable name which will be 'X'+macro name. For example, say I define a macro 'month' which ...

Based on this post, I was able to solve the performance issue by adding indexes and thought I completed my project until I ran into an issue with the checksum... I then did research (should have done ...

I have an SQL Server 2008R2 that had lots of databases. The procedure was that a logins were created and users were mapped to databases. Most of these databases have been removed from the server ...

I got hired into a new company and they had merge replication already in place. They have had issues with it to the point I have to evaluate whether to keep it or replace it. The main issue is it ...

I want to get the current month and year of the system into a macro variable and keep using that macro variable to create related new variables. The purpose is that if I run my script every month, I ...

I've got this little ditty to concatenate all the columns in a table, for writing scripts quickly: create function [dbo].[get_columns] (@table_name varchar(255)) returns varchar(max) as ...

Why does the following query return infinite rows? I would have expected the EXCEPT clause to terminate the recursion.. with cte as ( select * from ( values(1),(2),(3),(4),(5) ) ...

VmWare 2008R2 Enterprise SQL server with Lock Pages in Memory ENABLED.... I have read the Jonathan Kehayias blog post referenced from Brent Ozar's blog via sp_Blitz and still not sure if I should have ...

We are using Transactional Replications with updatable subscriptions. 1 publisher, 1 subscriber. SQL Replication started encountering a constraint error on 3/6 at 10AM because people at two different ...

I've just inherited a database with a number of tables and stored procedures. I use Microsoft SQL Server Management Studio. One, or possibly more, stored procedures update a specific table. I'd ...

I am generating some queries automagically with code I wrote to SELECT from a remote Pg database, and insert into a local SQL Server database. However, one of them is generating this error: [...

We have migrated all our varbinary(max) column data to Azure Blob Storage and so we want to remove the old filestream columns that remain in our Sql 2008 database and the filestream filegroup but when ...

I am getting the following SqlException on calling a stored procedure: Attempt to fetch logical page (5:65424) in database 2 failed. It belongs to allocation unit 7349876362857938944 not to ...

First off, I'm using SQL Server 2008 R2. When I set up my maintenance plan and got to the "Select Report Options" step, I selected to email the report to the Operator I already have set up. This ...

I needed to read an Oracle DB from SQL Server, so I had to install the Oracle provider (ORAOLEDB.Oracle). My machine: System: Windows Server R2 2008 Enterprise, 64 bits (SP1). RDMS: Microsoft SQL ...

I have many backups on my SQL Server 2008 R2 system, and I must restore them on new SQL Server 2012 SP2. My question is, after the restore on new SQL Server 2012, what can I do to verify that ...

I have two tables, Items and Grouping. Items has about 7 million rows whereas Grouping only has 300,000. Of the two conditions on my query, the 'human obvious' thing is to evaluate G.StatusID IN (1,2)...

I am extending a dynamic pivot query. The original query works fine. In the second query, instead of displaying the date as a value for the pivot column, I would like to display a concatenated column. ...

I have the privilege of managing a large partitioned OLAP table. While reviewing this table I noticed one of the indexes is not aligned with the partitioning scheme. Since the author is not ...

Okay so I have a report that does a this week vs last week comparison and our customer noticed that their data was "funky". Upon further investigation we found it was not doing weeks correctly ...

So I installed ACE.OLEDB.12 to import excel files into sql server. After this, I can acces this procedure to see if everything is ok, but it's not. I have Zeroes on everything. This is a simple ...

Related tags

Hot questions

Language

Popular Tags