Viewing 15 posts - 76 through 90 (of 422 total)
If the original data is a DATETIME (or other date datatype) there's no need to convert it to a varchar until after the sort. CAST the date value as DATE...
July 15, 2013 at 12:09 pm
Also available under System Views is the INFORMATION_SCHEMA collection which can give you all the information you need for any metadata in the the database.
For listing out your table collection...
July 15, 2013 at 11:49 am
See if any of this helps. I had to make a lot of guesses and changes to the sample data to get it to work.
;WITH
cteGeneralLedger
(GNLID,GNLCLIID,GNLCOAID,GNLFSMID,GNLBalanceBase)
AS (
...
July 15, 2013 at 11:35 am
Minnu (7/15/2013)
i want to generate Table with Data Scripts with Tasks > Generate Scritps,
but i dont to all the records, i want only few records scripts based on...
July 15, 2013 at 9:45 am
ramanathan.raman88 (7/15/2013)
The file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\sample.mdf' cannot be overwritten. It is being used by database 'sample'.
File 'sample' cannot be restored to 'C:\Program...
July 15, 2013 at 9:32 am
gaddamshiva (7/13/2013)
Hi...How to take backup of Single table and how to restore? is there any query like database backup?
shivakumar...
This is a procedure I've been working on...it's...
July 15, 2013 at 8:58 am
See article by Dwain Camps 2012/11/29
http://www.sqlservercentral.com/articles/String+Manipulation/94365/[/url]
His article on pattern matching may provide a solution. Based on your limited example, I came up with this
script that works on that limited...
July 14, 2013 at 7:37 pm
I didn't invent the code use in this function so can't take credit (or blame), but it comes in handy sometimes. I did turn it into an itvf and added...
July 12, 2013 at 6:33 pm
Here's another approach:
Sample data:
IF OBJECT_ID('tempdb..#tbl') IS NOT NULL
DROP TABLE #tbl
CREATE TABLE #tbl
(
ID INT IDENTITY
...
July 12, 2013 at 6:24 pm
brickpack (7/12/2013)
July 12, 2013 at 12:04 pm
Script out the create table statement for the table you need to
copy WITHOUT ANY KEYS. the target table should be a HEAP.
Script all of the necessary keys separately then apply...
July 12, 2013 at 11:34 am
dwain.c (7/12/2013)
If you do it the way you suggested, which is to break it into multiple SQL statements, you should consider 2 things:
1. Wrap the SQL statements in...
July 12, 2013 at 11:18 am
brickpack (7/12/2013)
I'm also having a hard time appending this to the top of the file:<?xml version="1.0" encoding="ISO-8859-1"?>
Any suggestions...?
I usually hard-code any header info and append it manually to the XML...
July 12, 2013 at 11:06 am
I've used this exceptional FREE auditing solution to create not only an audit trail but adapted it for archiving at the same time as well. Yes, it's complicated, but the...
July 11, 2013 at 11:47 pm
Something like this?
;WITH DH_info (C_ID,H_Type,Name,A_Name,D_Date,D_Status,D_TYPE)
AS
(
SELECT 1,'22','George','Washington','2012-01-09','U','23' UNION ALL
SELECT 2,'33','John','Adams','2013-01-09','I','29' UNION ALL
...
July 11, 2013 at 11:15 pm
Viewing 15 posts - 76 through 90 (of 422 total)