Transaction Log

Technical Article

RE: Inserting a record count using Dynamic SQL

  • Reply

alternative method for placing the record count from a table into a variableDECLARE @sql nvarchar(100),@Reccount int SET @sql = 'SELECT COUNT(*) FROM InterchangeDTA.dbo.' + @TableName EXECUTE sp_executesql @sql, N'@Reccount int output', @Reccount output Then you can insertINSERT INTO TableCounter (TableName) VALUES @Reccount btw, you state TableName as the column for insert but use the count […]

You rated this post out of 5. Change rating

2004-05-25

Technical Article

RE: Backup using Microsoft Access

  • Reply

You might use something like that (part of my logshipping-procedures): /* ---------------------------------------------------------------------------*/ -- Vollbackup.sql -- T-SQL-Script zum Erstellen eines Vollbackups aller Datenbanken eines -- beliebigen Microsoft-SQL-Servers (2000) -- Erstellt am: 3.11.2003 -- Author: Karl Klingler, karl.klingler@dr-stahl.de /* ---------------------------------------------------------------------------*/ CREATE PROCEDURE vollbackup @DestSrv sysname @DestPath sysname AS PRINT '++++++++++ Begin der Vollsicherung vom '+convert(char(22),getdate(),113)+' +++++++++++' -- […]

You rated this post out of 5. Change rating

2004-05-07

Technical Article

RE: Question of the Day for 15 Apr 2004

  • Reply

In SQL Server there are two large categories of roles: database and server. The sysadmin role is a server role. While we can create user-defined database roles, server roles are fixed. The list of built-in roles: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_6ndx.asp

You rated this post out of 5. Change rating

2004-04-15

Technical Article

RE: SQL Default Values

  • Reply

Try also a computed column.  Eg.create table xxx (acct char(3), acct1 as '0000' + acct)insert xxx values ('001') insert xxx values ('002') insert xxx values ('003')select * from xxxacct acct1   ---- ------- 001  0000001 002  0000002 003  0000003(3 row(s) affected) update xxx set acct = replace(acct, '0', '1') select * from xxxacct acct1   ---- ------- 111  […]

2004-04-13

Technical Article

RE: Changing Column Names in a Store Prosedure

  • Reply

Please first tell me. Are you currently using SQL Server Yukon? Here is the answer to your question with assumption of SQL2K in use.Create views with different date ranges. You should able to provide two different column names in the two different views. If you provide more details of what compell you to use different […]

You rated this post out of 5. Change rating

2004-04-09

Technical Article

RE: Capturing success/failure of a stored proc called from an Execute SQL task

  • Reply

Hi BillThanks for the replies.  Sorry if I am confusing the issue.  What it comes down to is this:  If the stored proc fails due to a hard database error (@@error <>0) then the task should fail, that's the easy part.  I need to be able to capture business logic "soft" failures that are coded […]

You rated this post out of 5. Change rating

2004-03-23

1 reads

Technical Article

RE: Update Query

  • Reply

You could alternatively write two update statements.. UPDATE #tbl SET  #tbl.Amount = #tbl.Amount + (SELECT Sum(T.Amount) FROM #tbl T WHERE T.RowNo < #tbl.RowNo) WHERE #tbl.Type = 'S'UPDATE #tbl SET  #tbl.Amount = #tbl.Amount + (SELECT Sum(T.Amount) FROM #tbl T WHERE T.Type = 'D') WHERE #tbl.Type = 'F' HTH...

You rated this post out of 5. Change rating

2004-03-19

Technical Article

RE: Dynamic DTS tasks problem

  • Reply

Thanks for all the suggestions.  It turns out that the SQL Server box had the regional setting for short date set as "m/d/yy".  It's not a sql specific setting, but a global setting for the server.  I was already using the TO_DATE function (learned pretty quickly to do this anytime passing a date to Oracle), so […]

You rated this post out of 5. Change rating

2004-03-08

Blogs

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Snowflake + Azure blob

By

Let’s go back to data platforms today and I want to talk about a...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers