Geeks With Blogs

News Copyright © 2008-2015 Paula DiTallo
Ask Paula! ...bringing you notes from the field...
Think of this as a lightweight alternative to SQL profiler. Under the hood of SQL profiler, there exists SQL Trace -- which provides a collection of stored procedures to generate trace info. Cut and paste the t-script below to see how it works.-- Pay attention to what the server settings for traces look like first:select * from sys.tracesgo-- you are ......

These general statements will get you the information that you're looking for:SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_SIZE, COLUMN_TEXTFROM "SYSIBM"."SQLCOLUMNS"WHERE TABLE_SCHEM = 'YourSchema' AND TABLE_NAME = 'YourTableName'This will get you the definitions of the columns:SELECTt.table_schema as Library,t.table_name,t.tabl... ......

Go to the server your are interested in gathering the information from, then issue this statement:WITH LastRestoresOnServer AS(SELECT sysdb.[name] as dbName, sysdb.[create_date], sysdb.[compatibility_level], sysdb.[collation_name], r.*, ROW_NUMBER() OVER (PARTITION BY sysDb.Name ORDER BY r.[restore_date] DESC) as RNFROM master.sys.databases sysdbLEFT ......

You were probably trying to do a comparison between 2 databases with different collation settings on a WHERE clause or on a join. Here's how you would do the comparison with a JOIN: Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Select * from source db1.schema.table1 as t1 join source db2.schema.table2 as t2 on t1.col1 collate ......

This pattern works well:USE [yourDatabase] GO IF OBJECT_ID('ThisSproc', 'P') IS NOT NULL DROP PROCEDURE ThisSproc; GO CREATE PROCEDURE ThisSproc @PersonId INT, @NewMoneyCollected MONEY = 0 AS BEGIN BEGIN TRY BEGIN TRANSACTION; UPDATE OrganizationTripFunding SET Balance = MoneyCollectedAllYear + @NewMoneyCollected WHERE PersonId = @PersonID; COMMIT TRANSACTION; ......

The full error message reads as "Failed to deploy project. For more information, query the operation_messages view for the operation identifier '39212'. (Microsoft SQL Server, Error: 27203)In a nutshell, the most common reason for this is the latency between SQL Server logging the deployment operation within the SSIS catalog database and the stored ......

If you aren't able to install from the Help\Install New Software menu, it is probably because the zip file doesn't have the content.jar/artifacts.jar needed to do so. You will need to navigate to where you've installed Eclipse, then follow these steps: 1. Navigate to the Dropin drectory2. Create a new subdirectory (folder).3. Expand the zip file to ......

This usually happens when you restore a database. For example, you restore a copy of production database X to your QA server. In essence, you have overwritten the user info of that specific database with what exists in production. This creates an orphan user -- where you have no login associated with a user in that database on a server that once associated ......

There are several reasons for this. The most common reason is that the account you are using while logged into mssql through ssms does not have access to the drive definition you are using as your source. Network drives are a good example of an access conflict.Assuming you have access to the drive, try redirecting the network drive to a local drive ......

In SSMS, there's a Generate Script utility (read: only available under version 2008 and up) . Here are the steps you would need to take to make use of the utility: Right click on the database you're interested in and go to Tasks -> Generate ScriptsSelect the tables and/or any other objects you'd like in order to get them into the script.Navigate ......

Here's an example using forfiles to scan your storage. This command line will look for files over 200mb on the C:\ drive after 1/1/2014. forfiles /P C:\ /M *.* /S /D +"01/01/2014" /C "cmd /c if @fsize gtr 209715200 echo @path @fsize @fdate @ftime"For more information, check out Microsoft's examples and syntax page:http://technet.microso... ......

Try using count_big(*) instead-- this is defined as bigint instead of int.In this example, I am looking for how many 100s of millions of rows exist by product type where each row is roughly 300 bytes wide to ultimately obtain how many gigabytes of data I need to provision.select x.ProductType, count_big(*) as ProdCount, (count_big(*)*300) as TotalBytes, ......

Click on the App Button (aka: "Drawer" ) -- That's the key with the multiple squares, click on menu , select view type, select alphabetical grid.


Open up an MSDOS command window. Type :net fileThe id, path, user name, loc# for the file will show up in a text list. Once you find the file you want unlock, you'll need to remember the id. To unlock the file, go back to the MSDOS command window. Type:net file 99/close (where 99 = file id)On a windows server there are 2 other ways:1. From an MSDOS ......

We've all been there-- like -- where's that offline htm file i bothered to save last week ... oh I think it was blue something... or was it something blue? find ../ -name '*blue*.htm*' -print If you want to keep it in an output file to sort through later while you do something else: find ../ -name '*blue*.htm*' -print > $HOME/ foundBlue.txt ......


Try holding down the Menu and Selector (push-button circle in the center) down at the same time for at least 2 seconds.


The simplest answer is because the iPOD software detects that it is unsafe (read: data loss) for your iPOD, Computer or both if you were to disconnect the cable without ejecting the device first.Here's what to do:On the Mac-- Click on the Finder icon Pick the iPOD icon.Navigate to the File menu--select Eject iPOD On a Windows OpSys device-- On the Start ......

One convenient way is to make use of the template feature (aka: Template Explorere) in SSMS.

1. Navigate to the View menu in SSMS
2. Select Template Explorer->right click on SQL Server Tempaltes.
3. Click New and create folder; use to add/edit templates.




For Windows 7:1. Right click any blank area on your desktop. 2. Left click Personalize->Display Settings. A window will open that shows a monitor. 3. Navigate to Change Display Settings. A new window will appear showing 2 monitors. 4. Click Identify Monitors. When the monitor you are on is the main monitor, you will see "This is currently your main ......

As with most questions asked about monitoring/assessing/admini... MS SQL Server installations, the answer is "it depends".There are many other blogs/resources/etc. online that can get into the specifics--think of this mini-blog as a snake-bit kit! :) Overall, to get to a list of objects that fall under the DMV (Dynamic Management Views) category, ......

You're really looking of the modify_date in the sys.objects table where the type is either a stored proc or a function. This works on a database by database level -- to elevate this search to the server level, you'll have to use the loop sproc sp_msforeachdb SELECT name, create_date, modify_date FROM sys.objectsWHERE type = 'P' -- change 'P' to 'FN' ......

In t-sql/mssql, if you have a known NULL value you can issue a statement like:SELECT ISNULL(BirthDate,'1/1/1970 12:00:00 AM') as BirthDateFROM DrviersThe ISNULL function is replacing any nulls found in the BirthDate column to a default value of 1/1/1970.In other situations, you may not have just NULL values, but other possibilities as well. SELECT ISNULL(BirthDate,'1/1/1970 ......

If you're seeing this error, or a similar access denied error you'll need to have your windows account given DCOM permissions. DBAs generally have the ability to add you.If you're a DBA and want to add a developer to be able to connect to the SSIS services to deploy packages here's a quick punch list:Logon to the target SQL Server. Go to Start->Run ......

This answer depends on what version of SQL you're running. A FETCH clause will work for all. Here's an example:SELECT FLBILC, FLDATE, FLTCK#, FLCST# FROM PRDMETRO.FLHISTAF WHERE FLBILC = 'CMD' ORDER BY FLBILC FETCH FIRST 10 ROW ONLY;The equivalent in T-SQL would be:SELECT TOP 10 FLBILC, FLDATE, FLTCK#, FLCST# FROM PRDMETRO.FLHISTAF WHERE FLBILC = 'CMD'; ......

This happens when you're in the SSMS gui making changes to the table that either affect the behavior of an index, cause existing data to be truncated/nulled, etc. This can also happen you try to change the order of columns, or change datatypes. If your credentials allow it, you can get past this message in order to truly shoot yourself in the foot! ......

Copyright © Paula DiTallo | Powered by: GeeksWithBlogs.net | Join free