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

GET all children for parents

Hi all - i have this code to get all the children under a particular parent and it is working but it only works with one parent at a time. how can i modify this so that I can pass multiple parents and...

View Article


How to get further diagnostics from SQL Server for intermittent "Could not...

Hi,I am trying to diagnose and resolve an intermittent problem on a remote customer's system.  The reported problem is being unable to logon to the application that I support until they restart the...

View Article


query to find the column value in another table

Hi,I have two table, one temporary table #TEMP1 containing the result set of xp_fixeddrives  with columns- drive letter and freespaceAnother table is sys.datafiles which have a column name -...

View Article

Representing Large Roman Numerals Like 5000

Quote: "Really Big NumbersNumbers greater than 1,000 are formed by placing a dash over the symbol, meaning "times 1,000", but these are not commonly...

View Article

SQL Bat

Please review batch file. I need to execute this file using sql authentication on sql server. And my log.log ,batch file, sql scripts on same folder location. Please give me advice for same....

View Article


Replacement for Bigint datatype

 Hi,    Can v use any other data types for replacing bigint data type which is 8 bytes.. I need to replace it with 4 bytes.. Suggest me other than int data type.

View Article

Threads in CLR

I have a CLR table function that works fine but trying to improve its performance by using some threading.I have the following code working but my WaitAll doesn't work when it is compiled and ran from...

View Article

Script to create TSQL2012 sample database from book "Training kit (70-461)...

Got this book in order to prepare for "Training Kit Exam 70-461" by Itzia-ben-Gan, Dejan Sarka, Ron Talmage.Here it says -"TSQL2012 sample database and source code Most exercises in this Training Kit...

View Article


Image may be NSFW.
Clik here to view.

xp_cmdshell completes with error code 1

Hello,I have a problem with SQL servers and the xp_cmdshell command.  Both servers have the same setup  and same accounts with same permissions but one server will complete an xp_cmdshell command...

View Article


PostgerSQL Scripts to SQL Scripts

Hi,Am having postgreSQL script files, i want to convert the same to SQL scripts. Is there any online tool available to convert it or any easy way to convert it.Am not having any PostGre ODBC driver am...

View Article

Another efficiency question for the experts

Hello SQL experts!I have another question regarding SQL efficiency. This time for a query. Would you mind taking a look at the query below and giving your input on how it could be written to be more...

View Article

Bug: SQL Server 2012: Stored Procedure using temporary table with an added...

Hi!I tested the execution of the following procedure for SQL Server 2008 and SQL Server 2012.USE model GOCREATE PROCEDURE dbo.Test AS BEGIN   CREATE TABLE #tempTest(id INT NOT NULL);   ALTER TABLE...

View Article

Getting Consecutive Day Count Grouped By

I am trying to get the consecutive count of days (grouped by homeroom & building) from a table without having to use a cursor. The count should only include days <= @MaxDate in consecutive order...

View Article


How to create a store procedure based on Current Date and update another table

I have a table in my SQL Server, which contains Month End Date, Month Number and Fiscal YearI need to create a store procedure which would take Current Date and compare with the Month End Date from my...

View Article

Date format with slashes instead of dashes

Is there a way to make sql server to store dates with slashes instead of dashes, e.g  I want it to be like 12/01/2013 instead of 2013-12-01

View Article


Not getting all rows

Hi, I am using SQL-Server Management Studio-2008 and running a query to see the results but I am getting only 89 rows. I also went to the options and increased the characters to 8192 for 'result to...

View Article

get ancestor based on a condition

hi all, please see thre sample data below. i am trying to figure out how to get the next available ancestor for a given child.to get sarah's parent, I need to go to sarah's immidieate parent who is...

View Article


Exclude a sequence of characters when using LIKE

Hi,Mainly I am just wondering if I can exclude a sequence when using LIKE .I want this to return IDs that match the ending but not if they begin with the 'AB' sequence.String...

View Article

Stored Procedure OUTPUT Parameter NULL After RAISERROR

Hi all.I am trying to use an OUTPUT parameter in a stored procedure that returns a value which will be later used regardless if an error occurred in the procedure or not.  It is a trace collector XML...

View Article

Column unique by substring

I have a column that is nine characters long.  I need the uniqueness of that column to be by the first six characters.  Is this possible?

View Article
Browsing all 23857 articles
Browse latest View live


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