Quantcast
Channel: SQLServerCentral » SQL Server 2008 » SQL Server 2008 - General » Latest topics

mapping back

i have table as below:country codeaustralia 55555australia 55555australia checklaterukraine 33333ukraine checklaterukraine checklaterukraine 33333america 22222

View Article


Exporting results to any kind of file via SQL Agent without Job headers

Hi all,In short, I have a need to export some data from a client that's on their own server. We have a way for the information (which will be held in some kind of file - likely .txt, but.xls would be...

View Article


Age Range From Today's Date

My first post here so I don't know how people tend to respond. I searched the forums for "Age Range From Today's Date".

View Article

Connection String to Connect to SQL Server using a service account ( Windows...

Dear All,Can someone help me to get the connect string ( JDBC ) to connect to a SQL server using a service account ID and password , from a Unix server? I have searched in internet and got how to pass...

View Article

Update Query

In someone else's question, I found this answer (below) which may provide a solution but I'm not sure. I have a table with over 1000 records that I need to update. I need to add a specific birth_date...

View Article


SQL Server Link to Oracle Inconsistent metadata problem

Hi I have created a linked server to Oracle using the Oracle OLE DB provider "ORAOLEDB.ORACLE" from SQL 2008. I can query the Oracle database using OPENQUERY but when I try a simple SELECT COUNT(*)...

View Article

Dynamically Build Query to Concat

I'm trying to get the results of the top query (if null insert 0, comma between fields).  Can get it done if I hard code field names but need it done dynamically.  Thank you for any assistance![

View Article

How to insert result of Store Procedure into sql table

ALTER PROCEDURE [dbo].[GetMachineAttendanceFinal5]ASBEGIN  SET NOCOUNT ON;  ;WITH Dates (ReportingDate) AS ( SELECT CONVERT(date, '2018-11-26 00:00:00.000', 120) AS ReportingDate<

View Article


Migrating jobs does not create the maintenance plans

I am migrating backup jobs from one server to another. I scripted out the agent jobs but it seems to not create the maintenance plan. Not sure if I am migrating these plans correctly

View Article


(provider: Named Pipes Provider, error: 40 - Could not open a connection to...

Problem: How can I access SQL server on WAN???????????????????????????????? ----------------------------------------------------------- Error: (provider: Named Pipes Provider, error: 40 - Could not...

View Article

Import Data from Excel as Encrypted Data in SQL

I couldn't find anything on this so I don't even know if I'm using the correct search terms, I've tried a few variations, so please be gentle with me if it's already been answered. :-)I have a SQL...

View Article

Linked Server to AD - Error when using username and password

Hello,  I've set up a LinkedServer to a AD that I have access to with my Username.Case 1: The Linked Server gets the option to Used in the current security context of the application. Now I can run the...

View Article

Import csv with incorrect data to sql server by SqlBulkCopy

I have to try to import delimited files via c# to sql server database using .net framework SqlBulkCopy. I use StreamReader for read data from flat file and the DataTable for write to db by SqlBulkCopy....

View Article


Query to group and count data elements from a single column

In Col1, records 1, 2 and 3 we have the following data:The brown cat jumped over the fence The red fox dug under the fence The white rabbit ran past the fence I need to list the elements of each Col1...

View Article

nvarchar to smalldatetime

Im currently working on updating company database in which on one of the tables  the 'CreateDt' is in the nvarchar (20) type and stores dates in the following ways;12-May-1229/02/20119/24/2012There are...

View Article


XML Path and table-Valued function?

Hello,In SQL Server 2008 R2, is it possible to return XML values comma separated from a user table-valued function?  [code language="sql"]FOR XML PATH('') [/code]

View Article

Filtering by date crashes report\query

Hi,I have the following sql query [code language="sql"]SELECT DISTINCT                     &nb

View Article


Identify missing record on accounts

Hello  guys,I have a table with accounts that have numbers in sequence. I would like to identify the account(s) when charge category 360 is missing from the sequence for the associated account....

View Article

Database suspect during backup but not actually in a suspect state

Hi folks,This morning I noticed one of my DIFF backups jobs failed.  (I'm using Ola's scripts)  Problem is when I checked the Command Log table none of the actual backups in the job had actually...

View Article

Easy way to have scheduled job export results as pipe delimited?

I've got some queries that need to run on a scheduled job every morning, and I'm not sure how to make the results export as pipe delimited. I can do that fine if I'm exporting manually, but I don't if...

View Article

Not enough storage is available to process this command

Dear All,I have been receiving the following error message "Not enough storage is available to process this command", although the error message indicates that it is a storage issue, it doesn't seem

View Article


check if a file exists and run

I am at a new env and am noticing few users who are little technical and mostly cust support, are editing sprocs and running them in prod. I want to avoid this and restrict the permissions. Has anyone...

View Article


Inserting Numeric and Text data in VARCHAR field

I need to identify cases where a job runs over its estimated completion time. Code to recreate:[code language="sql"]DECLARE @Table TABLE (          &

View Article

Need procedure to continue even if error

I need to schedule a procedure to copy a large number of tables from AS400 via ODBCThat part is fine, however my problem is this. When the job runs, some of the tables may be unavailable. It's...

View Article

Query produces incorrect results

HelloI am working on a complex problemThere is a problem with the query[code language="sql"]DECLARE @AMTTOMARK DECIMAL(38,2),@CVIDDR VARCHAR(11),@CVIDCR VARCHAR(11),@MCVID VARCHAR(11),@CURRMARKA

View Article


Potential issues with different collations

Hi all, What are the potential implications (if any) for a database having a different collation than a server for the query engine itself? For instance, I know if *I* want to use tempdb for a temp...

View Article

Delete duplicate rows from ANY table.

Is there is 'fairly' simple query to delete duplicate rows from ANY table ? A script which removes duplicates from a table, when a table_name is supplied. Ben

View Article

Request for count and "volume" of transactions

I am being asked to report on the number of transactions, and the "volume" of transactions for a particular set of queries being run against a database on a SQL 2008 server. The question as it was...

View Article

Scripting objects in powershell

Hi, I've got this script: #DECLARE TIMESTAMP FOR THE FILES $timestamp = Get-Date -Format yyyy-MM-dd-hh_mm #SCRIPT SL SQLSERVER:\SQL\"(local)"\DEFAULT\Databases\"MyDB"\Views dir | %{$_.Script() |...

View Article



A transport-level error has occurred when sending the request to the server....

Hi,An application in live environment crashed. After reading the log of the application we found the errorA transport

View Article

Server to Server data transfer for single column in a table

I need to copy data from a particular column in a table and transfer to another table however, this involves moving from one SQL Server instance to another instance.Does anyone have any tips for...

View Article

Create new Central Line based on Trend

Hi, I have managed to get so far with creating a central line that changes depending upon trend that is noted by 8 consecutive valesso this is my result so far, CL is the central line, T1 is the first...

View Article

Raise the IRPStackSize parameter for the server

is it advisable to increase the IRPStackSize Parameter for the SQL server 2008 running on windows Server 2008 R2Help is appreciated,Regards,Bubby

View Article


Script Out Database Mail Settings?

Anyone bother to have created a script to Reverse Engineer / Script out your EXISTING database mail settings? I set up a profile to use gMail, and it seems logical for me to export out the settings to...

View Article

sql Database (MDF) repair Best Tools

hi MDF file corrupted Best Repair Tools or Software ? What is your suggestion

View Article

Permissions granted to Public - anything I might need to know?

I have two SQL 2008 R2 servers that have two databases each.   I have the exact same stored procedure in one of the two databases on each server.   I've granted VIEW DEFINITION and EXECUTE permission...

View Article


Need some help with a query

Greetings everyone!I'm trying to write a query that sets up several rows as column values instead, similar to a pivot, though I've run into a bit of a an issue.The data looks similar to this:UserID,...

View Article


Query to see what components or features are installed

I've been trying to find a simple way to query to see what components and features are installed on my servers but it doesn't seem that simple. I'm looking for something that will identify components...

View Article

Max Worker Threads

Dear All,I keep receiving the following message in the SQL Server error logs Step 1 of job "job name" is being queued for the TSQL subsystemincrease the MaxWorkerThreads, every often and I did some...

View Article

Moving Datafiles

I have a number of databases with spaces in the name of the database. No matter what I try to use so I can move the datafiles I get a syntax error. What do I need to use to move database datafiles with...

View Article