function

Technical Article

RE: Looking for single system query to return the rowcount of all tables in a DB

  • Reply

or you can try this. sp_msforeachtable @command1 = 'print ''?''' ,  @command2 = 'select count (*) from ?'  sp_msforeachtable will perform up to three commands on each table in the database. When running, it replaces the ? with the name of the table. 

You rated this post out of 5. Change rating

2005-05-13

Technical Article

RE: Best Practices for Database Design

  • Reply

I, for one don't care what the iso standard says, they are wrong.  A table does not represent a set of entities.  Tables represent a single predicate function.  So the Employee table with the following attributes:EmpNo, FirstName, LastName, DeptNo, Address,...MEANS literally "Employee (EmpNo) has a first name of (FirstName), a last  name of (LastName), works […]

You rated this post out of 5. Change rating

2005-04-06

Technical Article

RE: How to get available memory using SQL

  • Reply

It's not a table : run this in the master table Select objectproperty(object_id('sysperfinfo'), 'TableIsFake') It will return 1. This means than when you query that table, Sql server meterializes it so that the query can execute, but this information is never actually kept on the hd like a real table. checks BOLS : objectproperty::TableIsFake

You rated this post out of 5. Change rating

2005-03-02

Technical Article

RE: Re arranging table for reporting

  • Reply

You have 2 pivots to perform. To translate Column names into data values, you can use a UNION query. This converts the In1, In2 and In3 column into values within a column named "In":Select ID, Month, 1 As In, In1 As Amount From YourTable Union Select ID, Month, 2 As In, In2 As Amount From […]

You rated this post out of 5. Change rating

2005-02-02

Technical Article

RE: Table types

  • Reply

It can be done to mark a table as a system object but that requires going out of your way to upset the sysobjects table manually or use sp_MS_marksystemobject procedure which is not documented.You should be able to delete and recreate these tables but there are issues trying to change it back to a user […]

You rated this post out of 5. Change rating

2005-01-12

Technical Article

RE: excluding fields in my SELECT from the GROUP BY clause

  • Reply

Hi there.Well, I can't begin to try understanding what is going on, or the purpose of it all, however it seems like there's a lot of calculations, searched cases and stuff in there... Very briefly, I don't think that you can change the group by  in any easy way... (At least not without further knowledge […]

You rated this post out of 5. Change rating

2005-01-10

Technical Article

Defrag/Re-Index

  • Topic

My Database hasn't been Defragged or Reindexed in over a year (maybe never) and it is timing out all over the place,so I really need to do this soon!  I have been reading about indexes since the begining of the week (I knew nothing till then). I have also read almost everything on this site about them […]

You rated this post out of 5. Change rating

2005-01-05

2 reads

Technical Article

RE: Applying Password to SA Account

  • Reply

Brian,Don't forget to turn on your pager after that.People who install SQL server with a blank password tend to use it in the applications for connection strings. Those applications will not be able to connect to the database after you change the password. Be prepared to explain things to them.Another thing: Some (me included) have their Enterprise […]

You rated this post out of 5. Change rating

2005-01-05

Technical Article

Importing a ''multiple'' space delimited text file into SQL

  • Topic

I am trying to import a text file (a log file generated by another program) into SQL. The log file on the face of looks nicely formatted, however upon closer inspection, they are not tabs or spaces but multiple spaces! the number of spaces can differ widely depending on the first columns value. Thus when I […]

You rated this post out of 5. Change rating

2005-01-04

76 reads

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