Quantcast
Channel: Transact-SQL forum
Browsing all 23857 articles
Browse latest View live

Delete all data and reset Identity

Need Delete all data in all the tables  and reset Identity. (Looping)I designed a table tblOrderByRelationship which has a priority order to delete first the child thenparent tables.Norbert

View Article


What is Database Container Project

Hi All,What is Database Container Project?Here i am not talking about Creating Database Project by using Visual Studio Team system For Database ProfessionalsIs it comes under SQL Server Scope. or .NET...

View Article


Create text files in stored Procedure in SQL

HelloI have select SQL statement in my Stored procedure. Now, I want to load data from sql to text file.Can anyone suggest me the ways to do it? I know one SQL to load data from sql table to text...

View Article

Need Help with Identification of related records

I am needing to create a result set of customers who are related by phone numbers.The phone number records are stored in various tables within the database.  I have already consolidated the phone...

View Article

OpenXML and Cross Apply Query Help !

Folks:I need help with XML query. I have this XML data and I'm using OPENXML to shred the data into table. For each ModelValue (/DataOutputEntries/ARun/SecXml/Sec/SRateArr/SRateArrValues/ModelValue)...

View Article


date or time that are too negative or large to display as #########

In excel export from an app I am getting an error for one column value -date or time that are too negative or large to display as #########. Though that coulmn data type is not datetime and simply...

View Article

Table Alias & CTE Naming Conflict in MERGE (Exam 70-461)

The following T-SQL segment is from Exam 70-461 Training Kit, "Using the MERGE statement" (page 392 - may not be correct):WITH SRC AS( SELECT * FROM Sales.Orders WHERE ShipCountry = N'Norway' ) MERGE...

View Article

Image may be NSFW.
Clik here to view.

Help with complex CTE expression

Hi all,I was recently (and very kindly) helped by Jesus under the following thread Common Table Expression Help.Being a complete newbie to CTE's, I was at a loss on how to achieve my goal and whilst I...

View Article


SQL query question

EmplyeeJobs table has a column "Status" is bit type and possible value is 1, 0 and null.One EmployeeJobs may have mutltiple rows with different status values in a day.we need to get status for each day...

View Article


Image may be NSFW.
Clik here to view.

Delete duplicates from tables

Hi,I have Tables USERS_Pdt with data coulmns -  Product, UserID, Email, Gender, City, State, .... and Tables USER  with data coulmns -  UserID, Email, Gender, City, State, .... with Unique Non...

View Article

How can I query two different columns that make up one column?

I have a Report Request that gets relatively the same information from two different tables and two different columns and will be identifiable as the same column within a report. I don't think I can do...

View Article

Image may be NSFW.
Clik here to view.

Finding multiple hashtags in one record

All,I think I'm close (perhaps not) to getting my desired output. I want to parse out, into separate records, the string immediately following a hashtag.Here is my example:--DROP TABLE #NUMS CREATE...

View Article

Abreviated month to year to date?

Hi,We have a table that tracks transactions by accounting period, it is a varchar field and it stores the information in a mmm-yyyy format.  I have been asked to create a report that includes year to...

View Article


Indexes - Behaviour on UPDATES

I would like to know what happens in the sense of performance when a non-indexed column in a table is updated. Is there any need to drop the indexes first to UPDATE that non-indexed column and then...

View Article

On Passing Microsoft Exam 70-461: Querying Microsoft SQL Server 2012

In my dream last night I passed with a score of 956. In reality 906. I did not do any special preparation except a few hours yesterday with the MERGE statement and the FOR XML clause since I am not...

View Article


Date Issue

Hi, I have the following output in a table: UID        FID        nDate ----------------------------------- 178        100        2013-06-03 16:12:23.000 178        99        2013-05-30 07:30:41.000...

View Article

Trouble with Profiler

I am profiling a database to discover some of the tables etc to create a custom report.  The database is third party, but I can see all the tables in SQL Server 2008.  I can see the data on one of the...

View Article


default data_compression

what is default data copression type for sql 2008 R2. Can we identify it?Best Luck, Shenoy

View Article

Image may be NSFW.
Clik here to view.

How to display a multi-level hierarchy?

I have two tables: EmployeeMaster and EmployeeDetails. The schema of both are as below: Sample data in both tables can be seen via these links. Because of the restriction of uploading only two images,...

View Article

Need Help in updating a xml (stored as text datatype)

Posted - 06/06/2013 :  17:58:25             Hello Everyone,  I am new to sql server, I am trying to come up with a sql block through which i can update the XML stored in a table as a text. In order to...

View Article
Browsing all 23857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>